org.apache.aries.blueprint.reflect
Class ServiceMetadataImpl

java.lang.Object
  extended by org.apache.aries.blueprint.reflect.ComponentMetadataImpl
      extended by org.apache.aries.blueprint.reflect.ServiceMetadataImpl
All Implemented Interfaces:
MutableComponentMetadata, MutableServiceMetadata, ComponentMetadata, Metadata, NonNullMetadata, ServiceMetadata

public class ServiceMetadataImpl
extends ComponentMetadataImpl
implements MutableServiceMetadata

Implementation of ServiceMetadata

Version:
$Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $

Field Summary
 
Fields inherited from class org.apache.aries.blueprint.reflect.ComponentMetadataImpl
activation, dependsOn, id
 
Fields inherited from interface org.osgi.service.blueprint.reflect.ServiceMetadata
AUTO_EXPORT_ALL_CLASSES, AUTO_EXPORT_CLASS_HIERARCHY, AUTO_EXPORT_DISABLED, AUTO_EXPORT_INTERFACES
 
Fields inherited from interface org.osgi.service.blueprint.reflect.ComponentMetadata
ACTIVATION_EAGER, ACTIVATION_LAZY
 
Constructor Summary
ServiceMetadataImpl()
           
ServiceMetadataImpl(ServiceMetadata source)
           
 
Method Summary
 void addInterface(java.lang.String interfaceName)
           
 void addRegistrationListener(RegistrationListener registrationListenerMetadata)
           
 RegistrationListener addRegistrationListener(Target listenerComponent, java.lang.String registrationMethodName, java.lang.String unregistrationMethodName)
           
 void addServiceProperty(MapEntry serviceProperty)
           
 MapEntry addServiceProperty(NonNullMetadata key, Metadata value)
           
 int getAutoExport()
          Return the auto-export mode for the service.
 java.util.List<java.lang.String> getInterfaces()
          Return the type names of the interfaces that the service should be advertised as supporting.
 int getRanking()
          Return the ranking value to use when advertising the service.
 java.util.Collection<RegistrationListener> getRegistrationListeners()
          Return the registration listeners to be notified when the service is registered and unregistered with the framework.
 Target getServiceComponent()
          Return the Metadata for the component to be exported as a service.
 java.util.List<MapEntry> getServiceProperties()
          Return the user declared properties to be advertised with the service.
 void removeInterface(java.lang.String interfaceName)
           
 void removeRegistrationListener(RegistrationListener listener)
           
 void removeServiceProperty(MapEntry serviceProperty)
           
 void setAutoExport(int autoExport)
           
 void setInterfaceNames(java.util.List<java.lang.String> interfaceNames)
           
 void setRanking(int ranking)
           
 void setRegistrationListeners(java.util.Collection<RegistrationListener> registrationListeners)
           
 void setServiceComponent(Target exportedComponent)
           
 void setServiceProperties(java.util.List<MapEntry> serviceProperties)
           
 java.lang.String toString()
           
 
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, wait, wait, wait
 
Methods inherited from interface org.apache.aries.blueprint.mutable.MutableComponentMetadata
addDependsOn, removeDependsOn, setActivation, setDependsOn, setId
 
Methods inherited from interface org.osgi.service.blueprint.reflect.ComponentMetadata
getActivation, getDependsOn, getId
 

Constructor Detail

ServiceMetadataImpl

public ServiceMetadataImpl()

ServiceMetadataImpl

public ServiceMetadataImpl(ServiceMetadata source)
Method Detail

getServiceComponent

public Target getServiceComponent()
Description copied from interface: ServiceMetadata
Return the Metadata for the component to be exported as a service. This is specified inline or via the ref attribute of the service.

Specified by:
getServiceComponent in interface ServiceMetadata
Returns:
The Metadata for the component to be exported as a service.

setServiceComponent

public void setServiceComponent(Target exportedComponent)
Specified by:
setServiceComponent in interface MutableServiceMetadata

getInterfaces

