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, setChangedpublic 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 CiliaInstancepublic Object getInstanceProperty(Object key)
getInstanceProperty in interface CiliaInstancepublic Object getObject()
getObject in interface CiliaInstancepublic int getState()
getState in interface CiliaInstancepublic String getStateAsString()
public void refresh()
refresh in interface CiliaInstancepublic String getName()
getName in interface CiliaInstancepublic void start()
start in interface CiliaInstancepublic void stop()
stop in interface CiliaInstancepublic void updateInstanceProperties(Dictionary properties)
CiliaInstanceupdateInstanceProperties in interface CiliaInstancepublic void stateChanged(org.apache.felix.ipojo.ComponentInstance instance,
int newState)
stateChanged in interface org.apache.felix.ipojo.InstanceStateListenerpublic 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.TrackerCustomizerpublic boolean addingService(org.osgi.framework.ServiceReference reference)
addingService in interface org.apache.felix.ipojo.util.TrackerCustomizerpublic void modifiedService(org.osgi.framework.ServiceReference reference,
Object service)
modifiedService in interface org.apache.felix.ipojo.util.TrackerCustomizerpublic void removedService(org.osgi.framework.ServiceReference reference,
Object service)
removedService in interface org.apache.felix.ipojo.util.TrackerCustomizerCopyright © 2012-2013 Adele Team | LIG. All Rights Reserved.