Package org.jboss.wsf.spi.deployment
Class AbstractExtensible
- java.lang.Object
-
- org.jboss.wsf.spi.deployment.AbstractExtensible
-
- All Implemented Interfaces:
Extensible
- Direct Known Subclasses:
InvocationContext
public abstract class AbstractExtensible extends Object implements Extensible
A general extendible artifact; please note the 'attachments' and 'properties' fields are not meant to be modified concurrently, as they are initialied to plain HashMap instances. Extensions of this class should override the methods accessing those fields and add synchronized keyword. Most of the time, though, there will only be a single thread writing/deleting stuff in this class at the same time, for example because that only happens during deployment processing (which executes in the same thread for deployment processors / aspects and only the last aspect installs a service for each endpoint that run very limited stuff in different threads). Visibility is ensured by the fields being final.- Since:
- 20-Apr-2007
- Author:
- Thomas.Diesler@jboss.com, alessio.soldano@jboss.com
-
-
Constructor Summary
Constructors Constructor Description AbstractExtensible()AbstractExtensible(int initialAttachmentsSize, int initialPropertiesSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TaddAttachment(Class<T> clazz, Object obj)Add arbitrary attachments<T> TgetAttachment(Class<T> clazz)Get an arbitrary attachmentCollection<Object>getAttachments()Get arbitrary attachmentsSet<String>getProperties()Get the set of property namesObjectgetProperty(String key)Get an property<T> TremoveAttachment(Class<T> key)Remove arbitrary attachmentsvoidremoveProperty(String key)Remove a propertyvoidsetProperties(Map<String,Object> props)Set a map of propertiesvoidsetProperty(String key, Object value)Set a property
-
-
-
Method Detail
-
getAttachments
public Collection<Object> getAttachments()
Description copied from interface:ExtensibleGet arbitrary attachments- Specified by:
getAttachmentsin interfaceExtensible- Returns:
- collection of attachments
-
getAttachment
public <T> T getAttachment(Class<T> clazz)
Description copied from interface:ExtensibleGet an arbitrary attachment- Specified by:
getAttachmentin interfaceExtensible- Type Parameters:
T- class type of attachments- Parameters:
clazz- identifier- Returns:
- attachment found
-
addAttachment
public <T> T addAttachment(Class<T> clazz, Object obj)
Description copied from interface:ExtensibleAdd arbitrary attachments- Specified by:
addAttachmentin interfaceExtensible- Type Parameters:
T- class type- Parameters:
clazz- identifierobj- value- Returns:
- added attachment
-
removeAttachment
public <T> T removeAttachment(Class<T> key)
Description copied from interface:ExtensibleRemove arbitrary attachments- Specified by:
removeAttachmentin interfaceExtensible- Type Parameters:
T- class type of attachments- Parameters:
key- identifier- Returns:
- attachment removed
-
getProperties
public Set<String> getProperties()
Description copied from interface:ExtensibleGet the set of property names- Specified by:
getPropertiesin interfaceExtensible- Returns:
- set of property values
-
getProperty
public Object getProperty(String key)
Description copied from interface:ExtensibleGet an property- Specified by:
getPropertyin interfaceExtensible- Parameters:
key- property identifier- Returns:
- found property
-
removeProperty
public void removeProperty(String key)
Description copied from interface:ExtensibleRemove a property- Specified by:
removePropertyin interfaceExtensible- Parameters:
key- property identifier
-
setProperty
public void setProperty(String key, Object value)
Description copied from interface:ExtensibleSet a property- Specified by:
setPropertyin interfaceExtensible- Parameters:
key- property identifiervalue- property value
-
setProperties
public void setProperties(Map<String,Object> props)
Description copied from interface:ExtensibleSet a map of properties- Specified by:
setPropertiesin interfaceExtensible- Parameters:
props- map to retain
-
-