org.apache.felix.ipojo.handlers.providedservice
Class ProvidedServiceDescription

java.lang.Object
  extended by org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceDescription

public class ProvidedServiceDescription
extends java.lang.Object

Provided Service Description.

Author:
Felix Project Team

Field Summary
static int REGISTERED
          State : the service is registered.
static int UNREGISTERED
          State : the service is unregistered.
 
Constructor Summary
ProvidedServiceDescription(java.lang.String[] serviceSpecification, int state, org.osgi.framework.ServiceReference ref)
          Constructor.
 
Method Summary
 void addProperty(java.lang.String key, java.lang.String value)
          Add a property to the current provided service description.
 java.util.Properties getProperties()
          Get the list of properties.
 org.osgi.framework.ServiceReference getServiceReference()
          Get the service reference.
 java.lang.String[] getServiceSpecification()
          Get the list of provided service specifications.
 int getState()
          Get provided service state.
 void setProperty(java.util.Properties props)
          Set the set of properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNREGISTERED

public static final int UNREGISTERED
State : the service is unregistered.

See Also:
Constant Field Values

REGISTERED

public static final int REGISTERED
State : the service is registered.

See Also:
Constant Field Values
Constructor Detail

ProvidedServiceDescription

public ProvidedServiceDescription(java.lang.String[] serviceSpecification,
                                  int state,
                                  org.osgi.framework.ServiceReference ref)
Constructor.

Parameters:
serviceSpecification - : the provided contract
state - : state (UNREGITRED | REGISTRED)
ref - : Service Registration (to obtain the reference), or null if state is UNREGISTRED
Method Detail

getServiceSpecification

public java.lang.String[] getServiceSpecification()
Get the list of provided service specifications.

Returns:
the provided contract name.

addProperty

public void addProperty(java.lang.String key,
                        java.lang.String value)
Add a property to the current provided service description.

Parameters:
key - : the key of the property
value - : the value of the property

setProperty

public void setProperty(java.util.Properties props)
Set the set of properties. This function create a clone of the argument.

Parameters:
props - : the properties

getProperties

public java.util.Properties getProperties()
Get the list of properties.

Returns:
the properties.

getState

public int getState()
Get provided service state.

Returns:
the state of the provided service (UNREGISTERED | REGISTRED).

getServiceReference

public org.osgi.framework.ServiceReference getServiceReference()
Get the service reference.

Returns:
the service reference (null if the service is unregistred).