org.glassfish.deployment.common
Class DynamicAttributesDescriptor

java.lang.Object
  extended by java.util.Observable
      extended by org.glassfish.deployment.common.DynamicAttributesDescriptor
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Descriptor

public class DynamicAttributesDescriptor
extends Observable
implements Serializable

This class is a value holder for dynamic attributes. Dynamic attributes can be added, queried and removed from this value holder. Attributes are identified by a string key.

Author:
Jerome Dochez
See Also:
Serialized Form

Constructor Summary
DynamicAttributesDescriptor()
           
 
Method Summary
 void addExtraAttribute(String name, Object value)
          Add a new dynamic attribte
 Object getExtraAttribute(String name)
          Obtain a dynamic attribute from the repository
 Map getExtraAttributes()
          Direct acess to the dynamic attributes repository
 void print(StringBuffer toStringBuffer)
           
 void removeExtraAttribute(String name)
          Removes a dynamic attribute from the repository
 String toString()
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DynamicAttributesDescriptor

public DynamicAttributesDescriptor()
Method Detail

getExtraAttributes

public Map getExtraAttributes()
Direct acess to the dynamic attributes repository

Returns:
the Map of dynamic attributes

addExtraAttribute

public void addExtraAttribute(String name,
                              Object value)
Add a new dynamic attribte

Parameters:
name - the attribute name
value - the attribute value

getExtraAttribute

public Object getExtraAttribute(String name)
Obtain a dynamic attribute from the repository

Parameters:
name - the attribute name
Returns:
the attribute value of null of non existent

removeExtraAttribute

public void removeExtraAttribute(String name)
Removes a dynamic attribute from the repository

Parameters:
name - the attribute name

print

public void print(StringBuffer toStringBuffer)

toString

public String toString()
Overrides:
toString in class Object
Returns:
a meaningfull string about ourself No Descriptor class which inherits this class should override this method. Rather print() method which is defined in this class should be overridden to describe itself. Refer to the comments on print() method for more details. This method is optimized for persformance reasons.


Copyright © 2012. All Rights Reserved.