org.jboss.managed.plugins
Class ManagedObjectImpl

java.lang.Object
  extended by org.jboss.managed.plugins.ManagedObjectImpl
All Implemented Interfaces:
Serializable, ManagedCommon, ManagedObject, MutableManagedObject

public class ManagedObjectImpl
extends Object
implements MutableManagedObject

ManagedObjectImpl.

Version:
$Revision: 89195 $
Author:
Adrian Brock, Scott.Stark@jboss.org
See Also:
Serialized Form

Constructor Summary
ManagedObjectImpl(String name)
          Create a new ManagedObjectImpl
ManagedObjectImpl(String name, Set<ManagedProperty> properties)
          Create a new ManagedObjectImpl
ManagedObjectImpl(String name, Set<ManagedProperty> properties, HashSet<ManagedOperation> operations)
          Deprecated. 
ManagedObjectImpl(String name, Set<ManagedProperty> properties, Set<ManagedOperation> operations)
          Create a new ManagedObjectImpl
ManagedObjectImpl(String name, String nameType, String attachmentName, Map<String,ManagedProperty> properties, HashSet<ManagedOperation> operations, Serializable attachment)
          Deprecated. 
ManagedObjectImpl(String name, String nameType, String attachmentName, Map<String,ManagedProperty> properties, Set<ManagedOperation> operations, Object attachment)
          Create a new ManagedObjectImpl
ManagedObjectImpl(String name, String nameType, String attachmentName, Set<ManagedProperty> properties, HashSet<ManagedOperation> operations, Serializable attachment)
          Deprecated. 
ManagedObjectImpl(String name, String nameType, String attachmentName, Set<ManagedProperty> properties, Set<ManagedOperation> operations, Object attachment)
          Create a new ManagedObjectImpl
 
Method Summary
 boolean equals(Object obj)
           
 Map<String,Annotation> getAnnotations()
          Get the annotations associated with the property
 Object getAttachment()
          Get the underlying object.
 String getAttachmentName()
          Get the attachment name
 Object getComponentName()
          Get the runtime component name.
 String getName()
          Get the external name by which the ManagedObject is known
 String getNameType()
          Get the external name type/qualifier.
 Set<ManagedOperation> getOperations()
          get the ManagedOperations
 ManagedObject getParent()
          Get the parent ManagedObject
 Map<String,ManagedProperty> getProperties()
          Get the properties
 ManagedProperty getProperty(String name)
          Get a property
 Set<String> getPropertyNames()
          Get the property names
<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.
 int hashCode()
           
 void setAnnotations(Map<String,Annotation> annotations)
           
 void setAttachment(Object attachment)
          Set the attachment.
 void setAttachmentName(String attachmentName)
           
 void setComponentName(Object name)
          Set the runtime component name.
 void setName(String name)
          Set the external name by which the ManagedObject is known
 void setNameType(String nameType)
           
 void setOperations(Set<ManagedOperation> operations)
          Set the ManagedOperation associated with the ManagedObject.
 void setParent(ManagedObject parent)
          Set the parent ManagedObject.
 void setProperties(Map<String,ManagedProperty> properties)
          Set the ManagedObject ManagedProperty mapping.
 void setTransientAttachment(String name, Object attachment)
          Set a transient attachment against the property.
 String toString()
           
protected  void toString(StringBuilder sb)
          Append the name and props
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManagedObjectImpl

public ManagedObjectImpl(String name)
Create a new ManagedObjectImpl

Parameters:
name - - The object name used for ManagementRef resolution

ManagedObjectImpl

public ManagedObjectImpl(String name,
                         Set<ManagedProperty> properties)
Create a new ManagedObjectImpl

Parameters:
name - - The object name used for ManagementRef resolution
properties - the properties

ManagedObjectImpl

public ManagedObjectImpl(String name,
                         Set<ManagedProperty> properties,
                         Set<ManagedOperation> operations)
Create a new ManagedObjectImpl

Parameters:
name - - The object name used for ManagementRef resolution
properties - the properties
operations - the operations

ManagedObjectImpl

@Deprecated
public ManagedObjectImpl(String name,
                                    Set<ManagedProperty> properties,
                                    HashSet<ManagedOperation> operations)
Deprecated. 


ManagedObjectImpl

public ManagedObjectImpl(String name,
                         String nameType,
                         String attachmentName,
                         Set<ManagedProperty> properties,
                         Set<ManagedOperation> operations,
                         Object attachment)
Create a new ManagedObjectImpl

Parameters:
name - - The object name used for ManagementRef resolution
nameType - - The name type/qualifier used for ManagementRef resolution
attachmentName - the attachment name
properties - the properties
operations - the operations
attachment - the attachment

ManagedObjectImpl

@Deprecated
public ManagedObjectImpl(String name,
                                    String nameType,
                                    String attachmentName,
                                    Set<ManagedProperty> properties,
                                    HashSet<ManagedOperation> operations,
                                    Serializable attachment)
Deprecated. 


ManagedObjectImpl

public ManagedObjectImpl(String name,
                         String nameType,
                         String attachmentName,
                         Map<String,ManagedProperty> properties,
                         Set<ManagedOperation> operations,
                         Object attachment)
Create a new ManagedObjectImpl

Parameters:
name - - The object name used for ManagementRef resolution
nameType - - The name type/qualifier used for ManagementRef resolution
attachmentName - the attachment name
properties - the properties
operations - the operations
attachment - the attachment

