|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.ipojo.IPojoFactory
org.apache.felix.ipojo.ComponentFactory
public class ComponentFactory
The component factory manages component instance objects. This management consist in creating and managing component instance build with the component factory. This class could export Factory and ManagedServiceFactory services.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.felix.ipojo.IPojoFactory |
---|
IPojoFactory.RequiredHandler |
Field Summary | |
---|---|
protected Tracker |
m_tracker
Tracker used to track required handler factories. |
Fields inherited from class org.apache.felix.ipojo.IPojoFactory |
---|
m_componentDesc, m_componentInstances, m_componentMetadata, m_context, m_factoryName, m_instancesName, m_isPublic, m_listeners, m_logger, m_requiredHandlers, m_sr, m_state |
Fields inherited from interface org.apache.felix.ipojo.Factory |
---|
INVALID, VALID |
Constructor Summary | |
---|---|
ComponentFactory(org.osgi.framework.BundleContext context,
byte[] clazz,
org.apache.felix.ipojo.metadata.Element element)
Create a instance manager factory. |
|
ComponentFactory(org.osgi.framework.BundleContext context,
org.apache.felix.ipojo.metadata.Element element)
Create a instance manager factory. |
Method Summary | |
---|---|
void |
addedService(org.osgi.framework.ServiceReference reference)
A matching service has been added to the tracker, we can no compute the factory state. |
boolean |
addingService(org.osgi.framework.ServiceReference reference)
A new handler factory is detected. |
void |
check(org.apache.felix.ipojo.metadata.Element element)
Check method : allow a factory to check if given element are correct. |
ComponentInstance |
createInstance(java.util.Dictionary config,
IPojoContext context,
HandlerManager[] handlers)
Create a primitive instance. |
java.lang.Class |
defineClass(java.lang.String name,
byte[] clazz,
java.security.ProtectionDomain domain)
Define a class. |
java.lang.String |
getClassName()
Get the factory class name. |
ComponentTypeDescription |
getComponentTypeDescription()
|
java.lang.String |
getFactoryName()
Compute the factory name. |
PojoMetadata |
getPojoMetadata()
Returns manipulation metadata of this component type. |
java.util.List |
getRequiredHandlerList()
Compute required handlers. |
java.net.URL |
getResource(java.lang.String resName)
Return the URL of a resource. |
java.lang.Class |
loadClass(java.lang.String className)
Load a class. |
void |
modifiedService(org.osgi.framework.ServiceReference reference,
java.lang.Object service)
A used handler factory is modified. |
void |
removedService(org.osgi.framework.ServiceReference reference,
java.lang.Object service)
A used factory disappears. |
void |
starting()
Start the factory. |
void |
stopping()
Stop all the instance managers. |
Methods inherited from class org.apache.felix.ipojo.IPojoFactory |
---|
addFactoryStateListener, checkAcceptability, computeDescription, computeFactoryState, createComponentInstance, createComponentInstance, deleted, disposed, generateName, getBundleContext, getComponentDescription, getDescription, getHandler, getLogger, getMissingHandlers, getName, getRequiredHandlers, getState, isAcceptable, match, reconfigure, removeFactoryStateListener, start, stop, updated |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Tracker m_tracker
Constructor Detail |
---|
public ComponentFactory(org.osgi.framework.BundleContext context, byte[] clazz, org.apache.felix.ipojo.metadata.Element element) throws ConfigurationException
context
- : bundle contextclazz
- : the component classelement
- : metadata of the component
ConfigurationException
- occurs when the element describing the factory is malformed.public ComponentFactory(org.osgi.framework.BundleContext context, org.apache.felix.ipojo.metadata.Element element) throws ConfigurationException
context
- : bundle contextelement
- : metadata of the component to create
ConfigurationException
- occurs when the element describing the factory is malformed.Method Detail |
---|
public ComponentTypeDescription getComponentTypeDescription()
getComponentTypeDescription
in class IPojoFactory
public void check(org.apache.felix.ipojo.metadata.Element element) throws ConfigurationException
element
- : the metadata
ConfigurationException
- occurs when the element describing the factory is malformed.public java.lang.String getClassName()
IPojoFactory
getClassName
in interface Factory
getClassName
in class IPojoFactory
Factory.getClassName()
public ComponentInstance createInstance(java.util.Dictionary config, IPojoContext context, HandlerManager[] handlers) throws ConfigurationException
createInstance
in class IPojoFactory
config
- : instance configurationcontext
- : service context.handlers
- : handler to use
ConfigurationException
- : if the configuration process failed.IPojoFactory.createInstance(java.util.Dictionary, org.apache.felix.ipojo.IPojoContext, org.apache.felix.ipojo.HandlerManager[])
public java.lang.Class defineClass(java.lang.String name, byte[] clazz, java.security.ProtectionDomain domain)
name
- : qualified name of the classclazz
- : byte array of the classdomain
- : protection domain of the class
public java.net.URL getResource(java.lang.String resName)
resName
- : resource name
public java.lang.Class loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
className
- : name of the class to load
java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
- : happen when the class is not foundpublic void starting()
starting
in class IPojoFactory
public void stopping()
stopping
in class IPojoFactory
public java.lang.String getFactoryName()
getFactoryName
in class IPojoFactory
public java.util.List getRequiredHandlerList()
getRequiredHandlerList
in class IPojoFactory
public boolean addingService(org.osgi.framework.ServiceReference reference)
addingService
in interface TrackerCustomizer
reference
- : the new service reference.
TrackerCustomizer.addingService(org.osgi.framework.ServiceReference)
public void addedService(org.osgi.framework.ServiceReference reference)
addedService
in interface TrackerCustomizer
reference
- : added reference.TrackerCustomizer.addedService(org.osgi.framework.ServiceReference)
public void removedService(org.osgi.framework.ServiceReference reference, java.lang.Object service)
removedService
in interface TrackerCustomizer
reference
- : service reference.service
- : factory object.TrackerCustomizer.removedService(org.osgi.framework.ServiceReference, java.lang.Object)
public void modifiedService(org.osgi.framework.ServiceReference reference, java.lang.Object service)
modifiedService
in interface TrackerCustomizer
reference
- : the service referenceservice
- : the Factory object (if already get)TrackerCustomizer.modifiedService(org.osgi.framework.ServiceReference, java.lang.Object)
public PojoMetadata getPojoMetadata()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |