org.jboss.managed.api
Interface TransientAttachments

All Known Subinterfaces:
ManagedOperation, ManagedParameter, ManagedProperty
All Known Implementing Classes:
ManagedOperationImpl, ManagedParameterImpl, ManagedPropertyImpl, WritethroughManagedPropertyImpl

public interface TransientAttachments

A common interface for managed elements that support transient attachments

Version:
$Revision: 87004 $
Author:
Scott.Stark@jboss.org

Method Summary
<T> T
getTransientAttachment(Class<T> expectedType)
          Get an attachment from the parameter, uses the expected type as both the name and to cast the resulting object.
 Object getTransientAttachment(String name)
          Get a transient attachment from the parameter.
 void setTransientAttachment(String name, Object attachment)
          Set an transient attachment against the parameter.
 

Method Detail

getTransientAttachment

Object getTransientAttachment(String name)
Get a transient attachment from the parameter.

Parameters:
name - the name
Returns:
the attachment
See Also:
setTransientAttachment(String, Object)

getTransientAttachment

<T> T getTransientAttachment(Class<T> expectedType)
Get an attachment from the parameter, uses the expected type as both the name and to cast the resulting object.

Type Parameters:
T - the expected type
Parameters:
expectedType - the expected type
Returns:
the attachment
Throws:
ClassCastException - when the object is not of the expected type

setTransientAttachment

void setTransientAttachment(String name,
                            Object attachment)
Set an transient attachment against the parameter. A transient attachment is one that will not be available to clients of the parameter, typically admin tools. Such attachments are used by the server side where the underlying metadata to which the parameter is associated is available.

Parameters:
name - the name
attachment - the attachment, pass null to remove an attachment
Throws:
IllegalArgumentException - for a null name


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.