org.apache.felix.ipojo.context
Class ServiceReferenceImpl

java.lang.Object
  extended by org.apache.felix.ipojo.context.ServiceReferenceImpl
All Implemented Interfaces:
Comparable, ServiceReference

public class ServiceReferenceImpl
extends Object
implements ServiceReference

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

Author:
Felix Project Team

Constructor Summary
ServiceReferenceImpl(ComponentInstance instance, ServiceRegistrationImpl ref)
          Constructor.
 
Method Summary
 int compareTo(Object reference)
          Service Reference compare method.
 Bundle getBundle()
          Not supported in composite.
 Dictionary getProperties()
           
 Object getProperty(String name)
          Get a property value.
 String[] getPropertyKeys()
          Get the String arrays of service property keys.
 ServiceRegistrationImpl getServiceRegistration()
          Get the service registration for this reference.
 Bundle[] getUsingBundles()
          Unsupported Operation inside composite.
 boolean isAssignableTo(Bundle arg0, 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 Bundle getBundle()
Not supported in composite.

Specified by:
getBundle in interface 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 Object getProperty(String name)
Get a property value.

Specified by:
getProperty in interface 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 String[] getPropertyKeys()
Get the String arrays of service property keys.

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

getProperties

public Dictionary getProperties()

getUsingBundles

public Bundle[] getUsingBundles()
Unsupported Operation inside composite.

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

isAssignableTo

public boolean isAssignableTo(Bundle arg0,
                              String arg1)
Check if the current service reference is assignable to the given bundle.

Specified by:
isAssignableTo in interface 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(Object reference)
Service Reference compare method.

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


Copyright © 2011 Apache Software Foundation. All Rights Reserved.