|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RequestChannel
Field Summary |
---|
Fields inherited from interface com.genesyslab.platform.commons.protocol.Channel |
---|
DEFAULT_TIMEOUT, INFINITE_TIMEOUT |
Method Summary | ||
---|---|---|
RequestFuture |
beginRequest(Message message)
Starts request and exits. |
|
Message |
endRequest(RequestFuture future)
Tries to finish request started with beginRequest() . |
|
Message |
endRequest(RequestFuture future,
long timeout)
Tries to finish request started with beginRequest() . |
|
boolean |
getCopyResponse()
Is response to request() copied to receive queue. |
|
Message |
request(Message message)
Sends the message and waitResponse for response. |
|
Message |
request(Message message,
long timeout)
Sends the message and waitResponse for response or while specified timeout is elapsed. |
|
|
requestAsync(Message message,
A attachment,
CompletionHandler<Message,? super A> handler)
Starts request and exits. |
|
|
requestAsync(Message message,
A attachment,
CompletionHandler<Message,? super A> handler,
long timeout)
Starts request and exits. |
|
void |
setCopyResponse(boolean copyResponse)
Is response to request() copied to receive queue. |
Methods inherited from interface com.genesyslab.platform.commons.protocol.Channel |
---|
close, close, getTimeout, open, open, setTimeout |
Methods inherited from interface com.genesyslab.platform.commons.protocol.AsyncChannel |
---|
beginClose, beginOpen, getState |
Methods inherited from interface com.genesyslab.platform.commons.protocol.ChannelListenerSupport |
---|
addChannelListener, removeChannelListener |
Method Detail |
---|
Message request(Message message) throws ProtocolException, java.lang.IllegalStateException
message
- Message to send
java.lang.NullPointerException
- if request message is null
java.lang.IllegalStateException
- if channel is not in an appropriate state
(e.g. closed)
ProtocolException
- if some protocol problems occurredrequest(Message, long)
Message request(Message message, long timeout) throws ProtocolException, java.lang.IllegalStateException
message
- Message to sendtimeout
- timeout in ms
java.lang.NullPointerException
- if request message is null
java.lang.IllegalStateException
- if channel is not in an appropriate state
(e.g. closed)
ProtocolException
- if some protocol problems occurredRequestFuture beginRequest(Message message) throws ProtocolException, java.lang.IllegalStateException
endRequest(RequestFuture)
method.
message
- message to request with
java.lang.NullPointerException
- if request message is null
java.lang.IllegalStateException
- if channel is in inappropriate state to
execute the request
ProtocolException
- if sending of the request failsChannel.setTimeout(long)
,
requestAsync(Message, Object, CompletionHandler)
,
endRequest(RequestFuture)
<A> void requestAsync(Message message, A attachment, CompletionHandler<Message,? super A> handler) throws ProtocolException, java.lang.IllegalStateException
A
- user callback attachment parameter typemessage
- message to request withattachment
- user defined parameter for the "callback"handler
- user defined "callback" interface for notification
about server response
java.lang.NullPointerException
- if request message is null
java.lang.IllegalArgumentException
- if callback is not null,
but protocol has no positive timeout set
java.lang.IllegalStateException
- if channel is in inappropriate state to
execute the request
ProtocolException
- if sending of the request failsChannel.setTimeout(long)
,
requestAsync(Message, Object, CompletionHandler, long)
<A> void requestAsync(Message message, A attachment, CompletionHandler<Message,? super A> handler, long timeout) throws ProtocolException, java.lang.IllegalStateException
Message request = ...;
ReqContext ctx = ...;
CompletionHandler<Message, ReqContext> rqCallback =
new CompletionHandler<Message, ReqContext>() {
public void completed(
final Message response,
final ReqContext ctx) {
// handle the response
}
public void failed(
final Throwable throwable,
final ReqContext ctx) {
// handle the request failure
}
};
protocol.requestAsync(request, ctx, rqCallback, timeout);
A
- user callback attachment parameter typemessage
- message to request withattachment
- user defined parameter for the "callback"handler
- user defined "callback" interface for notification
about server responsetimeout
- timeout waiting for server response before request invalidation
java.lang.NullPointerException
- if request message is null
java.lang.IllegalArgumentException
- if callback is not null,
but provided timeout is not positive value
java.lang.IllegalStateException
- if channel is in inappropriate state to
execute the request
ProtocolException
- if sending of the request failsMessage endRequest(RequestFuture future) throws ProtocolException
beginRequest()
.
future
- future object obtained from beginRequest()
ProtocolException
- if there are protocol related problemsbeginRequest(Message)
Message endRequest(RequestFuture future, long timeout) throws ProtocolException
beginRequest()
.
future
- future object obtained from beginRequest()
timeout
- timeout to waitResponse for response
ProtocolException
- if there are protocol related problemsbeginRequest(Message)
boolean getCopyResponse()
request()
copied to receive queue.
void setCopyResponse(boolean copyResponse)
request()
copied to receive queue.
copyResponse
- true if response goes to receive queue
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |