org.apache.aries.blueprint.reflect
Class ServiceReferenceMetadataImpl

java.lang.Object
  extended by org.apache.aries.blueprint.reflect.ComponentMetadataImpl
      extended by org.apache.aries.blueprint.reflect.ServiceReferenceMetadataImpl
All Implemented Interfaces:
ExtendedServiceReferenceMetadata, MutableComponentMetadata, MutableServiceReferenceMetadata, ComponentMetadata, Metadata, NonNullMetadata, ServiceReferenceMetadata
Direct Known Subclasses:
ReferenceListMetadataImpl, ReferenceMetadataImpl

public abstract class ServiceReferenceMetadataImpl
extends ComponentMetadataImpl
implements MutableServiceReferenceMetadata

Implementation of ServiceReferenceMetadata

Version:
$Rev: 950985 $, $Date: 2010-06-03 14:19:22 +0100 (Thu, 03 Jun 2010) $

Field Summary
protected  int availability
           
protected  java.lang.String componentName
           
protected  java.lang.String filter
           
protected  java.lang.String interfaceName
           
protected  int proxyMethod
           
protected  java.util.Collection<ReferenceListener> referenceListeners
           
protected  java.lang.Class runtimeInterface
           
 
Fields inherited from class org.apache.aries.blueprint.reflect.ComponentMetadataImpl
activation, dependsOn, id
 
Fields inherited from interface org.apache.aries.blueprint.ExtendedServiceReferenceMetadata
PROXY_METHOD_CLASSES, PROXY_METHOD_DEFAULT
 
Fields inherited from interface org.osgi.service.blueprint.reflect.ServiceReferenceMetadata
AVAILABILITY_MANDATORY, AVAILABILITY_OPTIONAL
 
Fields inherited from interface org.osgi.service.blueprint.reflect.ComponentMetadata
ACTIVATION_EAGER, ACTIVATION_LAZY
 
Constructor Summary
ServiceReferenceMetadataImpl()
           
ServiceReferenceMetadataImpl(ServiceReferenceMetadata source)
           
 
Method Summary
 void addServiceListener(ReferenceListener bindingListenerMetadata)
           
 ReferenceListener addServiceListener(Target listenerComponent, java.lang.String bindMethodName, java.lang.String unbindMethodName)
           
 int getAvailability()
          Return whether or not a matching service is required at all times.
 java.lang.String getComponentName()
          Return the value of the component-name attribute of the service reference.
 java.lang.String getFilter()
          Return the filter expression that a matching service must match.
 java.lang.String getInterface()
          Return the name of the interface type that a matching service must support.
 int getProxyMethod()
           
 java.util.Collection<ReferenceListener> getReferenceListeners()
          Return the reference listeners to receive bind and unbind events.
 java.lang.Class getRuntimeInterface()
           
 void removeReferenceListener(ReferenceListener listener)
           
 void setAvailability(int availability)
           
 void setComponentName(java.lang.String componentName)
           
 void setFilter(java.lang.String filter)
           
 void setInterface(java.lang.String interfaceName)
           
 void setProxyMethod(int proxyMethod)
           
 void setReferenceListeners(java.util.Collection<ReferenceListener> listeners)
           
 void setRuntimeInterface(java.lang.Class runtimeInterface)
           
 
Methods inherited from class org.apache.aries.blueprint.reflect.ComponentMetadataImpl
addDependsOn, getActivation, getDependsOn, getId, removeDependsOn, setActivation, setDependsOn, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.osgi.service.blueprint.reflect.ComponentMetadata
getActivation, getDependsOn, getId
 
Methods inherited from interface org.apache.aries.blueprint.mutable.MutableComponentMetadata
addDependsOn, removeDependsOn, setActivation, setDependsOn, setId
 

Field Detail

availability

protected int availability

interfaceName

protected java.lang.String interfaceName

componentName

protected java.lang.String componentName

filter

protected java.lang.String filter

referenceListeners

protected java.util.Collection<ReferenceListener> referenceListeners

proxyMethod

protected int proxyMethod

runtimeInterface

