org.apache.avalon.meta.info
Class ServiceDescriptor

java.lang.Object
  extended byorg.apache.avalon.meta.info.Descriptor
      extended byorg.apache.avalon.meta.info.ServiceDescriptor
All Implemented Interfaces:
Serializable

public class ServiceDescriptor
extends Descriptor

This descriptor defines the type of service offerend or required by a component. The type corresponds to the class name of the class/interface implemented by component. Associated with each classname is a version object so that different versions of same interface can be represented.

Also associated with each service is a set of arbitrary attributes that can be used to store extra information about service. See InfoDescriptor for example of how to declare the container specific attributes.

Possible uses for the attributes are to declare a service as "stateless", "pass-by-value", "remotable" or even to attach attributes such as security or transaction constraints. These attributes are container specific and should not be relied upon to work in all containers.

Version:
$Revision: 1.4 $ $Date: 2003/07/12 13:34:27 $
Author:
Avalon Development Team
See Also:
Serialized Form

Constructor Summary
ServiceDescriptor(ReferenceDescriptor designator)
          Construct a service descriptor for specified ReferenceDescriptor
ServiceDescriptor(ReferenceDescriptor designator, Properties attributes)
          Construct a service with specified name, version and attributes.
ServiceDescriptor(ServiceDescriptor descriptor)
          Construct a service descriptor.
 
Method Summary
 boolean equals(Object other)
          Test is the supplied object is equal to this object.
 ReferenceDescriptor getReference()
          Retrieve the reference that service descriptor refers to.
 int hashCode()
          Return the cashcode for this instance.
 
Methods inherited from class org.apache.avalon.meta.info.Descriptor
getAttribute, getAttribute, getAttributeNames, getProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceDescriptor

public ServiceDescriptor(ServiceDescriptor descriptor)
                  throws NullPointerException
Construct a service descriptor.

Parameters:
descriptor - the service descriptor
Throws:
NullPointerException - if the descriptor argument is null

ServiceDescriptor

public ServiceDescriptor(ReferenceDescriptor designator)
                  throws NullPointerException
Construct a service descriptor for specified ReferenceDescriptor

Parameters:
designator - the service reference
Throws:
NullPointerException - if the designator argument is null

ServiceDescriptor

public ServiceDescriptor(ReferenceDescriptor designator,
                         Properties attributes)
                  throws NullPointerException
Construct a service with specified name, version and attributes.

Parameters:
designator - the ReferenceDescriptor
attributes - the attributes of service
Throws:
NullPointerException - if the designator argument is null
Method Detail

getReference

public ReferenceDescriptor getReference()
Retrieve the reference that service descriptor refers to.

Returns:
the reference that service descriptor refers to.

hashCode

public int hashCode()
Return the cashcode for this instance.

Overrides:
hashCode in class Descriptor
Returns:
the instance hashcode

equals

public boolean equals(Object other)
Test is the supplied object is equal to this object.

Overrides:
equals in class Descriptor
Parameters:
other - the object to compare this object with
Returns:
true if the object are equivalent


Copyright © Apache Software Foundation. All Rights Reserved.