org.sape.smfw.messagingengine
Class MessageContext

java.lang.Object
  extended byorg.sape.smfw.messagingengine.MessageContext

public class MessageContext
extends Object

The MessageContext stores the configuration of the messaging engine as well as the processing state of a message.


Field Summary
static String HTTP_SERVLET_REQUEST_PROPERTY_NAME
          Property name of the HttpServletRequest object stored in the MessageContext
private  MessageHandlerFactory messageHandlerFactory
          The MessageHandlerFactory for this context
private  Map properties
          A map to store properties related to this context
private  User user
          The user who sent the request
 
Constructor Summary
MessageContext(MessageHandlerFactory messageHandlerFactory)
          Constructs a MessageContext
 
Method Summary
 void addProperty(String name, Object value)
          Adds a property to the context.
 MessageHandler createMessageHandler(Message message)
          Convenience method to create a MessageHandler for the supplied message.
 MessageHandlerFactory getMessageHandlerFactory()
          Returns the MessageHandlerFactory for this context
 Map getProperties()
          Get the properties associated with this context
 Object getProperty(String name)
          Gets a property from the context.
 User getUser()
          Returns the User who sent the request
 Object removeProperty(String name)
          Removes a property to the context.
 void setMessageHandlerFactory(MessageHandlerFactory messageHandlerFactory)
          Sets the MessageHandlerFactory for this context
 void setProperties(Map properties)
          Set the properties associated with this context
 void setUser(User user)
          Sets the User who sent the request
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_SERVLET_REQUEST_PROPERTY_NAME

public static final String HTTP_SERVLET_REQUEST_PROPERTY_NAME
Property name of the HttpServletRequest object stored in the MessageContext

See Also:
Constant Field Values

messageHandlerFactory

private MessageHandlerFactory messageHandlerFactory
The MessageHandlerFactory for this context


user

private User user
The user who sent the request


properties

private Map properties
A map to store properties related to this context

Constructor Detail

MessageContext

public MessageContext(MessageHandlerFactory messageHandlerFactory)
Constructs a MessageContext

Parameters:
messageHandlerFactory - the MessageHandlerFactory for this context
Method Detail

getMessageHandlerFactory

public MessageHandlerFactory getMessageHandlerFactory()
Returns the MessageHandlerFactory for this context

Returns:
the MessageHandlerFactory for this context

setMessageHandlerFactory

public void setMessageHandlerFactory(MessageHandlerFactory messageHandlerFactory)
Sets the MessageHandlerFactory for this context

Parameters:
messageHandlerFactory - the MessageHandlerFactory for this context

createMessageHandler

public MessageHandler createMessageHandler(Message message)
Convenience method to create a MessageHandler for the supplied message.

Parameters:
message - the message for which a MessageHandler is needed

getUser

public User getUser()
Returns the User who sent the request

Returns:
the User who sent the request

setUser

public void setUser(User user)
Sets the User who sent the request

Parameters:
user - the User who sent the request

getProperties

public Map getProperties()
Get the properties associated with this context

Returns:
Map containing properties

setProperties

public void setProperties(Map properties)
Set the properties associated with this context

Parameters:
properties - the properties to set

addProperty

public void addProperty(String name,
                        Object value)
Adds a property to the context.

Parameters:
name - name of the property to be added
value - value of the property to be added

removeProperty

public Object removeProperty(String name)
Removes a property to the context.

Parameters:
name - name of the property to be removed
Returns:
value of the removed property

getProperty

public Object getProperty(String name)
Gets a property from the context.

Parameters:
name - name of the property that is needed
Returns:
value of the property


Copyright 2003 Sapient Corporation. All Rights Reserved.