org.jboss.deployers.spi.attachments
Interface Attachments

All Superinterfaces:
Serializable
All Known Subinterfaces:
DeploymentUnit, MutableAttachments, VFSDeploymentUnit
All Known Implementing Classes:
AbstractAttachments, AbstractDeploymentUnit, AbstractMutableAttachments, AbstractVFSDeploymentUnit, AttachmentsImpl, TrackingMutableAttachments

public interface Attachments
extends Serializable

Attachments Represents a set of attachments

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Method Summary
<T> T
getAttachment(Class<T> type)
          Get attachment
 Object getAttachment(String name)
          Get attachment
<T> T
getAttachment(String name, Class<T> expectedType)
          Get attachment
 Map<String,Object> getAttachments()
          Get all the attachments
 boolean hasAttachments()
          Are there any attachments
 boolean isAttachmentPresent(Class<?> type)
          Is the attachment present
 boolean isAttachmentPresent(String name)
          Is the attachment present
 boolean isAttachmentPresent(String name, Class<?> expectedType)
          Is the attachment present
 

Method Detail

getAttachments

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

Returns:
the unmodifiable attachments

getAttachment

Object getAttachment(String name)
Get attachment

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

getAttachment

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

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

getAttachment

<T> T getAttachment(Class<T> type)
Get attachment

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

isAttachmentPresent

boolean isAttachmentPresent(String name)
Is the attachment present

Parameters:
name - the name of the attachment
Returns:
true when the attachment is present
Throws:
IllegalArgumentException - for a null name

isAttachmentPresent

boolean isAttachmentPresent(String name,
                            Class<?> expectedType)
Is the attachment present

Parameters:
name - the name of the attachment
expectedType - the expected type
Returns:
true when the attachment is present
Throws:
IllegalArgumentException - for a null name or expectedType

isAttachmentPresent

boolean isAttachmentPresent(Class<?> type)
Is the attachment present

Parameters:
type - the type
Returns:
true when the attachment is present
Throws:
IllegalArgumentException - for a null name or type

hasAttachments

boolean hasAttachments()
Are there any attachments

Returns:
true if there are any attachments, false otherwise.


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