public class Sender extends Object
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 and Description |
---|
Sender() |
Modifier and Type | Method and Description |
---|---|
static org.apache.commons.httpclient.HttpClient |
getHttpClient() |
static WfXMLMessage |
send(String wfxml,
Partner partner,
Class<?> responseListener,
Class<?> bufferListener,
boolean useBuffer) |
protected static WfXMLMessage |
send(String message,
String host,
int port,
String path)
This is a special send method which is used by the WfXML test client only.
|
static WfXMLMessage |
send(WfXMLMessage message,
Class<?> responseListener,
boolean useBuffer)
Use this method to send
NotifyMessage or PIStateChangedMessage
objects to a registered observer. |
static WfXMLMessage |
send(WfXMLMessage message,
Partner partner,
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,
Class<?> responseListener,
Class<?> bufferListener)
Use this method to send a WfXML message if you want to use a buffer listener.
|
public static WfXMLMessage send(String wfxml, Partner partner, Class<?> responseListener, Class<?> bufferListener, boolean useBuffer) throws Exception
wfxml
- partner
- responseListener
- bufferListener
- useBuffer
- Exception
public static WfXMLMessage send(WfXMLMessage message, Partner partner, Class<?> responseListener, boolean useBuffer) throws 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
).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.Exception
public static WfXMLMessage send(WfXMLMessage message, Partner partner, Class<?> responseListener, Class<?> bufferListener) throws 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)
Exception
- see send(WfXMLMessage,Partner,Class,boolean)
public static WfXMLMessage send(WfXMLMessage message, Class<?> responseListener, boolean useBuffer) throws 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
.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.Exception
protected static WfXMLMessage send(String message, String host, int port, String path) throws 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.Exception
- if any type of exception occurs.public static org.apache.commons.httpclient.HttpClient getHttpClient()
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.