protected java.lang.Class runtimeInterface
Constructor Detail

ServiceReferenceMetadataImpl

public ServiceReferenceMetadataImpl()

ServiceReferenceMetadataImpl

public ServiceReferenceMetadataImpl(ServiceReferenceMetadata source)
Method Detail

getAvailability

public int getAvailability()
Description copied from interface: ServiceReferenceMetadata
Return whether or not a matching service is required at all times. This is specified in the availability attribute of the service reference.

Specified by:
getAvailability in interface ServiceReferenceMetadata
Returns:
Whether or not a matching service is required at all times.
See Also:
ServiceReferenceMetadata.AVAILABILITY_MANDATORY, ServiceReferenceMetadata.AVAILABILITY_OPTIONAL

setAvailability

public void setAvailability(int availability)
Specified by:
setAvailability in interface MutableServiceReferenceMetadata

getInterface

public java.lang.String getInterface()
Description copied from interface: ServiceReferenceMetadata
Return the name of the interface type that a matching service must support. This is specified in the interface attribute of the service reference.

Specified by:
getInterface in interface ServiceReferenceMetadata
Returns:
The name of the interface type that a matching service must support or null when no interface name is specified.

setInterface

public void setInterface(java.lang.String interfaceName)
Specified by:
setInterface in interface MutableServiceReferenceMetadata

getComponentName

public java.lang.String getComponentName()
Description copied from interface: ServiceReferenceMetadata
Return the value of the component-name attribute of the service reference. This specifies the id of a component that is registered in the service registry. This will create an automatic filter, appended with the filter if set, to select this component based on its automatic id attribute.

Specified by:
getComponentName in interface ServiceReferenceMetadata
Returns:
The value of the component-name attribute of the service reference or null if the attribute is not specified.

setComponentName

public void setComponentName(java.lang.String componentName)
Specified by:
setComponentName in interface MutableServiceReferenceMetadata

getFilter

public java.lang.String getFilter()
Description copied from interface: ServiceReferenceMetadata
Return the filter expression that a matching service must match. This is specified by the filter attribute of the service reference.

Specified by:
getFilter in interface ServiceReferenceMetadata
Returns:
The filter expression that a matching service must match or null if a filter is not specified.

setFilter

public void setFilter(java.lang.String filter)
Specified by:
setFilter in interface MutableServiceReferenceMetadata

getReferenceListeners

public java.util.Collection<ReferenceListener> getReferenceListeners()
Description copied from interface: ServiceReferenceMetadata
Return the reference listeners to receive bind and unbind events. This is specified by the reference-listener elements of the service reference.

Specified by:
getReferenceListeners in interface ServiceReferenceMetadata
Returns:
An immutable Collection of ReferenceListener objects to receive bind and unbind events. The Collection is empty if no reference listeners are specified for the service reference.

setReferenceListeners

public void setReferenceListeners(java.util.Collection<ReferenceListener> listeners)

addServiceListener

public void addServiceListener(ReferenceListener bindingListenerMetadata)
Specified by:
addServiceListener in interface MutableServiceReferenceMetadata

addServiceListener

public ReferenceListener addServiceListener(Target listenerComponent,
                                            java.lang.String bindMethodName,
                                            java.lang.String unbindMethodName)
Specified by:
addServiceListener in interface MutableServiceReferenceMetadata

removeReferenceListener

public void removeReferenceListener(ReferenceListener listener)
Specified by:
removeReferenceListener in interface MutableServiceReferenceMetadata

getProxyMethod

public int getProxyMethod()
Specified by:
getProxyMethod in interface ExtendedServiceReferenceMetadata

setProxyMethod

public void setProxyMethod(int proxyMethod)
Specified by:
setProxyMethod in interface MutableServiceReferenceMetadata

getRuntimeInterface

public java.lang.Class getRuntimeInterface()
Specified by:
getRuntimeInterface in interface ExtendedServiceReferenceMetadata

setRuntimeInterface

public void setRuntimeInterface(java.lang.Class runtimeInterface)
Specified by:
setRuntimeInterface in interface MutableServiceReferenceMetadata


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.