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:
- [email protected], [email protected]
-
-
Constructor Summary
Constructors Constructor and Description AbstractExtensible()
AbstractExtensible(int initialAttachmentsSize, int initialPropertiesSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description <T> T
addAttachment(Class<T> clazz, Object obj)
Add arbitrary attachments<T> T
getAttachment(Class<T> clazz)
Get an arbitrary attachmentCollection<Object>
getAttachments()
Get arbitrary attachmentsSet<String>
getProperties()
Get the set of property namesObject
getProperty(String key)
Get an property<T> T
removeAttachment(Class<T> key)
Remove arbitrary attachmentsvoid
removeProperty(String key)
Remove a propertyvoid
setProperties(Map<String,Object> props)
Set a map of propertiesvoid
setProperty(String key, Object value)
Set a property
-
-
-
Constructor Detail
-
AbstractExtensible
public AbstractExtensible()
-
AbstractExtensible
public AbstractExtensible(int initialAttachmentsSize, int initialPropertiesSize)
-
-
Method Detail
-
getAttachments
public Collection<Object> getAttachments()
Description copied from interface:Extensible
Get arbitrary attachments- Specified by:
-
getAttachments
in interfaceExtensible
- Returns:
- collection of attachments
-
getAttachment
public <T> T getAttachment(Class<T> clazz)
Description copied from interface:Extensible
Get an arbitrary attachment- Specified by:
-
getAttachment
in 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:Extensible
Add arbitrary attachments- Specified by:
-
addAttachment
in interfaceExtensible
- Type Parameters:
-
T
- class type - Parameters:
-
clazz
- identifier -
obj
- value - Returns:
- added attachment
-
removeAttachment
public <T> T removeAttachment(Class<T> key)
Description copied from interface:Extensible
Remove arbitrary attachments- Specified by:
-
removeAttachment
in interfaceExtensible
- Type Parameters:
-
T
- class type of attachments - Parameters:
-
key
- identifier - Returns:
- attachment removed
-
getProperties
public Set<String> getProperties()
Description copied from interface:Extensible
Get the set of property names- Specified by:
-
getProperties
in interfaceExtensible
- Returns:
- set of property values
-
getProperty
public Object getProperty(String key)
Description copied from interface:Extensible
Get an property- Specified by:
-
getProperty
in interfaceExtensible
- Parameters:
-
key
- property identifier - Returns:
- found property
-
removeProperty
public void removeProperty(String key)
Description copied from interface:Extensible
Remove a property- Specified by:
-
removeProperty
in interfaceExtensible
- Parameters:
-
key
- property identifier
-
setProperty
public void setProperty(String key, Object value)
Description copied from interface:Extensible
Set a property- Specified by:
-
setProperty
in interfaceExtensible
- Parameters:
-
key
- property identifier -
value
- property value
-
setProperties
public void setProperties(Map<String,Object> props)
Description copied from interface:Extensible
Set a map of properties- Specified by:
-
setProperties
in interfaceExtensible
- Parameters:
-
props
- map to retain
-
-
Copyright © 2018 JBoss, by Red Hat. All rights reserved.