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 java.lang.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(java.lang.Class<T> clazz, T obj)
          Add arbitrary attachment
 java.lang.Object addAttachment(java.lang.String name, java.lang.Object obj)
          Add arbitrary attachment with name
<T> T
addAttachment(java.lang.String name, T obj, java.lang.Class<T> clazz)
          Add arbitrary attachment with name
<T> T
getAttachment(java.lang.Class<T> clazz)
          Get an arbitrary attachment
 java.lang.Object getAttachment(java.lang.String name)
          Get an arbitrary attachment
<T> T
getAttachment(java.lang.String name, java.lang.Class<T> clazz)
          Get an arbitrary attachment
 java.util.Collection<Attachments.Key> getAttachmentKeys()
          Get attachment keys
<T> T
removeAttachment(java.lang.Class<T> clazz)
          Remove arbitrary attachments
<T> T
removeAttachment(java.lang.Class<T> clazz, java.lang.String name)
          Remove arbitrary attachments
 java.lang.Object removeAttachment(java.lang.String name)
          Remove arbitrary attachments
 java.lang.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 java.util.Collection<Attachments.Key> getAttachmentKeys()
Description copied from interface: Attachments
Get attachment keys

Specified by:
getAttachmentKeys in interface Attachments

getAttachment

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

Specified by:
getAttachment in interface Attachments

getAttachment

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

Specified by:
getAttachment in interface Attachments

getAttachment

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

Specified by:
getAttachment in interface Attachments

addAttachment

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

Specified by:
addAttachment in interface Attachments

addAttachment

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

Specified by:
addAttachment in interface Attachments

addAttachment

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

Specified by:
addAttachment in interface Attachments

removeAttachment

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

Specified by:
removeAttachment in interface Attachments

removeAttachment

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

Specified by:
removeAttachment in interface Attachments

removeAttachment

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

Specified by:
removeAttachment in interface Attachments

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.