org.mule.transport
Class MessagePropertiesContext
java.lang.Object
org.mule.transport.MessagePropertiesContext
- All Implemented Interfaces:
- Serializable
public class MessagePropertiesContext
- extends Object
- implements Serializable
This object maintains a scoped map of properties. This means that certian properties will only be visiable under some
scopes. The scopes support by Mule are:
-
org.mule.api.transport.PropertyScope.INBOUND
Contains properties that were on the message when it was
received by Mule. this scope is read-only.
org.mule.api.transport.PropertyScope.INVOCATION
Any properties set on the invocation scope will be
available to the current service but will not be attached to any outound messages. This is the default scope.
org.mule.api.transport.PropertyScope.OUTBOUND
Any properties set in this scope will be attached to any
outbound messages resulting from this message
org.mule.api.transport.PropertyScope.SESSION
Any properties set on this scope will be added to the session.
Note that this is a convinience scope in that you cannot directly access session properties from this scope. Session
properties can be accessed from the MuleEvent
- See Also:
- Serialized Form
Method Summary |
protected void |
addInboundProperties(Map properties)
|
protected void |
checkScopeForWriteAccess(PropertyScope scope)
|
void |
clearProperties()
|
void |
clearProperties(PropertyScope scope)
|
protected MessagePropertiesContext |
copy()
|
boolean |
getBooleanProperty(String name,
boolean defaultValue)
|
byte |
getByteProperty(String name,
byte defaultValue)
|
PropertyScope |
getDefaultScope()
|
double |
getDoubleProperty(String name,
double defaultValue)
|
float |
getFloatProperty(String name,
float defaultValue)
|
int |
getIntProperty(String name,
int defaultValue)
|
long |
getLongProperty(String name,
long defaultValue)
|
Object |
getProperty(String key)
|
Object |
getProperty(String key,
Object defaultValue)
|
Object |
getProperty(String key,
PropertyScope scope)
|
Set |
getPropertyNames()
|
Set |
getPropertyNames(PropertyScope scope)
|
protected Map |
getScopedProperties(PropertyScope scope)
|
short |
getShortProperty(String name,
short defaultValue)
|
String |
getStringProperty(String name,
String defaultValue)
|
protected void |
registerInvocationProperties(Map properties)
|
protected void |
registerSessionProperties(Map properties)
|
Object |
removeProperty(String key)
Removes a property on this message |
void |
setProperty(String key,
Object value)
Set a property on the message |
void |
setProperty(String key,
Object value,
PropertyScope scope)
Set a property on the message |
String |
toString()
|
scopedMap
protected Map scopedMap
keySet
protected Set keySet
defaultScope
protected PropertyScope defaultScope
MessagePropertiesContext
public MessagePropertiesContext()
MessagePropertiesContext
public MessagePropertiesContext(PropertyScope defaultScope)
getScopedProperties
protected Map getScopedProperties(PropertyScope scope)
registerInvocationProperties
protected void registerInvocationProperties(Map properties)
getDefaultScope
public PropertyScope getDefaultScope()
addInboundProperties
protected void addInboundProperties(Map properties)
registerSessionProperties
protected void registerSessionProperties(Map properties)
getProperty
public Object getProperty(String key)
getProperty
public Object getProperty(String key,
PropertyScope scope)
clearProperties
public void clearProperties()
clearProperties
public void clearProperties(PropertyScope scope)
removeProperty
public Object removeProperty(String key)
- Removes a property on this message
- Parameters:
key
- the property key to remove
- Returns:
- the removed property value or null if the property did not exist
setProperty
public void setProperty(String key,
Object value)
- Set a property on the message
- Parameters:
key
- the key on which to associate the valuevalue
- the property value
setProperty
public void setProperty(String key,
Object value,
PropertyScope scope)
- Set a property on the message
- Parameters:
key
- the key on which to associate the valuevalue
- the property valuescope
- the scope to se the property on- See Also:
PropertyScope
getPropertyNames
public Set getPropertyNames()
- Returns:
- all property keys on this message
getPropertyNames
public Set getPropertyNames(PropertyScope scope)
- Returns:
- all property keys on this message for the given scope
checkScopeForWriteAccess
protected void checkScopeForWriteAccess(PropertyScope scope)
getProperty
public Object getProperty(String key,
Object defaultValue)
getByteProperty
public byte getByteProperty(String name,
byte defaultValue)
getShortProperty
public short getShortProperty(String name,
short defaultValue)
getIntProperty
public int getIntProperty(String name,
int defaultValue)
getLongProperty
public long getLongProperty(String name,
long defaultValue)
getFloatProperty
public float getFloatProperty(String name,
float defaultValue)
getDoubleProperty
public double getDoubleProperty(String name,
double defaultValue)
getBooleanProperty
public boolean getBooleanProperty(String name,
boolean defaultValue)
getStringProperty
public String getStringProperty(String name,
String defaultValue)
copy
protected MessagePropertiesContext copy()
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.