[OSGi services] Connection configurations as services with a Connection Service consuming them [message #105963] |
Fri, 07 March 2008 12:46 |
Philipp Kursawe Messages: 135 Registered: July 2009 |
Senior Member |
|
|
Hello,
I need a Connection Provider Service to be present in the system and
users of this connection should just be able to use the currently active
one to interact with it. For instance one could register a
"ConnectionUser" service that will be injected the currently active
Connection to work with by Dependency Injection.
So inspired by ApplicationDescription services I thought about
registering 0..n Connection Configuration Services (that can be altered
in the UI or console) and the following to happen:
1. If there is no Connection Provider Service registered yet, a new one
is created and injected to all registered ConnectionUser by calling
ConnectionUser.setProvider(newlyCreatedProvider).
2. If an existing Connection Configuration is changed and its the one
that is currently providing configuration for the active Connection
Provider than the provider disconnects and reconnects with the new settings.
3. If the currently existing providers configuration is removed from the
system the Provider is also removed.
4. A new provider is created by activating a Connection Configuration,
the old one is discarded.
Is this design any good or has it flaws?
I am not sure yet, how I could change the Connection Configuration after
the service is registered (its the properties of the service), since I
do not have access to the registered Services initial Properties.
Any thoughts?
Phi
|
|
|
Powered by
FUDForum. Page generated in 0.03434 seconds