|
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 Channel
Communication channel with synchronous opening and closing. It will waitResponse for some time for connection state change in its sync methods.
Timeout can be set to following values:
Field Summary | |
---|---|
static long |
DEFAULT_TIMEOUT
|
static long |
INFINITE_TIMEOUT
|
Method Summary | |
---|---|
void |
close()
Closes channel synchronously. |
void |
close(long timeout)
Closes channel synchronously with given timeout. |
long |
getTimeout()
Returns default timeout for synchronous operations on channel. |
void |
open()
Opens the channel by opening underlying connection including protocol specific handshake procedure. This method will block until connection is opened or detects an error condition, possibly forever. |
void |
open(long timeout)
Opens the channel by opening underlying connection including protocol specific handshake procedure using specified protocol timeout value. Timeout can be set to following values: positive value - time in ms. |
void |
setTimeout(long timeout)
Sets default timeout for synchronous operations on channel. |
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 |
Field Detail |
---|
static final long INFINITE_TIMEOUT
static final long DEFAULT_TIMEOUT
Method Detail |
---|
void open() throws RegistrationException, ProtocolException, java.lang.IllegalStateException, java.lang.InterruptedException
open(long)
method to use custom timeout
or change the protocol timeout value with setTimeout(long)
before opening.
RegistrationException
- if there is an error related to registration procedure
like server error about wrong client name, user password, etc
ProtocolException
- if there is any problem related to the connection open
java.lang.IllegalStateException
- if channel is not in Closed
state.
Actually, in current Platform SDK implementation, the ChannelNotClosedException
which is subclass of IllegalStateException
can be thrown.
java.lang.InterruptedException
setTimeout(long)
,
open(long)
void close() throws ProtocolException, java.lang.IllegalStateException, java.lang.InterruptedException
java.lang.InterruptedException
- in case the close operation was interrupted.
ProtocolException
- if there is any problem related to the connection close
java.lang.IllegalStateException
- exception will not be thrown in current implementation.void open(long timeout) throws RegistrationException, ProtocolException, java.lang.IllegalStateException, java.lang.InterruptedException
timeout
- time to waitResponse for the connection
RegistrationException
- if there is an error related to registration procedure
like server error about wrong client name, user password, etc
ProtocolException
- if there is any problem related to the connection open
java.lang.IllegalStateException
- if channel is not in Closed
state
java.lang.InterruptedException
open()
void close(long timeout) throws ProtocolException, java.lang.IllegalStateException, java.lang.InterruptedException
java.lang.InterruptedException
- in case the close operation was interrupted.
ProtocolException
- if there is any problem related to the connection close
java.lang.IllegalStateException
- exception will not be thrown in current implementation.void setTimeout(long timeout)
timeout
- timeout in millisecondslong getTimeout()
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |