org.apache.avalon.meta.info
Class Service

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

public class Service
extends Descriptor

This class contains the meta information about a particular service. It contains a set of attributes qualifying the service;

Version:
$Revision: 1.2 $ $Date: 2004/01/24 23:20:45 $
Author:
Avalon Development Team
See Also:
Serialized Form

Constructor Summary
Service(ReferenceDescriptor reference)
          Creation of a new Service instance using a classname and supplied properties argument.
Service(ReferenceDescriptor reference, EntryDescriptor[] entries)
          Creation of a new Service instance using a classname and supplied properties argument.
Service(ReferenceDescriptor reference, EntryDescriptor[] entries, Properties attributes)
          Creation of a new Service instance using a classname and supplied properties argument.
Service(ReferenceDescriptor reference, Properties attributes)
          Creation of a new Service instance using a classname and supplied properties argument.
 
Method Summary
 boolean equals(Object other)
          Compare this object to the supplied object for equality.
 String getClassname()
          Return the service classname key.
 EntryDescriptor[] getEntries()
          Return the entries declared by the service.
 ReferenceDescriptor getReference()
          Return the service reference.
 Version getVersion()
          Return the service version.
 int hashCode()
          Return the hashcode for this service defintion.
 boolean matches(ReferenceDescriptor reference)
          Determine if supplied reference will match this service.
 String toString()
          Returns a string representation of the service.
 
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, wait, wait, wait
 

Constructor Detail

Service

public Service(ReferenceDescriptor reference)
Creation of a new Service instance using a classname and supplied properties argument.

Parameters:
reference - the versioned classname

Service

public Service(ReferenceDescriptor reference,
               EntryDescriptor[] entries)
Creation of a new Service instance using a classname and supplied properties argument.

Parameters:
reference - the versioned classname
entries - the set of attributes to assign to the descriptor

Service

public Service(ReferenceDescriptor reference,
               Properties attributes)
Creation of a new Service instance using a classname and supplied properties argument.

Parameters:
reference - the versioned classname
attributes - the set of attributes to assign to the descriptor

Service

public Service(ReferenceDescriptor reference,
               EntryDescriptor[] entries,
               Properties attributes)
Creation of a new Service instance using a classname and supplied properties argument.

Parameters:
reference - the versioned classname
entries - the set of optional context entries
attributes - the set of attributes to assign to the descriptor
Method Detail

getClassname

public String getClassname()
Return the service classname key.

Returns:
the service classname

getVersion

public Version getVersion()
Return the service version.

Returns:
the version

getReference

public ReferenceDescriptor getReference()
Return the service reference.

Returns:
the reference

getEntries

public EntryDescriptor[] getEntries()
Return the entries declared by the service.

Returns:
the entry descriptors

matches

public boolean matches(ReferenceDescriptor reference)
Determine if supplied reference will match this service. To match a service has to have same classname and must comply with version.

Parameters:
reference - the reference descriptor
Returns:
true if matches, false otherwise

hashCode

public int hashCode()
Return the hashcode for this service defintion.

Overrides:
hashCode in class Descriptor
Returns:
the hashcode value

equals

public boolean equals(Object other)
Compare this object to the supplied object for equality.

Overrides:
equals in class Descriptor
Parameters:
other - the object to compare to this object
Returns:
true if this object matches the supplied object in terms of service classname and version

toString

public String toString()
Returns a string representation of the service.

Returns:
a string representation


Copyright © The Apache Software Foundation. All Rights Reserved.