|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.context.IntegrationObjectSupport org.springframework.integration.endpoint.AbstractEndpoint org.springframework.integration.xmpp.messages.XmppMessageDrivenEndpoint
public class XmppMessageDrivenEndpoint
This component logs in as a user and forwards any messages to that
user on to downstream components. The component is an endpoint that has its
own lifecycle and does not need any poller
to work. It takes any message from a given XMPP session (as established by
the current XMPPConnection
) and forwards the
Message
as the payload of the Spring
Integration Message
. The
Chat
instance that's used is passed along as a
header (under XmppHeaders.CHAT
).
Additionally, the Message.Type
is
passed along under the header
XmppHeaders.TYPE
. Both of these
pieces of metadata can be obtained directly from the payload, if required.
They are here as a convenience.
Note: the ChatManager
maintains a Map<String, Chat> for threads and users, where the threadID
(String
) is the key or the userID String
is the key. This
Map
is a Smack-specific implementation called
org.jivesoftware.smack.util.collections.ReferenceMap
that removes
key/values as references are dereferenced. Take care to enable this garbage
collection, taking what you need from the payload and the headers and
discarding as soon as possible.
the ChatManager class that
keeps watch over all Chats between the client and any other
participants.
,
handles all interesing operations on any Spring Integration channels.
,
the XMPPConnection (as
created by {@link XmppConnectionFactory}
Constructor Summary | |
---|---|
XmppMessageDrivenEndpoint()
|
Method Summary | |
---|---|
protected void |
doStart()
Subclasses must implement this method with the start behavior. |
protected void |
doStop()
Subclasses must implement this method with the stop behavior. |
protected void |
onInit()
Subclasses may implement this for initialization logic. |
void |
setExtractPayload(boolean extractPayload)
Specify whether the text message body should be extracted when mapping to a Spring Integration Message payload. |
void |
setRequestChannel(MessageChannel requestChannel)
|
void |
setXmppConnection(org.jivesoftware.smack.XMPPConnection xmppConnection)
This will be injected or configured via a xmpp-connection-factory element. |
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint |
---|
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getChannelResolver, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, toString, writeMessageHistory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.context.Lifecycle |
---|
isRunning, start, stop |
Constructor Detail |
---|
public XmppMessageDrivenEndpoint()
Method Detail |
---|
public void setXmppConnection(org.jivesoftware.smack.XMPPConnection xmppConnection)
xmppConnection
- the connectionpublic void setRequestChannel(MessageChannel requestChannel)
requestChannel
- the channel on which the inbound message should be sentpublic void setExtractPayload(boolean extractPayload)
protected void doStart()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.
doStart
in class AbstractEndpoint
protected void doStop()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.
doStop
in class AbstractEndpoint
protected void onInit() throws Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
Exception
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |