org.jboss.osgi.resolver.spi
Class AttachmentSupporter

java.lang.Object
  extended by org.jboss.osgi.resolver.spi.AttachmentSupporter
All Implemented Interfaces:
XAttachmentSupport

public class AttachmentSupporter
extends Object
implements XAttachmentSupport

An implementation of XAttachmentSupport.

Since:
02-Jul-2010
Author:
thomas.diesler@jboss.com

Constructor Summary
AttachmentSupporter()
           
 
Method Summary
<T> T
addAttachment(Class<T> clazz, T value)
          Attach an arbirtary object with this element.
<T> T
getAttachment(Class<T> clazz)
          Get the attached object for a given key
<T> T
removeAttachment(Class<T> clazz)
          Remove an attached object for a given key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentSupporter

public AttachmentSupporter()
Method Detail

addAttachment

public <T> T addAttachment(Class<T> clazz,
                           T value)
Description copied from interface: XAttachmentSupport
Attach an arbirtary object with this element.

Specified by:
addAttachment in interface XAttachmentSupport
Parameters:
clazz - key for the attachment
Returns:
The previously attachment object or null

getAttachment

public <T> T getAttachment(Class<T> clazz)
Description copied from interface: XAttachmentSupport
Get the attached object for a given key

Specified by:
getAttachment in interface XAttachmentSupport
Parameters:
clazz - key for the attachment
Returns:
The attached object or null

removeAttachment

public <T> T removeAttachment(Class<T> clazz)
Description copied from interface: XAttachmentSupport
Remove an attached object for a given key

Specified by:
removeAttachment in interface XAttachmentSupport
Parameters:
clazz - key for the attachment
Returns:
The attached object or null


Copyright © 2013 JBoss by Red Hat. All Rights Reserved.