public abstract class AbstractConnectionManager<ConnectionServiceType extends ConnectionService> extends Object implements SingleServiceListener<DriverFactory>
Constructor and Description |
---|
AbstractConnectionManager(Class<ConnectionServiceType> clazz,
BundleContext context,
String connectionId,
ConnectionInformation connectionInformation) |
Modifier and Type | Method and Description |
---|---|
protected void |
createConnection()
Create a new connection and register it with OSGi
|
protected abstract AbstractConnectionService |
createConnectionService(DriverFactory factory,
ConnectionInformation connectionInformation) |
void |
dispose()
Dispose the tracker and the connection
|
protected void |
disposeConnection()
Revoke the service registration and dispose the service
|
void |
serviceChange(ServiceReference<DriverFactory> reference,
DriverFactory factory)
The method is called when the service instance has changed
|
public AbstractConnectionManager(Class<ConnectionServiceType> clazz, BundleContext context, String connectionId, ConnectionInformation connectionInformation)
public void dispose()
public void serviceChange(ServiceReference<DriverFactory> reference, DriverFactory factory)
SingleServiceListener
serviceChange
in interface SingleServiceListener<DriverFactory>
reference
- the new service reference or null
if no matching
service is availabefactory
- the new service instance or null
if no matching
service is availabeprotected void createConnection()
protected abstract AbstractConnectionService createConnectionService(DriverFactory factory, ConnectionInformation connectionInformation)
protected void disposeConnection()
Does nothing if there is no current registration