org.apache.felix.ipojo.context

## Class ServiceReferenceImpl

- java.lang.Object
- - org.apache.felix.ipojo.context.ServiceReferenceImpl

All Implemented Interfaces:
  java.lang.Comparable, org.osgi.framework.ServiceReference

    public class ServiceReferenceImpl
    extends java.lang.Object
    implements org.osgi.framework.ServiceReference

Internal service reference implementation. This class is used for in the composition.

Author:
  Felix Project Team

### Constructor Summary

Constructors
Constructor and Description
`ServiceReferenceImpl(ComponentInstance instance, ServiceRegistrationImpl ref)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compareTo(java.lang.Object reference)` Service Reference compare method.
`org.osgi.framework.Bundle` `getBundle()` Not supported in composite.
`java.util.Dictionary` `getProperties()`
`java.lang.Object` `getProperty(java.lang.String name)` Get a property value.
`java.lang.String[]` `getPropertyKeys()` Get the String arrays of service property keys.
`ServiceRegistrationImpl` `getServiceRegistration()` Get the service registration for this reference.
`org.osgi.framework.Bundle[]` `getUsingBundles()` Unsupported Operation inside composite.
`boolean` `isAssignableTo(org.osgi.framework.Bundle arg0, java.lang.String arg1)` Check if the current service reference is assignable to the given bundle.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ServiceReferenceImpl

    public ServiceReferenceImpl(ComponentInstance instance,
                                ServiceRegistrationImpl ref)

Constructor.

Parameters:
  `instance` - : component instance publishing the service.
  `ref` - : registration attached to this service reference.

### Method Detail

#### getBundle

    public org.osgi.framework.Bundle getBundle()

Not supported in composite.

Specified by:
  `getBundle` in interface `org.osgi.framework.ServiceReference`
Returns:
  null
See Also:
  `ServiceReference.getBundle()`

#### getServiceRegistration

    public ServiceRegistrationImpl getServiceRegistration()

Get the service registration for this reference.

Returns:
  the service registration for this service reference.

#### getProperty

    public java.lang.Object getProperty(java.lang.String name)

Get a property value.

Specified by:
  `getProperty` in interface `org.osgi.framework.ServiceReference`
Parameters:
  `name` - : the key of the required property.
Returns:
  the property value or null if no property for the given key.
See Also:
  `ServiceReference.getProperty(java.lang.String)`

#### getPropertyKeys

    public java.lang.String[] getPropertyKeys()

Get the String arrays of service property keys.

Specified by:
  `getPropertyKeys` in interface `org.osgi.framework.ServiceReference`
Returns:
  : the list of property keys.
See Also:
  `ServiceReference.getPropertyKeys()`

#### getProperties

    public java.util.Dictionary getProperties()

#### getUsingBundles

    public org.osgi.framework.Bundle[] getUsingBundles()

Unsupported Operation inside composite.

Specified by:
  `getUsingBundles` in interface `org.osgi.framework.ServiceReference`
Returns:
  bundles using this reference.
See Also:
  `ServiceReference.getUsingBundles()`

#### isAssignableTo

    public boolean isAssignableTo(org.osgi.framework.Bundle arg0,
                                  java.lang.String arg1)

Check if the current service reference is assignable to the given bundle.

Specified by:
  `isAssignableTo` in interface `org.osgi.framework.ServiceReference`
Parameters:
  `arg0` - : the bundle to check
  `arg1` - : the class name to check.
Returns:
  true in the case of composite
See Also:
  `ServiceReference.isAssignableTo(org.osgi.framework.Bundle, java.lang.String)`

#### compareTo

    public int compareTo(java.lang.Object reference)

Service Reference compare method.

Specified by:
  `compareTo` in interface `java.lang.Comparable`
Specified by:
  `compareTo` in interface `org.osgi.framework.ServiceReference`
Parameters:
  `reference` - the service reference
Returns:
  this methods is not yet supported, and throws an `UnsupportedOperationException`.
See Also:
  `ServiceReference.compareTo(java.lang.Object)`