ManagedObjectImpl

@Deprecated
public ManagedObjectImpl(String name,
                                    String nameType,
                                    String attachmentName,
                                    Map<String,ManagedProperty> properties,
                                    HashSet<ManagedOperation> operations,
                                    Serializable attachment)
Deprecated. 

Method Detail

getName

public String getName()
Description copied from interface: ManagedCommon
Get the external name by which the ManagedObject is known

Specified by:
getName in interface ManagedCommon
Returns:
the name
See Also:
ManagementObject#name}}, ManagementObjectID#name}}

setName

public void setName(String name)
Description copied from interface: MutableManagedObject
Set the external name by which the ManagedObject is known

Specified by:
setName in interface MutableManagedObject
See Also:
ManagementObject#name}}, ManagementObjectID#name}}

getNameType

public String getNameType()
Description copied from interface: ManagedCommon
Get the external name type/qualifier.

Specified by:
getNameType in interface ManagedCommon
Returns:
the name type
See Also:
ManagementObject#type}, ManagementObjectID#type}

setNameType

public void setNameType(String nameType)

getAttachmentName

public String getAttachmentName()
Description copied from interface: ManagedCommon
Get the attachment name

Specified by:
getAttachmentName in interface ManagedCommon
Returns:
the name
See Also:
ManagementObject#attachmentName}}

setAttachmentName

public void setAttachmentName(String attachmentName)

getAnnotations

public Map<String,Annotation> getAnnotations()
Get the annotations associated with the property

Specified by:
getAnnotations in interface ManagedObject
Returns:
the annotations associated with the property

setAnnotations

public void setAnnotations(Map<String,Annotation> annotations)

getPropertyNames

public Set<String> getPropertyNames()
Description copied from interface: ManagedCommon
Get the property names

Specified by:
getPropertyNames in interface ManagedCommon
Returns:
the property names

getProperty

public ManagedProperty getProperty(String name)
Description copied from interface: ManagedCommon
Get a property

Specified by:
getProperty in interface ManagedCommon
Parameters:
name - the name
Returns:
the property

getProperties

public Map<String,ManagedProperty> getProperties()
Description copied from interface: ManagedCommon
Get the properties

Specified by:
getProperties in interface ManagedCommon
Returns:
the properties

setProperties

public void setProperties(Map<String,ManagedProperty> properties)
Description copied from interface: MutableManagedObject
Set the ManagedObject ManagedProperty mapping.

Specified by:
setProperties in interface MutableManagedObject
Parameters:
properties - - the ManagedProperty mapping.

getAttachment

public Object getAttachment()
Description copied from interface: ManagedObject
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.

Specified by:
getAttachment in interface ManagedObject
Returns:
the underlying object

setAttachment

public void setAttachment(Object attachment)
Set the attachment.

Specified by:
setAttachment in interface MutableManagedObject
Parameters:
attachment - the attachment.

getOperations

public Set<ManagedOperation> getOperations()
get the ManagedOperations

Specified by:
getOperations in interface ManagedCommon
Returns:
set of managed operations

setOperations

public void setOperations(Set<ManagedOperation> operations)
Description copied from interface: MutableManagedObject
Set the ManagedOperation associated with the ManagedObject.

Specified by:
setOperations in interface MutableManagedObject
Parameters:
operations - - the ManagedOperations for the ManagedObject.

getParent

public ManagedObject getParent()
Description copied from interface: ManagedObject
Get the parent ManagedObject

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

setParent

public void setParent(ManagedObject parent)
Description copied from interface: MutableManagedObject
Set the parent ManagedObject.

Specified by:
setParent in interface MutableManagedObject
Parameters:
parent - - the parent ManagedObject, null if no parent exists.

getComponentName

public Object getComponentName()
Description copied from interface: ManagedCommon
Get the runtime component name.

Specified by:
getComponentName in interface ManagedCommon
Returns:
name of runtime component if one exists, null if no component exists.
See Also:
ManagementRuntimeRef}

setComponentName

public void setComponentName(Object name)
Description copied from interface: MutableManagedObject
Set the runtime component name.

Specified by:
setComponentName in interface MutableManagedObject
See Also:
ManagementRuntimeRef}

getTransientAttachment

public <T> T getTransientAttachment(Class<T> expectedType)
Description copied from interface: ManagedObject
Get an attachment from the property, uses the expected type as both the name and to cast the resulting object.

Specified by:
getTransientAttachment in interface ManagedObject
Type Parameters:
T - the expected type
Parameters:
expectedType - the expected type
Returns:
the attachment

getTransientAttachment

public Object getTransientAttachment(String name)
Description copied from interface: ManagedObject
Get a transient attachment from the property.

Specified by:
getTransientAttachment in interface ManagedObject
Parameters:
name - the name
Returns:
the attachment
See Also:
ManagedObject.setTransientAttachment(String, Object)

setTransientAttachment

public void setTransientAttachment(String name,
                                   Object attachment)
Description copied from interface: ManagedObject
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.

Specified by:
setTransientAttachment in interface ManagedObject
Parameters:
name - the name
attachment - the attachment, pass null to remove an attachment

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

toString

protected void toString(StringBuilder sb)
Append the name and props

Parameters:
sb - the buffer to append the name and props to


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