org.jboss.osgi.spi.util
Class AttachmentSupport

java.lang.Object
  extended by org.jboss.osgi.spi.util.AttachmentSupport
All Implemented Interfaces:
Attachments

public abstract class AttachmentSupport
extends Object
implements Attachments

Basic attachment support.

Since:
20-Apr-2007
Author:
Thomas.Diesler@jboss.com

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.osgi.spi.Attachments
Attachments.Key
 
Constructor Summary
AttachmentSupport()
          Construct with no attachments
AttachmentSupport(AttachmentSupport att)
          Construct with given attachments
 
Method Summary
<T> T
addAttachment(Class<T> clazz, T obj)
          Add arbitrary attachment
 Object addAttachment(String name, Object obj)
          Add arbitrary attachment with name
<T> T
addAttachment(String name, T obj, Class<T> clazz)
          Add arbitrary attachment with name
<T> T
getAttachment(Class<T> clazz)
          Get an arbitrary attachment
 Object getAttachment(String name)
          Get an arbitrary attachment
<T> T
getAttachment(String name, Class<T> clazz)
          Get an arbitrary attachment
 Collection<Attachments.Key> getAttachmentKeys()
          Get attachment keys
<T> T
removeAttachment(Class<T> clazz)
          Remove arbitrary attachments
<T> T
removeAttachment(Class<T> clazz, String name)
          Remove arbitrary attachments
 Object removeAttachment(String name)
          Remove arbitrary attachments
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttachmentSupport

public AttachmentSupport()
Construct with no attachments


AttachmentSupport

public AttachmentSupport(AttachmentSupport att)
Construct with given attachments

Method Detail

getAttachmentKeys

public Collection<Attachments.Key> getAttachmentKeys()
Description copied from interface: Attachments
Get attachment keys

Specified by:
getAttachmentKeys in interface Attachments

getAttachment

public <T> T getAttachment(Class<T> clazz)
Description copied from interface: Attachments
Get an arbitrary attachment

Specified by:
getAttachment in interface Attachments

getAttachment

public <T> T getAttachment(String name,
                           Class<T> clazz)
Description copied from interface: Attachments
Get an arbitrary attachment

Specified by:
getAttachment in interface Attachments

getAttachment

public Object getAttachment(String name)
Description copied from interface: Attachments
Get an arbitrary attachment

Specified by:
getAttachment in interface Attachments

addAttachment

public <T> T addAttachment(Class<T> clazz,
                           T obj)
Description copied from interface: Attachments
Add arbitrary attachment

Specified by:
addAttachment in interface Attachments

addAttachment

public <T> T addAttachment(String name,
                           T obj,
                           Class<T> clazz)
Description copied from interface: Attachments
Add arbitrary attachment with name

Specified by:
addAttachment in interface Attachments

addAttachment

public Object addAttachment(String name,
                            Object obj)
Description copied from interface: Attachments
Add arbitrary attachment with name

Specified by:
addAttachment in interface Attachments

removeAttachment

public <T> T removeAttachment(Class<T> clazz)
Description copied from interface: Attachments
Remove arbitrary attachments

Specified by:
removeAttachment in interface Attachments

removeAttachment

public <T> T removeAttachment(Class<T> clazz,
                              String name)
Description copied from interface: Attachments
Remove arbitrary attachments

Specified by:
removeAttachment in interface Attachments

removeAttachment

public Object removeAttachment(String name)
Description copied from interface: Attachments
Remove arbitrary attachments

Specified by:
removeAttachment in interface Attachments

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010. All Rights Reserved.