com.sun.grizzly.util
Interface AttributeHolder

All Known Subinterfaces:
ComplexSelectorHandler, SelectorHandler
All Known Implementing Classes:
Context, Controller, ReadController, RoundRobinSelectorHandler, SelectorThreadHandler, SSLSelectorHandler, SSLSelectorThreadHandler, TCPSelectorHandler, ThreadAttachment, UDPSelectorHandler

public interface AttributeHolder

Interface declares common functionality for objects, which could have associated attributes.

Author:
Alexey Stashok

Method Summary
 Object getAttribute(String name)
          Return an object based on a name.
 Map<String,Object> getAttributes()
          Return a Map of attribute name/value pairs.
 Object removeAttribute(String name)
          Remove a name/value object.
 void setAttribute(String name, Object value)
          Set a name/value object.
 void setAttributes(Map<String,Object> attributes)
          Set a Map of attribute name/value pairs.
 

Method Detail

removeAttribute

Object removeAttribute(String name)
Remove a name/value object.

Parameters:
name - - name of an attribute
Returns:
attribute which has been removed

setAttribute

void setAttribute(String name,
                  Object value)
Set a name/value object.

Parameters:
name - - name of an attribute
value - - value of named attribute

setAttributes

void setAttributes(Map<String,Object> attributes)
Set a Map of attribute name/value pairs. Old AttributeHolder values will not be available. Later changes of this Map will lead to changes to the current AttributeHolder.

Parameters:
attributes - - map of name/value pairs

getAttribute

Object getAttribute(String name)
Return an object based on a name.

Parameters:
name - - name of an attribute
Returns:
- attribute value for the name, null if name does not exist in attributes

getAttributes

Map<String,Object> getAttributes()
Return a Map of attribute name/value pairs. Updates, performed on the returned Map will be reflected in this AttributeHolder

Returns:
- Map of attribute name/value pairs


Copyright © 2010 SUN Microsystems. All Rights Reserved.