Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide functionality to stop pva server when running in OSGi #100

Open
joeshannon opened this issue Aug 6, 2020 · 0 comments
Open

Provide functionality to stop pva server when running in OSGi #100

joeshannon opened this issue Aug 6, 2020 · 0 comments

Comments

@joeshannon
Copy link
Contributor

A pva server can be created using ServerFactory.start() however, unless I am missing something, there doesn't appear to be any way to stop the server.

As we are consuming org.epics.pvaccess as an OSGi bundle for use in an Eclipse application we don't have access to ServerContextImpl (which has a useful factory method to start the server and give access to the ServerContextImpl in order to call e.g shutdown or destroy). This is because the containing package is named org.epics.pvaccess.server.impl.remote and therefore (by default) the maven-bundle-plugin doesn't export this as it contains 'impl'.

One solution might be to return a reference to the new ServerContext instance created via ServerFactory? The ServerContext interface is already importable/usable in OSGi as it's not in the 'impl' package.

This would be useful for tests where the server should be able to be started (@Before) and stopped (@After) in order to not interfere with other tests in the same execution. Calling ServerFactory.start() creates a new server every time.

DiamondLightSource-Gerrit-server pushed a commit to openGDA/gda-core that referenced this issue Oct 5, 2022
This uses a horrible workaround with reflection but there doesn't
appear to be another solution until
epics-base/epicsCoreJava#100 is addressed.

The other option would be to skip these tests but they are fairly
essential to the Malcolm scanning infrastructure.

Change-Id: I3c96eb2de4b5133659854c74427bb993f9443e8e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant