T
- service implementation template type
(for convenient instance access)public abstract class SimpleServiceActivator<T>
extends java.lang.Object
implements org.osgi.framework.BundleActivator
Modifier and Type | Field and Description |
---|---|
protected T |
serviceImpl
Instance of service implementation
|
Constructor and Description |
---|
SimpleServiceActivator(java.lang.Class<?> serviceClass,
java.lang.String serviceName)
Creates new instance of SimpleServiceActivator
|
Modifier and Type | Method and Description |
---|---|
protected abstract T |
createServiceImpl()
Called on bundle startup in order to create service implementation
instance.
|
void |
start(org.osgi.framework.BundleContext bundleContext)
Initialize and start the service.
|
void |
stop(org.osgi.framework.BundleContext bundleContext)
Stops this bundle.
|
protected T serviceImpl
public SimpleServiceActivator(java.lang.Class<?> serviceClass, java.lang.String serviceName)
serviceClass
- class of service that will be registered on bundle
startupserviceName
- service name that wil be used in log messagespublic void start(org.osgi.framework.BundleContext bundleContext) throws java.lang.Exception
start
in interface org.osgi.framework.BundleActivator
bundleContext
- the BundleContextjava.lang.Exception
- if initializing and starting this service failspublic void stop(org.osgi.framework.BundleContext bundleContext) throws java.lang.Exception
stop
in interface org.osgi.framework.BundleActivator
bundleContext
- the BundleContextjava.lang.Exception
- if the stop operation goes wrongprotected abstract T createServiceImpl()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.