org.apache.felix.ipojo
Class IPojoFactory.RequiredHandler

java.lang.Object
  extended by org.apache.felix.ipojo.IPojoFactory.RequiredHandler
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
IPojoFactory

protected class IPojoFactory.RequiredHandler
extends java.lang.Object
implements java.lang.Comparable

Structure storing required handlers.


Constructor Summary
IPojoFactory.RequiredHandler(java.lang.String name, java.lang.String namespace)
          Constructor.
 
Method Summary
 int compareTo(java.lang.Object object)
          Start level Comparison.
 boolean equals(java.lang.Object object)
          Equals method.
 HandlerFactory getFactory()
          Get the factory object used for this handler.
 java.lang.String getFullName()
          Get the handler full name (namespace:name).
 int getLevel()
           
 java.lang.String getName()
           
 java.lang.String getNamespace()
           
 org.osgi.framework.ServiceReference getReference()
           
 void setReference(org.osgi.framework.ServiceReference ref)
          Set the service reference.
 void unRef()
          Release the reference of the used factory.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPojoFactory.RequiredHandler

public IPojoFactory.RequiredHandler(java.lang.String name,
                                    java.lang.String namespace)
Constructor.

Parameters:
name - : handler name.
namespace - : handler namespace.
Method Detail

equals

public boolean equals(java.lang.Object object)
Equals method. Two handlers are equals if they have same name and namespace or they share the same service reference.

Overrides:
equals in class java.lang.Object
Parameters:
object - : object to compare to the current object.
Returns:
: true if the two compared object are equals
See Also:
Object.equals(java.lang.Object)

getFactory

public HandlerFactory getFactory()
Get the factory object used for this handler. The object is get when used for the first time.

Returns:
the factory object.

getFullName

public java.lang.String getFullName()
Get the handler full name (namespace:name).

Returns:
the handler full name

getName

public java.lang.String getName()

getNamespace

public java.lang.String getNamespace()

getReference

public org.osgi.framework.ServiceReference getReference()

getLevel

public int getLevel()

unRef

public void unRef()
Release the reference of the used factory.


setReference

public void setReference(org.osgi.framework.ServiceReference ref)
Set the service reference. If the new service reference is null, it unget the used factory (if already get).

Parameters:
ref - : new service reference.

compareTo

public int compareTo(java.lang.Object object)
Start level Comparison. This method is used to sort the handler array.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - : object on which compare.
Returns:
-1, 0, +1 according to the comparison of their start level.
See Also:
Comparable.compareTo(java.lang.Object)