Spring Web Services Framework

org.springframework.ws.transport.xmpp
Class XmppMessageSender

java.lang.Object
  extended by org.springframework.ws.transport.xmpp.XmppMessageSender
All Implemented Interfaces:
InitializingBean, WebServiceMessageSender

public class XmppMessageSender
extends Object
implements WebServiceMessageSender, InitializingBean

WebServiceMessageSender implementation that uses XMPP Messages. Requires a connectionto be set.

This message sender supports URI's of the following format:

xmpp:to
The to represents a Jabber ID.

Since:
2.0
Author:
Gildas Cuisinier, Arjen Poutsma

Field Summary
static String DEFAULT_MESSAGE_ENCODING
          Default encoding used to read from and write to Message messages.
static long DEFAULT_RECEIVE_TIMEOUT
          Default timeout for receive operations: -1 indicates a blocking receive without timeout.
 
Constructor Summary
XmppMessageSender()
           
 
Method Summary
 void afterPropertiesSet()
           
 WebServiceConnection createConnection(URI uri)
          Create a new WebServiceConnection to the specified URI.
protected  String createThread()
           
 void setConnection(org.jivesoftware.smack.XMPPConnection connection)
          Sets the XMPPConnection.
 void setMessageEncoding(String messageEncoding)
          Sets the encoding used to read from Message object.
 void setReceiveTimeout(long receiveTimeout)
          Set the timeout to use for receive calls.
 boolean supports(URI uri)
          Does this WebServiceMessageSender support the supplied URI?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RECEIVE_TIMEOUT

public static final long DEFAULT_RECEIVE_TIMEOUT
Default timeout for receive operations: -1 indicates a blocking receive without timeout.

See Also:
Constant Field Values

DEFAULT_MESSAGE_ENCODING

public static final String DEFAULT_MESSAGE_ENCODING
Default encoding used to read from and write to Message messages.

See Also:
Constant Field Values
Constructor Detail

XmppMessageSender

public XmppMessageSender()
Method Detail

setConnection

public void setConnection(org.jivesoftware.smack.XMPPConnection connection)
Sets the XMPPConnection. Setting this property is required.


setReceiveTimeout

public void setReceiveTimeout(long receiveTimeout)
Set the timeout to use for receive calls. The default is -1, which means no timeout.

See Also:
PacketCollector.nextResult(long)

setMessageEncoding

public void setMessageEncoding(String messageEncoding)
Sets the encoding used to read from Message object. Defaults to UTF-8.


afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

createConnection

public WebServiceConnection createConnection(URI uri)
                                      throws IOException
Description copied from interface: WebServiceMessageSender
Create a new WebServiceConnection to the specified URI.

Specified by:
createConnection in interface WebServiceMessageSender
Parameters:
uri - the URI to open a connection to
Returns:
the new connection
Throws:
IOException - in case of I/O errors

supports

public boolean supports(URI uri)
Description copied from interface: WebServiceMessageSender
Does this WebServiceMessageSender support the supplied URI?

Specified by:
supports in interface WebServiceMessageSender
Parameters:
uri - the URI to be checked
Returns:
true if this WebServiceMessageSender supports the supplied URI

createThread

protected String createThread()

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.