|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aselect.system.communication.server.Communicator
public class Communicator
Defines a communicator which can be used with A-Select.
Description:
Defines a communicator which can be used with A-Select. An inputmessage is
normally created from an inputstream. Interfaces to IInputMessageand
IOutputMessagecan be obtained by the get methods.
Note: The Communicator is part of the "Builder" design pattern that is
used in the design of the A-Select server communication package. It can be
seen as the director of this pattern. The init method can be seen as the
construct method of the director. The message creator is the actual abstract
builder and the setParam() method can be seen as a build part method of the
Builder. To protect the functionality of the builder, the builder is divided
into several interfaces like IInputMessage, IOutputMessage, and
IMessageCreatorInterface.
Concurrency issues:
The used IMessageCreatorInterface can be a non threadsafe
implementation.
It is recommended to use one Communicator per communication
flow.
| Constructor Summary | |
|---|---|
Communicator(IMessageCreatorInterface oCreator)
Creates a new instance of Communicator. |
|
| Method Summary | |
|---|---|
IInputMessage |
getInputMessage()
Get input message. |
IOutputMessage |
getOutputMessage()
Get output message. |
boolean |
init(IProtocolRequest oRequest,
IProtocolResponse oResponse)
Initializes the Communicator. |
boolean |
send()
Sends the output message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Communicator(IMessageCreatorInterface oCreator)
IMessageCreatorInterface implementation. oCreator should be used in one
Communicator.oCreator must be an uninitialized
IMessageCreatorInterface implementation which is only used
in this instance. oCreator.
oCreator - The creator to be used to create messages.| Method Detail |
|---|
public boolean init(IProtocolRequest oRequest,
IProtocolResponse oResponse)
throws ASelectCommunicationException
IMessageCreatorInterface
implementation.
oRequest - The request to create the input message from.oResponse - The response to write the output message to.
ASelectCommunicationException - If communication fails.IMessageCreatorInterface.init(IProtocolRequest, IProtocolResponse)public IInputMessage getInputMessage()
IInputMessage can be a non threadsafe
implementation. Communicator must be initialized.
public IOutputMessage getOutputMessage()
IOutputMessage can be a non threadsafe
implementation. Communicator must be initialized.
public boolean send()
throws ASelectCommunicationException
send of the used
IMessageCreatorInterface implementation.
ASelectCommunicationException - If communciation fails.IOutputMessage.send()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||