org.jboss.system.server.profileservice.repository
Class AbstractProfileDeployment

java.lang.Object
  extended by org.jboss.system.server.profileservice.repository.AbstractProfileDeployment
All Implemented Interfaces:
Serializable, org.jboss.profileservice.spi.ProfileDeployment

public class AbstractProfileDeployment
extends Object
implements org.jboss.profileservice.spi.ProfileDeployment

The profile deployment.

Version:
$Revision: 88259 $
Author:
Emanuel Muckenhuber
See Also:
Serialized Form

Constructor Summary
AbstractProfileDeployment(String name)
           
AbstractProfileDeployment(org.jboss.virtual.VirtualFile root)
           
 
Method Summary
 Object addAttachment(String name, Object attachment)
          Add attachment.
 Object addTransientAttachment(String name, Object attachment)
          Add transient attachment
 Object getAttachment(String name)
          Get attachment.
<T> T
getAttachment(String name, Class<T> expectedType)
          Get attachment.
 Map<String,Object> getAttachments()
          Get all attachments.
 String getName()
          Get the deployment name.
 org.jboss.virtual.VirtualFile getRoot()
          Get the root of the deployment.
 Object getTransientAttachment(String name)
          Get the transient attachment.
<T> T
getTransientAttachment(String name, Class<T> expectedType)
          Get transient attachment.
 Object removeAttachment(String name)
          Remove attachment.
 Object removeTransientAttachment(String name)
          Remove transient attachment.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractProfileDeployment

public AbstractProfileDeployment(String name)

AbstractProfileDeployment

public AbstractProfileDeployment(org.jboss.virtual.VirtualFile root)
Method Detail

getName

public String getName()
Get the deployment name.

Specified by:
getName in interface org.jboss.profileservice.spi.ProfileDeployment
Returns:
the name

getRoot

public org.jboss.virtual.VirtualFile getRoot()
Get the root of the deployment.

Specified by:
getRoot in interface org.jboss.profileservice.spi.ProfileDeployment
Returns:
the root, or null if it's not a VFS deployment.

getAttachments

public Map<String,Object> getAttachments()
Get all attachments.

Specified by:
getAttachments in interface org.jboss.profileservice.spi.ProfileDeployment
Returns:
the attachments

getAttachment

public Object getAttachment(String name)
Get attachment.

Specified by:
getAttachment in interface org.jboss.profileservice.spi.ProfileDeployment
Parameters:
name - the name of the attachment
Returns:
the attachment or null if not present
Throws:
IllegalArgumentException - for a null name

getAttachment

public <T> T getAttachment(String name,
                           Class<T> expectedType)
Get attachment.

Type Parameters:
T - the expected type
Parameters:
name - the name of the attachment
expected - the expected type
Returns:
the attachment or null if not present
Throws:
IllegalArgumentException - for a null name

addAttachment

public Object addAttachment(String name,
                            Object attachment)
Add attachment.

Specified by:
addAttachment in interface org.jboss.profileservice.spi.ProfileDeployment
Parameters:
name - the name of the attachment
attachment - the attachment
Returns:
any previous attachment
Throws:
IllegalArgumentException - for a null name or attachment

removeAttachment

public Object removeAttachment(String name)
Remove attachment.

Parameters:
name - the attachment name
Returns:
the attachment or null if not present
Throws:
IllegalArgumentException - for a null name

getTransientAttachment

public Object getTransientAttachment(String name)
Get the transient attachment.

Parameters:
name - the name of the attachment
Returns:
the attachment or null if not present
Throws:
IllegalArgumentException - for a null name

getTransientAttachment

public <T> T getTransientAttachment(String name,
                                    Class<T> expectedType)
Get transient attachment.

Type Parameters:
T - the expected type
Parameters:
name - the name of the attachment
expected - the expected type
Returns:
the attachment or null if not present
Throws:
IllegalArgumentException - for a null name

addTransientAttachment

public Object addTransientAttachment(String name,
                                     Object attachment)
Add transient attachment

Parameters:
name - the name of the attachment
attachment - the attachment
Returns:
any previous attachment
Throws:
IllegalArgumentException - for a null name or attachment

removeTransientAttachment

public Object removeTransientAttachment(String name)
Remove transient attachment.

Parameters:
name - the attachment name
Returns:
the attachment or null if not present
Throws:
IllegalArgumentException - for a null name

toString

public String toString()
Overrides:
toString in class Object


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