JBoss Managed Parent POM 2.1.1.SP2

org.jboss.managed.api
Interface ManagedObject

All Superinterfaces:
ManagedCommon, Serializable
All Known Subinterfaces:
MutableManagedObject
All Known Implementing Classes:
DelegateManagedObjectImpl, ManagedObjectImpl

public interface ManagedObject
extends ManagedCommon

ManagedObject is an interface for a manageable entity. It consists of: - a name/name type for a registry/references - an attachment name to associate the ManagedObject with a deployment attachment - annotations from the metadata making up the ManagedObject - the attachment instance - the ManagedPropertys for the entity - the ManagedOperations for the entity NOTE: Clients should not use this class - it is intended for server-side use only.

Version:
$Revision: 90104 $
Author:
Adrian Brock, Scott.Stark@jboss.org

Method Summary
 Map<String,Annotation> getAnnotations()
          Get the annotations associated with the managed object
 Object getAttachment()
          Get the underlying object.
 ManagedObject getParent()
          Get the parent ManagedObject
<T> T
getTransientAttachment(Class<T> expectedType)
          Get an attachment from the property, uses the expected type as both the name and to cast the resulting object.
 Object getTransientAttachment(String name)
          Get a transient attachment from the property.
 void setTransientAttachment(String name, Object attachment)
          Set a transient attachment against the property.
 
Methods inherited from interface org.jboss.managed.api.ManagedCommon
getAttachmentName, getComponentName, getName, getNameType, getOperations, getProperties, getProperty, getPropertyNames
 

Method Detail

getAttachment

Object getAttachment()
Get the underlying object. Note that this is only useful in the server environment where the ManagedObject is associated with a deployment attachment. In a client environment (admin tool for example), this is most likely null.

Returns:
the underlying object

getAnnotations

Map<String,Annotation> getAnnotations()
Get the annotations associated with the managed object

Returns:
the annotations associated with the managed object

getParent

ManagedObject getParent()
Get the parent ManagedObject

Specified by:
getParent in interface ManagedCommon
Returns:
the parent if one exists, null otherwise

getTransientAttachment

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

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

getTransientAttachment

<T> T getTransientAttachment(Class<T> expectedType)
Get an attachment from the property, 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 a transient attachment against the property. A transient attachment is one that will not be available to clients of the property, typically admin tools. Such attachments are used by the server side where the underlying metadata to which the property is associated is available.

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

JBoss Managed Parent POM 2.1.1.SP2

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