public class CiliaInstanceWrapper extends Observable implements CiliaInstance, org.apache.felix.ipojo.util.TrackerCustomizer, org.apache.felix.ipojo.InstanceStateListener
Constructor and Description |
---|
CiliaInstanceWrapper(org.osgi.framework.BundleContext context,
String instanceName,
String filter,
Dictionary props,
Observer obs)
Create an iPOJO wrap instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addedService(org.osgi.framework.ServiceReference reference)
When the factory service is tracked.
|
boolean |
addingService(org.osgi.framework.ServiceReference reference)
Bassed on the filter, the addingService must be the good one.
|
protected void |
createInstance(org.apache.felix.ipojo.Factory ipojoFactory)
Create the instance usgin the iPOJO Factory
|
org.apache.felix.ipojo.ComponentInstance |
getInstanceManager() |
Dictionary |
getInstanceProperties()
Obtain a copy of the instance properties.
|
Object |
getInstanceProperty(Object key)
Obtain the instance property.
|
String |
getName()
Get the instance name.
|
Object |
getObject()
Get the object instance.
|
int |
getState()
Get the instance state.
|
String |
getStateAsString()
Get the state value as a string.
|
void |
modifiedService(org.osgi.framework.ServiceReference reference,
Object service)
Modifying the factory service, nothing to do.
|
void |
refresh()
Will notify the observers there is a change in the instance status.
|
void |
removedService(org.osgi.framework.ServiceReference reference,
Object service)
When removing the factory service, it must remove the instance.
|
void |
start()
Start the tracker.
|
void |
stateChanged(org.apache.felix.ipojo.ComponentInstance instance,
int newState) |
void |
stop()
Stop the Instance wrapper, it unregister the tracker and dispose the
instance.
|
protected void |
unregisterTracker()
Unregistering the factory tracker.
|
void |
updateInstanceProperties(Dictionary properties)
Update the instance's runtime properties
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public CiliaInstanceWrapper(org.osgi.framework.BundleContext context, String instanceName, String filter, Dictionary props, Observer obs)
context
- The OSGi bundle context.instanceName
- The name of the instance, this is not the iPOJO instance name,
is an abstract name.filter
- A filter to search the iPOJO factory which will create the
instance.props
- Properties used when creating the instance.obs
- The observer reference.protected void createInstance(org.apache.felix.ipojo.Factory ipojoFactory)
public Dictionary getInstanceProperties()
getInstanceProperties
in interface CiliaInstance
public Object getInstanceProperty(Object key)
getInstanceProperty
in interface CiliaInstance
public Object getObject()
getObject
in interface CiliaInstance
public int getState()
getState
in interface CiliaInstance
public String getStateAsString()
public void refresh()
refresh
in interface CiliaInstance
public String getName()
getName
in interface CiliaInstance
public void start()
start
in interface CiliaInstance
public void stop()
stop
in interface CiliaInstance
public void updateInstanceProperties(Dictionary properties)
CiliaInstance
updateInstanceProperties
in interface CiliaInstance
public void stateChanged(org.apache.felix.ipojo.ComponentInstance instance, int newState)
stateChanged
in interface org.apache.felix.ipojo.InstanceStateListener
public org.apache.felix.ipojo.ComponentInstance getInstanceManager()
protected void unregisterTracker()
public void addedService(org.osgi.framework.ServiceReference reference)
addedService
in interface org.apache.felix.ipojo.util.TrackerCustomizer
public boolean addingService(org.osgi.framework.ServiceReference reference)
addingService
in interface org.apache.felix.ipojo.util.TrackerCustomizer
public void modifiedService(org.osgi.framework.ServiceReference reference, Object service)
modifiedService
in interface org.apache.felix.ipojo.util.TrackerCustomizer
public void removedService(org.osgi.framework.ServiceReference reference, Object service)
removedService
in interface org.apache.felix.ipojo.util.TrackerCustomizer
Copyright © 2012-2013 Adele Team | LIG. All Rights Reserved.