org.apache.felix.ipojo.handlers.dependency
Class DependencyHandler

java.lang.Object
  extended by org.apache.felix.ipojo.Handler
      extended by org.apache.felix.ipojo.PrimitiveHandler
          extended by org.apache.felix.ipojo.handlers.dependency.DependencyHandler
All Implemented Interfaces:
FieldInterceptor, MethodInterceptor, DependencyStateListener

public class DependencyHandler
extends PrimitiveHandler
implements DependencyStateListener

The dependency handler manages a list of service dependencies.

Author:
Felix Project Team

Field Summary
protected static int LIST
          Dependency Field Type : List.
protected static int SET
          Dependency Field Type : Set.
protected static int VECTOR
          Dependency field type : Vector The dependency will be injected as a vector.
 
Fields inherited from class org.apache.felix.ipojo.PrimitiveHandler
HANDLER_TYPE
 
Fields inherited from class org.apache.felix.ipojo.Handler
HANDLER_LEVEL_PROPERTY, HANDLER_NAME_PROPERTY, HANDLER_NAMESPACE_PROPERTY, HANDLER_TYPE_PROPERTY, m_instance, m_isValid
 
Constructor Summary
DependencyHandler()
           
 
Method Summary
protected  void checkContext()
          Check the validity of the dependencies.
 void configure(Element componentMetadata, Dictionary configuration)
          Configure the handler.
 Dependency[] getDependencies()
          Get the list of managed dependency.
 HandlerDescription getDescription()
          Get the dependency handler description.
 void invalidate(DependencyModel dep)
          Invalidate method.
 void onCreation(Object instance)
          Handler createInstance method.
 void start()
          Handler start method.
 void stop()
          Handler stop method.
 void validate(DependencyModel dep)
          Validate method.
 
Methods inherited from class org.apache.felix.ipojo.PrimitiveHandler
attach, getFactory, getHandler, getInstanceManager, getLogger, getPojoMetadata, onEntry, onError, onExit, onFinally, onGet, onSet, setFactory
 
Methods inherited from class org.apache.felix.ipojo.Handler
debug, error, error, getHandlerManager, getValidity, info, initializeComponentFactory, isValid, reconfigure, setValidity, stateChanged, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VECTOR

protected static final int VECTOR
Dependency field type : Vector The dependency will be injected as a vector.

See Also:
Constant Field Values

LIST

protected static final int LIST
Dependency Field Type : List. The dependency will be injected as a list.

See Also:
Constant Field Values

SET

protected static final int SET
Dependency Field Type : Set. The dependency will be injected as a set.

See Also:
Constant Field Values
Constructor Detail

DependencyHandler

public DependencyHandler()
Method Detail

getDependencies

public Dependency[] getDependencies()
Get the list of managed dependency.

Returns:
the dependency list

validate

public void validate(DependencyModel dep)
Validate method. This method is invoked by an AbstractServiceDependency when this dependency becomes RESOLVED.

Specified by:
validate in interface DependencyStateListener
Parameters:
dep - : the dependency becoming RESOLVED.
See Also:
DependencyStateListener.validate(org.apache.felix.ipojo.util.DependencyModel)

invalidate

public void invalidate(DependencyModel dep)
Invalidate method. This method is invoked by an AbstractServiceDependency when this dependency becomes UNRESOLVED or BROKEN.

Specified by:
invalidate in interface DependencyStateListener
Parameters:
dep - : the dependency becoming UNRESOLVED or BROKEN.
See Also:
DependencyStateListener.invalidate(org.apache.felix.ipojo.util.DependencyModel)

checkContext

protected void checkContext()
Check the validity of the dependencies.


configure

public void configure(Element componentMetadata,
                      Dictionary configuration)
               throws ConfigurationException
Configure the handler.

Specified by:
configure in class Handler
Parameters:
componentMetadata - : the component type metadata
configuration - : the instance configuration
Throws:
ConfigurationException - : one dependency metadata is not correct.
See Also:
org.apache.felix.ipojo.Handler#configure(org.apache.felix.ipojo.InstanceManager, org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)

start

public void start()
Handler start method.

Specified by:
start in class Handler
See Also:
Handler.start()

stop

public void stop()
Handler stop method.

Specified by:
stop in class Handler
See Also:
Handler.stop()

onCreation

public void onCreation(Object instance)
Handler createInstance method. This method is override to allow delayed callback invocation.

Overrides:
onCreation in class PrimitiveHandler
Parameters:
instance - : the created object
See Also:
org.apache.felix.ipojo.Handler#onCreation(java.lang.Object)

getDescription

public HandlerDescription getDescription()
Get the dependency handler description.

Overrides:
getDescription in class Handler
Returns:
the dependency handler description.
See Also:
Handler.getDescription()


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.