org.robokind.api.common.osgi.lifecycle
Class DependencyDescriptor

java.lang.Object
  extended by org.robokind.api.common.osgi.lifecycle.DependencyDescriptor

public class DependencyDescriptor
extends Object

Describes a service dependency of a ServiceLifecycleProvider. Used to match find and track the appropriate services needed by a lifecycle provider.

Author:
Matthew Stevenson

Constructor Summary
DependencyDescriptor(String dependencyId, Class clazz, String filter)
          Create a new DependencyDescriptor with the given values.
 
Method Summary
static DependencyDescriptor buildForServiceId(String localId, Class clazz, String idPropertyName, String serviceId, String filter)
          Builds a descriptor for a service with a given id.
 String getDependencyId()
          Returns the local id String used within a ServiceLifecycleProvider.
 Class getServiceClass()
          Returns the Class of dependency.
 String getServiceFilter()
          Returns an OSGi filter string for the dependency, null if it is not set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyDescriptor

public DependencyDescriptor(String dependencyId,
                            Class clazz,
                            String filter)
Create a new DependencyDescriptor with the given values.

Parameters:
dependencyId - local id used within a ServiceLifecycleProvider
clazz - Class of the dependency
filter - optional OSGi filter string
Method Detail

buildForServiceId

public static DependencyDescriptor buildForServiceId(String localId,
                                                     Class clazz,
                                                     String idPropertyName,
                                                     String serviceId,
                                                     String filter)
Builds a descriptor for a service with a given id. Creates a new DependencyDescriptor with a filter for a given serviceId using the given idPropertyName. Robot.PROP_ID is an example of a property name, and the Robot's id would be the serviceId.

Parameters:
localId - string used to identify this dependency within a ServiceLifecycleProvider
clazz - class of the dependency
idPropertyName - property name for the service's id
serviceId - the service id the dependency must match
filter - optional filter string the dependency must match. This may be left null.
Returns:
new DependencyDescriptor for a service with a given id

getDependencyId

public String getDependencyId()
Returns the local id String used within a ServiceLifecycleProvider.

Returns:
local id String used within a ServiceLifecycleProvider

getServiceClass

public Class getServiceClass()
Returns the Class of dependency.

Returns:
Class of dependency

getServiceFilter

public String getServiceFilter()
Returns an OSGi filter string for the dependency, null if it is not set.

Returns:
OSGi filter string for the dependency, null if it is not set


Copyright © 2011-2012. All Rights Reserved.