|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.flex.messaging.MessageTemplate
public class MessageTemplate
Simple helper for sending Flex AsyncMessage
s from a Java client. The message will be routed through the
MessageBroker
to the specified MessageDestination
. This allows for flexible routing of the message
using whatever MessagingAdapter
is configured for the target destination, be it the basic BlazeDS
ActionScriptAdapter
, one of the provided Spring adapters such as JmsAdapter
or {TODO
SpringIntegrationAdapter}, or some other custom adapter implementation.
Constructor Summary | |
---|---|
MessageTemplate()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
flex.messaging.messages.AsyncMessage |
createMessage()
Creates a default AsyncMessage |
flex.messaging.messages.AsyncMessage |
createMessageForDestination(java.lang.String destination)
Creates a default AsyncMessage for a specified destination |
java.lang.String |
getDefaultDestination()
Returns the id of the default message destination for this template |
flex.messaging.MessageBroker |
getMessageBroker()
Returns the MessageBroker for routing messages |
void |
send(AsyncMessageCreator creator)
Sends a message created by the specified AsyncMessageCreator |
void |
send(java.lang.Object body)
Sends a message with the specified body to the default destination. |
void |
send(java.lang.String destination,
java.lang.Object body)
Sends a message with the specified body to the specified destination |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
void |
setDefaultDestination(java.lang.String defaultDestination)
Sets the id of the default message destination for this template |
void |
setMessageBroker(flex.messaging.MessageBroker messageBroker)
Sets the MessageBroker for routing messages |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageTemplate()
Method Detail |
---|
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public flex.messaging.messages.AsyncMessage createMessage()
AsyncMessage
public flex.messaging.messages.AsyncMessage createMessageForDestination(java.lang.String destination)
AsyncMessage
for a specified destination
destination
- the target destination for the message
public java.lang.String getDefaultDestination()
public flex.messaging.MessageBroker getMessageBroker()
MessageBroker
for routing messages
public void send(AsyncMessageCreator creator)
AsyncMessageCreator
creator
- the message creatorpublic void send(java.lang.Object body)
body
- the body of the messagepublic void send(java.lang.String destination, java.lang.Object body)
destination
- the target destination idbody
- the body of the messagepublic void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public void setDefaultDestination(java.lang.String defaultDestination)
defaultDestination
- the default destination idpublic void setMessageBroker(flex.messaging.MessageBroker messageBroker)
MessageBroker
for routing messages
messageBroker
- the message broker
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |