org.apache.felix.ipojo.handlers.providedservice

## Class ProvidedServiceDescription

- java.lang.Object
- - org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceDescription

    public class ProvidedServiceDescription
    extends java.lang.Object

Provided Service Description.

Author:
  Felix Project Team

### Field Summary

Fields
`static int` `REGISTERED` State : the service is registered.
`static int` `UNREGISTERED` State : the service is unregistered.

### Constructor Summary

Constructors
Constructor and Description
`ProvidedServiceDescription(ProvidedService ps)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addListener(ProvidedServiceListener listener)` Add the given listener to the provided service handler's list of listeners.
`void` `addProperties(java.util.Dictionary props)` Adds and Updates service properties.
`java.lang.String` `getController()` Gets the controller value as a String.
`java.lang.String` `getController(java.lang.String specification)` Gets the controller value as a String.
`java.lang.Class<? extends CreationStrategy>` `getCreationStrategy()`
`int` `getPolicy()`
`java.util.Properties` `getProperties()` Gets the list of properties.
`ProvidedService` `getProvidedService()` Gets the represented provided service.
`java.lang.Object` `getService()` Gets the 'main' service object.
`org.osgi.framework.ServiceReference` `getServiceReference()` Gets the service reference.
`java.lang.Object[]` `getServices()`
`java.lang.String[]` `getServiceSpecifications()` Gets the list of provided service specifications.
`int` `getState()` Gets provided service state.
`void` `removeListener(ProvidedServiceListener listener)` Remove the given listener from the provided service handler's list of listeners.
`void` `removeProperties(java.util.Dictionary props)` Removes service 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(ProvidedService ps)

Constructor.

Parameters:
  `ps` - the described provided service.

### Method Detail

#### getProvidedService

    public ProvidedService getProvidedService()

Gets the represented provided service.

Returns:
  the provided service

#### getServiceSpecifications

    public java.lang.String[] getServiceSpecifications()

Gets the list of provided service specifications.

Returns:
  the provided contract name.

#### getProperties

    public java.util.Properties getProperties()

Gets the list of properties. A copy of the actual property set is returned.

Returns:
  the properties.

#### addProperties

    public void addProperties(java.util.Dictionary props)

Adds and Updates service properties. Existing properties are updated. New ones are added.

Parameters:
  `props` - the new properties

#### removeProperties

    public void removeProperties(java.util.Dictionary props)

Removes service properties.

Parameters:
  `props` - the properties to remove

#### getState

    public int getState()

Gets provided service state.

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

#### getController

    public java.lang.String getController()

Gets the controller value as a String.

Returns:
  the value

#### getController

    public java.lang.String getController(java.lang.String specification)

Gets the controller value as a String.

Parameters:
  `specification` -
Returns:
  the value

#### getServiceReference

    public org.osgi.framework.ServiceReference getServiceReference()

Gets the service reference.

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

#### getService

    public java.lang.Object getService()

Gets the 'main' service object.

Returns:
  the 'main' service object or `null` if no service object are created.

#### getServices

    public java.lang.Object[] getServices()

#### getPolicy

    public int getPolicy()

#### getCreationStrategy

    public java.lang.Class<? extends CreationStrategy> getCreationStrategy()

#### addListener

    public void addListener(ProvidedServiceListener listener)

Add the given listener to the provided service handler's list of listeners.

Parameters:
  `listener` - the `ProvidedServiceListener` object to be added
Throws:
  `java.lang.NullPointerException` - if `listener` is `null`

#### removeListener

    public void removeListener(ProvidedServiceListener listener)

Remove the given listener from the provided service handler's list of listeners.

Parameters:
  `listener` - the `ProvidedServiceListener` object to be removed
Throws:
  `java.lang.NullPointerException` - if `listener` is `null`
  `java.util.NoSuchElementException` - if `listener` wasn't present the in provided service handler's list of listeners