public java.util.List<java.lang.String> getInterfaces()
Description copied from interface: ServiceMetadata
Return the type names of the interfaces that the service should be advertised as supporting. This is specified in the interface attribute or child interfaces element of the service.

Specified by:
getInterfaces in interface ServiceMetadata
Returns:
An immutable List of String for the type names of the interfaces that the service should be advertised as supporting. The List is empty if using auto-export or no interface names are specified for the service.

setInterfaceNames

public void setInterfaceNames(java.util.List<java.lang.String> interfaceNames)

addInterface

public void addInterface(java.lang.String interfaceName)
Specified by:
addInterface in interface MutableServiceMetadata

removeInterface

public void removeInterface(java.lang.String interfaceName)
Specified by:
removeInterface in interface MutableServiceMetadata

getAutoExport

public int getAutoExport()
Description copied from interface: ServiceMetadata
Return the auto-export mode for the service. This is specified by the auto-export attribute of the service.

Specified by:
getAutoExport in interface ServiceMetadata
Returns:
The auto-export mode for the service.
See Also:
ServiceMetadata.AUTO_EXPORT_DISABLED, ServiceMetadata.AUTO_EXPORT_INTERFACES, ServiceMetadata.AUTO_EXPORT_CLASS_HIERARCHY, ServiceMetadata.AUTO_EXPORT_ALL_CLASSES

setAutoExport

public void setAutoExport(int autoExport)
Specified by:
setAutoExport in interface MutableServiceMetadata

getServiceProperties

public java.util.List<MapEntry> getServiceProperties()
Description copied from interface: ServiceMetadata
Return the user declared properties to be advertised with the service. This is specified by the service-properties element of the service.

Specified by:
getServiceProperties in interface ServiceMetadata
Returns:
An immutable List of MapEntry objects for the user declared properties to be advertised with the service. The List is empty if no service properties are specified for the service.

setServiceProperties

public void setServiceProperties(java.util.List<MapEntry> serviceProperties)

addServiceProperty

public void addServiceProperty(MapEntry serviceProperty)
Specified by:
addServiceProperty in interface MutableServiceMetadata

addServiceProperty

public MapEntry addServiceProperty(NonNullMetadata key,
                                   Metadata value)
Specified by:
addServiceProperty in interface MutableServiceMetadata

removeServiceProperty

public void removeServiceProperty(MapEntry serviceProperty)
Specified by:
removeServiceProperty in interface MutableServiceMetadata

getRanking

public int getRanking()
Description copied from interface: ServiceMetadata
Return the ranking value to use when advertising the service. If the ranking value is zero, the service must be registered without a service.ranking service property. This is specified by the ranking attribute of the service.

Specified by:
getRanking in interface ServiceMetadata
Returns:
The ranking value to use when advertising the service.

setRanking

public void setRanking(int ranking)
Specified by:
setRanking in interface MutableServiceMetadata

getRegistrationListeners

public java.util.Collection<RegistrationListener> getRegistrationListeners()
Description copied from interface: ServiceMetadata
Return the registration listeners to be notified when the service is registered and unregistered with the framework. This is specified by the registration-listener elements of the service.

Specified by:
getRegistrationListeners in interface ServiceMetadata
Returns:
An immutable Collection of RegistrationListener objects to be notified when the service is registered and unregistered with the framework. The Collection is empty if no registration listeners are specified for the service.

setRegistrationListeners

public void setRegistrationListeners(java.util.Collection<RegistrationListener> registrationListeners)

addRegistrationListener

public void addRegistrationListener(RegistrationListener registrationListenerMetadata)
Specified by:
addRegistrationListener in interface MutableServiceMetadata

addRegistrationListener

public RegistrationListener addRegistrationListener(Target listenerComponent,
                                                    java.lang.String registrationMethodName,
                                                    java.lang.String unregistrationMethodName)
Specified by:
addRegistrationListener in interface MutableServiceMetadata

removeRegistrationListener

public void removeRegistrationListener(RegistrationListener listener)
Specified by:
removeRegistrationListener in interface MutableServiceMetadata

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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