|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.wfxml.Sender
public class Sender
Use this class to send a message to a partner. There are four
different send methods:
send(WfXMLMessage,Partner,Class,boolean): This is
the standard send method that will be used in most cases. You can specify
the communication partner, an optional response listener, and you can
decide if you want to use the outgoing buffer or not.send(WfXMLMessage,Partner,Class,Class): Use this method if
you want to send a message to a partner and if you want to use a buffer
listener. With a buffer listener, you can take control over messages that
are stored in the outgoing buffer before they are actually sent. See the
BufferListener interface for more details about buffer listeners.send(WfXMLMessage,Class,boolean): This send method
should be only used to send NotifyMessage and
PIStateChangedMessage messages. You don't need to specify a partner,
because these messages will automatically be sent to process instance
observers.send(String,Partner,Class,Class,boolean): This method is
similar to the first method and is used internally. Normally there should
be no case in which you would use this method for sending a message.
| Constructor Summary | |
|---|---|
Sender()
|
|
| Method Summary | |
|---|---|
static WfXMLMessage |
send(java.lang.String wfxml,
Partner partner,
java.lang.Class responseListener,
java.lang.Class bufferListener,
boolean useBuffer)
This method sends a message (String-representation) to a communication partner. |
protected static WfXMLMessage |
send(java.lang.String message,
java.lang.String host,
int port,
java.lang.String path)
This is a special send method which is used by the WfXML test client only. |
static WfXMLMessage |
send(WfXMLMessage message,
java.lang.Class responseListener,
boolean useBuffer)
Use this method to send NotifyMessage or PIStateChangedMessage
objects to a registered observer. |
static WfXMLMessage |
send(WfXMLMessage message,
Partner partner,
java.lang.Class responseListener,
boolean useBuffer)
Use this method to send a WfXMLMessage message to a communication
partner, after you created the message. |
static WfXMLMessage |
send(WfXMLMessage message,
Partner partner,
java.lang.Class responseListener,
java.lang.Class bufferListener)
Use this method to send a WfXML message if you want to use a buffer listener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Sender()
| Method Detail |
|---|
public static WfXMLMessage send(java.lang.String wfxml,
Partner partner,
java.lang.Class responseListener,
java.lang.Class bufferListener,
boolean useBuffer)
throws java.lang.Exception
send(WfXMLMessage,Partner,Class,boolean) method for sending
messages.
wfxml - A String containing the message that will be sent.partner - The communication partner to which the message will be sent.responseListener - A response listener. See send(WfXMLMessage,Partner,Class,boolean)
for more details.bufferListener - A buffer listener. See the BufferListener interface
for more details about buffer listeners.useBuffer - Defines if an outgoing buffer will be used (if necessary) or not.
See send(WfXMLMessage,Partner,Class,boolean) for more details.
WfXMLMessage object containing the answer returned from the
partner server, or null if one of the following occurs:
ResponseListener.useBuffer is set to true.ApplicationException - if sending the message fails and the message is
not stored in the outgoing buffer (because maybe you set useBuffer
to false, or there are problems with the buffer). An ApplicationException
is also thrown if the local server doesn't have WfXML enabled. So, if this
message is thrown, you can be sure, that the message was not sent and will
not be sent.
WfXMLMessageException - if the response message is invalid and cannot
be used, or if storing a message in the outgoing buffer failed (in case that
the local server is passive or immediate sending was not possible).
java.lang.Exception
public static WfXMLMessage send(WfXMLMessage message,
Partner partner,
java.lang.Class responseListener,
boolean useBuffer)
throws java.lang.Exception
WfXMLMessage message to a communication
partner, after you created the message. You can use this method with passive
and active local servers. In case the local server is active, the method will
try to send the message immediately. If the local server is passive, the message
will be stored in a buffer, where the partner will get it from.useBuffer parameter defines, if
the message will be stored for later sending, in case that immediate sending
is not possible (due to server/network problems or whatever).
message - WfXMLMessage object containing the message that will
be sent.partner - The communication partner to which the message will be sent.responseListener - A class implementing the ResponseListener
interface. This is useful when the message cannot be sent immediately. On
a passive server you should always provide a response listener. On an active
server it depends on whether you use buffering (useBuffer
parameter) or not.useBuffer - Set this value to true if you want that the message
will be sent later, if sending now is not possible. For that case you should
also provide a response listener (but it is not obligatory!). Set the value
to false if you want that the message is sent now or never. In
that case you shouldn't set a response listener, because it doesn't make any
sense and it will never be used.WfXMLMessage object containing the answer returned from the
partner server, or null if one of the following occurs:
ResponseListener.useBuffer is set to true).ApplicationException - if sending the message fails and the message is
not stored in the outgoing buffer (because maybe you set useBuffer
to false, or there are problems with the buffer). So, if this
message is thrown, you can be sure, that the message was not sent and will
not be sent.
WfXMLMessageException - if the response message is invalid and cannot
be used.
java.lang.Exception
public static WfXMLMessage send(WfXMLMessage message,
Partner partner,
java.lang.Class responseListener,
java.lang.Class bufferListener)
throws java.lang.Exception
BufferListener for more details about buffer listeners. If you call
this method and set a buffer listener, the message will automatically be sent
with buffering enabled (so, on active servers the buffer will be used in case
that it is necessary).
message - A WfXMLMessage object that you want to send.partner - The target Partner to which you want the message to be sent.responseListener - see send(WfXMLMessage,Partner,Class,boolean)bufferListener - A class implementing the BufferListener interface. This
class will be used as buffer listener for this message, in case that immediate
sending is not possible.
send(WfXMLMessage,Partner,Class,boolean)
java.lang.Exception - see send(WfXMLMessage,Partner,Class,boolean)
public static WfXMLMessage send(WfXMLMessage message,
java.lang.Class responseListener,
boolean useBuffer)
throws java.lang.Exception
NotifyMessage or PIStateChangedMessage
objects to a registered observer. You don't need to provide the target
communication partner here, because the WfXML layer knows if there is a
observer and where it is located. If there is no observer to which the message
could be sent, you will receive a simple null as answer (because
this is no error).
message - WfXMLMessage object containing the message that will
be sent. When you use this method for sending, the message should be a
message type that is sent to observers (NotifyMessage or
PIStateChangedMessage).responseListener - A class implementing the ResponseListener
interface. This is useful when the message cannot be sent immediately. On
a passive server you should always provide a response listener. On an active
server it depends on whether you use buffering (useBuffer
parameter) or not.useBuffer - Set this value to true if you want that the message
will be sent later, if sending now is not possible. For that case you should
also provide a response listener (but it is not obligatory!). Set the value
to false if you want that the message is sent now or never. In
that case you shouldn't set a response listener, because it doesn't make any
sense and it will never be used.WfXMLMessage object containing the answer returned from the
partner server, or null if one of the following occurs:
ResponseListener.useBuffer is set to true.ApplicationException - if sending the message fails and the message is
not stored in the outgoing buffer (because maybe you set useBuffer
to false, or there are problems with the buffer). So, if this
message is thrown, you can be sure, that the message was not sent and will
not be sent.
WfXMLMessageException - if the response message is invalid and cannot
be used.
java.lang.Exception
protected static WfXMLMessage send(java.lang.String message,
java.lang.String host,
int port,
java.lang.String path)
throws java.lang.Exception
null.
If any communication errors occur (socket, etc.), an exception is directly
thrown.
message - The message as String.host - Hostname of the host to which the message has to be sent.port - Port of the host to which the message has to be sent.path - The path (context root) that will be written in the POST request
that will be sent to the specified host.
java.lang.Exception - if any type of exception occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||