org.apache.felix.ipojo.api
Class Dependency

java.lang.Object
  extended by org.apache.felix.ipojo.api.Dependency
All Implemented Interfaces:
HandlerConfiguration

public class Dependency
extends Object
implements HandlerConfiguration

Allows configuring a service dependencies.

Author:
Felix Project Team

Field Summary
static int DYNAMIC
          The dynamic binding policy.
static int DYNAMIC_PRIORITY
          The dynamic-priority binding policy.
static int STATIC
          The static binding policy.
 
Constructor Summary
Dependency()
           
 
Method Summary
 DependencyDescription getDependencyDescription(ComponentInstance instance)
          Gets the dependency description object attached to this dependency.
 Element getElement()
          Gets the dependency metadata.
 Dependency setAggregate(boolean agg)
          Sets the dependency cardinality.
 Dependency setBindingPolicy(int policy)
          Sets the dependency binding policy.
 Dependency setBindMethod(String bind)
          Sets the dependency bind method.
 Dependency setComparator(String cmp)
          Sets the dependency comparator.
 Dependency setDefaultImplementation(String di)
          Sets the dependency default-implementation.
 Dependency setField(String field)
          Sets the field attached to the dependency.
 Dependency setFilter(String filter)
          Sets the dependency filter.
 Dependency setFrom(String from)
          Sets the dependency 'from' attribute.
 Dependency setId(String id)
          Sets the dependency id.
 Dependency setModifiedMethod(String modified)
          Sets the dependency modified method.
 Dependency setNullable(boolean nullable)
          Sets if the dependency supports nullable objects.
 Dependency setOptional(boolean opt)
          Sets the dependency optionality.
 Dependency setProxy(boolean proxy)
          Sets if the dependency injects proxies.
 Dependency setSpecification(String spec)
          Sets the required service specification.
 Dependency setUnbindMethod(String unbind)
          Sets the dependency unbind method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DYNAMIC

public static final int DYNAMIC
The dynamic binding policy.

See Also:
Constant Field Values

STATIC

public static final int STATIC
The static binding policy.

See Also:
Constant Field Values

DYNAMIC_PRIORITY

public static final int DYNAMIC_PRIORITY
The dynamic-priority binding policy.

See Also:
Constant Field Values
Constructor Detail

Dependency

public Dependency()
Method Detail

getElement

public Element getElement()
Gets the dependency metadata.

Specified by:
getElement in interface HandlerConfiguration
Returns:
the 'requires' element describing the current dependency.

setSpecification

public Dependency setSpecification(String spec)
Sets the required service specification.

Parameters:
spec - the specification
Returns:
the current dependency object.

setFilter

public Dependency setFilter(String filter)
Sets the dependency filter.

Parameters:
filter - the LDAP filter
Returns:
the current dependency object

setField

public Dependency setField(String field)
Sets the field attached to the dependency.

Parameters:
field - the implementation class field name.
Returns:
the current dependency object

setOptional

public Dependency setOptional(boolean opt)
Sets the dependency optionality.

Parameters:
opt - true to set the dependency to optional.
Returns:
the current dependency object.

setAggregate

public Dependency setAggregate(boolean agg)
Sets the dependency cardinality.

Parameters:
agg - true to set the dependency to aggregate.
Returns:
the current dependency object.

setNullable

public Dependency setNullable(boolean nullable)
Sets if the dependency supports nullable objects.

Parameters:
nullable - false if the dependency does not support the nullable object injection
Returns:
the current dependency object.

setProxy

public Dependency setProxy(boolean proxy)
Sets if the dependency injects proxies.

Parameters:
proxy - false if the dependency does not inject proxies but uses direct references.
Returns:
the current dependency object.

setBindMethod

public Dependency setBindMethod(String bind)
Sets the dependency bind method.

Parameters:
bind - the bind method name
Returns:
the current dependency object.

setUnbindMethod

public Dependency setUnbindMethod(String unbind)
Sets the dependency unbind method.

Parameters:
unbind - the unbind method
Returns:
the current dependency object.

setModifiedMethod

public Dependency setModifiedMethod(String modified)
Sets the dependency modified method.

Parameters:
modified - the modified method
Returns:
the current dependency object.

setBindingPolicy

public Dependency setBindingPolicy(int policy)
Sets the dependency binding policy.

Parameters:
policy - the binding policy
Returns:
the current dependency object

setComparator

public Dependency setComparator(String cmp)
Sets the dependency comparator.

Parameters:
cmp - the comparator class name
Returns:
the current dependency object

setDefaultImplementation

public Dependency setDefaultImplementation(String di)
Sets the dependency default-implementation.

Parameters:
di - the default-implementation class name
Returns:
the current dependency object

setFrom

public Dependency setFrom(String from)
Sets the dependency 'from' attribute.

Parameters:
from - the name of the service provider.
Returns:
the current dependency object

setId

public Dependency setId(String id)
Sets the dependency id.

Parameters:
id - the dependency id.
Returns:
the current dependency object.

getDependencyDescription

public DependencyDescription getDependencyDescription(ComponentInstance instance)
Gets the dependency description object attached to this dependency.

Parameters:
instance - the instance on which searching the dependency
Returns:
the dependency description attached to this dependency or null if the dependency cannot be found.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.