org.ow2.shelbie.core.internal.extension
Class CommandFactory

java.lang.Object
  extended by org.apache.felix.ipojo.IPojoFactory
      extended by org.ow2.shelbie.core.internal.extension.CommandFactory
All Implemented Interfaces:
org.apache.felix.ipojo.Factory, org.apache.felix.ipojo.util.TrackerCustomizer

public class CommandFactory
extends org.apache.felix.ipojo.IPojoFactory
implements org.apache.felix.ipojo.util.TrackerCustomizer

 command @action
  completer @component {multiple}
 


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.felix.ipojo.IPojoFactory
org.apache.felix.ipojo.IPojoFactory.RequiredHandler
 
Field Summary
 
Fields inherited from class org.apache.felix.ipojo.IPojoFactory
INSTANCE_NAME, m_componentDesc, m_componentInstances, m_componentMetadata, m_context, m_factoryName, m_isPublic, m_listeners, m_logger, m_requiredHandlers, m_sr, m_state, m_version
 
Fields inherited from interface org.apache.felix.ipojo.Factory
FACTORY_VERSION_PROPERTY, INSTANCE_NAME_PROPERTY, INVALID, VALID
 
Constructor Summary
CommandFactory(org.osgi.framework.BundleContext context, org.apache.felix.ipojo.metadata.Element metadata)
          Creates an iPOJO Factory.
 
Method Summary
 void addedFactory(org.apache.felix.ipojo.Factory factory)
           
 void addedService(org.osgi.framework.ServiceReference reference)
           
 boolean addingService(org.osgi.framework.ServiceReference reference)
           
 org.apache.felix.ipojo.ComponentInstance createInstance(Dictionary config, org.apache.felix.ipojo.IPojoContext context, org.apache.felix.ipojo.HandlerManager[] handlers)
          Creates an instance.
 String getClassName()
          Gets the factory class name.
 org.apache.felix.ipojo.metadata.Element getDescription()
           
 String getFactoryName()
          Computes the factory name.
 List getRequiredHandlerList()
          Computes the required handler list.
 String getVersion()
          Gets the version of the component type.
 void modifiedService(org.osgi.framework.ServiceReference reference, Object service)
           
 void removedFactory(org.apache.felix.ipojo.Factory factory)
           
 void removedService(org.osgi.framework.ServiceReference reference, Object service)
           
 void starting()
          Starting method.
 void stopping()
          Stopping method.
 
Methods inherited from class org.apache.felix.ipojo.IPojoFactory
addFactoryStateListener, checkAcceptability, computeDescription, computeFactoryState, createComponentInstance, createComponentInstance, deleted, dispose, disposed, getBundleContext, getComponentDescription, getComponentMetadata, getComponentTypeDescription, getHandler, getInstanceByName, getIPOJOBundleContext, getLogger, getMissingHandlers, getName, getRequiredHandlers, getState, isAcceptable, match, reconfigure, removeFactoryStateListener, restart, start, stop, updated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandFactory

public CommandFactory(org.osgi.framework.BundleContext context,
                      org.apache.felix.ipojo.metadata.Element metadata)
               throws org.apache.felix.ipojo.ConfigurationException
Creates an iPOJO Factory. At the end of this method, the required set of handler is computed. But the result is computed by a sub-class.

Parameters:
context - the bundle context of the bundle containing the factory.
metadata - the description of the component type.
Throws:
org.apache.felix.ipojo.ConfigurationException - if the element describing the factory is malformed.
Method Detail

getFactoryName

public String getFactoryName()
Computes the factory name. Each sub-type must override this method.

Specified by:
getFactoryName in class org.apache.felix.ipojo.IPojoFactory
Returns:
the factory name.

getDescription

public org.apache.felix.ipojo.metadata.Element getDescription()
Specified by:
getDescription in interface org.apache.felix.ipojo.Factory
Overrides:
getDescription in class org.apache.felix.ipojo.IPojoFactory

getRequiredHandlerList

public List getRequiredHandlerList()
Computes the required handler list. Each sub-type must override this method.

Specified by:
getRequiredHandlerList in class org.apache.felix.ipojo.IPojoFactory
Returns:
the required handler list

createInstance

public org.apache.felix.ipojo.ComponentInstance createInstance(Dictionary config,
                                                               org.apache.felix.ipojo.IPojoContext context,
                                                               org.apache.felix.ipojo.HandlerManager[] handlers)
                                                        throws org.apache.felix.ipojo.ConfigurationException
Creates an instance. This method is called with the monitor lock.

Specified by:
createInstance in class org.apache.felix.ipojo.IPojoFactory
Parameters:
config - the instance configuration
context - the iPOJO context to use
handlers - the handler array to use
Returns:
the new component instance.
Throws:
org.apache.felix.ipojo.ConfigurationException - if the instance creation failed during the configuration process.

getClassName

public String getClassName()
Gets the factory class name.

Specified by:
getClassName in interface org.apache.felix.ipojo.Factory
Specified by:
getClassName in class org.apache.felix.ipojo.IPojoFactory
Returns:
the factory class name.
See Also:
Factory.getClassName()

getVersion

public String getVersion()
Gets the version of the component type.

Specified by:
getVersion in interface org.apache.felix.ipojo.Factory
Returns:
the component type version or null if not specified.

stopping

public void stopping()
Stopping method. This method is call when the factory is stopping. This method is called when holding the lock on the factory.

Specified by:
stopping in class org.apache.felix.ipojo.IPojoFactory

starting

public void starting()
Starting method. This method is called when the factory is starting. This method is called when holding the lock on the factory.

Specified by:
starting in class org.apache.felix.ipojo.IPojoFactory

addingService

public boolean addingService(org.osgi.framework.ServiceReference reference)
Specified by:
addingService in interface org.apache.felix.ipojo.util.TrackerCustomizer

addedService

public void addedService(org.osgi.framework.ServiceReference reference)
Specified by:
addedService in interface org.apache.felix.ipojo.util.TrackerCustomizer

addedFactory

public void addedFactory(org.apache.felix.ipojo.Factory factory)

modifiedService

public void modifiedService(org.osgi.framework.ServiceReference reference,
                            Object service)
Specified by:
modifiedService in interface org.apache.felix.ipojo.util.TrackerCustomizer

removedService

public void removedService(org.osgi.framework.ServiceReference reference,
                           Object service)
Specified by:
removedService in interface org.apache.felix.ipojo.util.TrackerCustomizer

removedFactory

public void removedFactory(org.apache.felix.ipojo.Factory factory)


Copyright © 2013 OW2 Consortium. All Rights Reserved.