com.genesyslab.platform.commons.protocol
Class ClientChannel
java.lang.Object
com.genesyslab.platform.commons.protocol.AbstractChannel
com.genesyslab.platform.commons.protocol.DuplexChannel
com.genesyslab.platform.commons.protocol.ClientChannel
- All Implemented Interfaces:
- AsyncChannel, AsyncInvokerSupport, Channel, ChannelListenerSupport, ConfigurationSupport, ConnectionInvokerSupport, EndpointSupport, InputChannel, InterceptorSupport, MessageReceiver, MessageReceiverManagement, OutputChannel, Protocol, ProtocolDescriptionSupport, Receiver, ReceiverManagement, RequestChannel
- Direct Known Subclasses:
- ConfServerProtocol
- public class ClientChannel
- extends DuplexChannel
- implements Protocol
ClientChannel
is the parent class of all of the
Protocol
classes used for client applications
in the Platform SDK, such as TServerProtocol
and
ConfServerProtocol
.
For Genesys internal use only.
Methods inherited from class com.genesyslab.platform.commons.protocol.DuplexChannel |
beginClose, beginOpen, clearInput, close, close, getInputSize, getInterceptor, getProtocolDescription, open, open, receive, receive, releaseReceivers, resetReceiver, send, setConnectionInvoker, setInputSize, setReceiver, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.genesyslab.platform.commons.protocol.OutputChannel |
send |
ClientChannel
public ClientChannel(Endpoint endpoint,
ProtocolFactory protocolFactory,
ReferenceBuilder refBuilder,
long timeout)
ClientChannel
public ClientChannel(Endpoint endpoint,
ProtocolFactory protocolFactory,
ReferenceBuilder refBuilder)
request
public Message request(Message message)
throws ProtocolException,
java.lang.IllegalStateException
- This synchronous method sends the specified request to the server, and
waits for a response from the server for the length of the
timeout
property.
Here is a sample of how to use the request()
method.
Message response =
interactionServerProtocol.request(requestAgentLogin);
Time to waitResponse is set during channel creation or by
setTimeout()
method. Only referenceable
messages can be awaited, so if message doesn't support referencing
this method returns null immediately.
- Specified by:
request
in interface RequestChannel
- Parameters:
message
- The request to be sent to the server
- Returns:
- Response message or null if no response implied.
- Throws:
ProtocolException
- protocol detected problems
java.lang.IllegalStateException
- channel is not in appropriate state for
requesting (not Opened)
request
public Message request(Message message,
long timeout)
throws ProtocolException,
java.lang.IllegalStateException
- This synchronous method sends the specified request to the server
and waits for a response from the server for the length of the specified
timeout
value. See request(Message)
.
- Specified by:
request
in interface RequestChannel
- Parameters:
message
- The request to be sent to the servertimeout
- Time to waitResponse for responce
- Returns:
- Response message or null if no response implied
or responce is timed out
- Throws:
ProtocolException
- protocol detected problems
java.lang.IllegalStateException
- channel is not in appropriate state for
requesting (not Opened)
beginRequest
public RequestFuture beginRequest(Message message)
throws ProtocolException,
java.lang.IllegalStateException
- Start request and exit. To waitResponse for request result you can use either
returned RequestFuture or
endRequest(RequestFuture)
method.
- Specified by:
beginRequest
in interface RequestChannel
- Parameters:
message
- message to request with
- Returns:
- future object which allow to get result of the request
- Throws:
ProtocolException
- if sending of the request fails
java.lang.IllegalStateException
- if channel is in inapropriate state to
execute the request- See Also:
request(Message)
endRequest
public Message endRequest(RequestFuture future)
throws ProtocolException
- Try to finnish request started with
beginRequest(Message)
- Specified by:
endRequest
in interface RequestChannel
- Parameters:
future
- future object obtained from beginRequest(Message)
- Returns:
- message if request is successful
or null if there were no response
- Throws:
ProtocolException
- if there are protocol related problems- See Also:
request(Message)
endRequest
public Message endRequest(RequestFuture future,
long timeout)
throws ProtocolException
- Try to finnish request started with
beginRequest(Message)
- Specified by:
endRequest
in interface RequestChannel
- Parameters:
future
- future object obtained from beginRequest(Message)
timeout
- timeout to waitResponse for response
- Returns:
- message if request is successful
or null if there were no response
- Throws:
ProtocolException
- if there are protocol related problems- See Also:
request(Message, long)
getCopyResponse
public boolean getCopyResponse()
- Description copied from interface:
RequestChannel
- Is responce to request() copied to receive queue.
- Specified by:
getCopyResponse
in interface RequestChannel
- Returns:
- true if responce goes to recieve queue
setCopyResponse
public void setCopyResponse(boolean copyResponse)
- Description copied from interface:
RequestChannel
- Is responce to request() copied to receive queue.
- Specified by:
setCopyResponse
in interface RequestChannel
- Parameters:
copyResponse
- true if responce goes to recieve queue
getReferenceBuilder
public ReferenceBuilder getReferenceBuilder()
- Specified by:
getReferenceBuilder
in interface Protocol
Send comments on this topic.
Copyright © 2006–2008 Genesys Telecommunication Laboratories, Inc. All rights reserved.