|
SonicMQ API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Channel
This interface contains methods that are implementated by all channels.
RecoverableFileChannel
Method Summary | |
---|---|
void |
close()
Close the channel. |
void |
completeConnect()
Complete the connection with the sender. |
void |
completeTransfer()
Complete the transfer of the file. |
void |
continueTransfer()
Continue the transfer of information between the sending and receiving client. |
java.lang.String |
getChannelID()
Get the channelID associated with this channel. |
ChannelStatus |
getChannelStatus()
Get the current channel status. |
int |
getFragmentSize()
Get the size of the fragments that will be sent on this channel. |
int |
getRetryCount()
Get the retry count. |
long |
getRetryInterval()
Get retry interval. |
long |
getTimeout()
Get the timeout time of the channel. |
int |
getWindowSize()
Get the window size for the transfer. |
void |
setChannelListener(ChannelListener listener)
Set a channel listener on the channel. |
void |
setFragmentSize(int size)
Set the fragment size for the transfer. |
void |
setRetryCount(int count)
Set the retry count. |
void |
setRetryInterval(long milliseconds)
Set retry interval. |
void |
setTimeout(long milliseconds)
Set the timeout time of this channel. |
void |
setUUID(java.lang.String uuid,
int timeToLive)
Set the duplicate detection universal unique id. |
void |
setWindowSize(int size)
Set the window size for the transfer. |
Method Detail |
---|
java.lang.String getChannelID()
Every channel has a unique channelID that is assigned to it when established. This channelID is used for internal purposes; however, this channelID is accessible by the user to assist in associating information with a given channelID. ChannelID's are available across failures and are guaranteed to be unique across all the brokers within a Dynamic Routing setup.
The channelID will be null until after the channel has been sent, or until after getChannel() has been called on the receiver.
void setTimeout(long milliseconds) throws JMSException
This method will set the amount of time a send()
call will wait for a channel to be established before throwing
an exception.
milliseconds
- The amount of time to wait for a channel to be
established before timing out.
JMSException
- If there is an internal JMS ErrorQueueSender.send( javax.jms.Message )
long getTimeout() throws JMSException
JMSException
- If there is an internal JMS errorvoid setRetryCount(int count) throws JMSException
This method will set the number of times a piece of information will attempt to be sent before timing out.
count
- The number of times to retry.
JMSException
- If there is an internal JMS error.int getRetryCount() throws JMSException
This method will retrieve the number of times this channel will retry sending a fragment of information.
JMSException
- If there is an internal JMS Errorvoid setRetryInterval(long milliseconds) throws JMSException
This will set the amount of time to wait before attempting to retrying to send or receive a piece of information.
milliseconds
- The amount of time, in milliseconds, to wait
before trying to resend.
JMSException
- If there is an internal JMS error.long getRetryInterval() throws JMSException
This will get the amount of time to wait before attempting to resend a piece of information.
JMSException
- If there is an internal JMS error.void setWindowSize(int size) throws JMSException
This method will set the number of fragments the channel will buffer before it will block sending, awaiting an internal acknowledgement from the receiving client.
The "size" parameter must be 3 or greater.
size
- The number of fragments to buffer
JMSException
- If you attempt to set the window size after
a channel has been established, or there is an internal JMS Error.int getWindowSize() throws JMSException
This method will get the number of fragments the channel will buffer before it will block sending, awaiting an internal acknowledgement from the receiving client.
JMSException
- If there is an internal JMS Error.void setFragmentSize(int size) throws JMSException
This method will set the size for the fragments that will be sent on this channel.
size
- The size, in bytes, of the fragments
JMSException
- If you attempt to set the window size after
a channel has been established, or there is an internal JMS Error.int getFragmentSize() throws JMSException
This method will get the size of the fragments being sent on this channel.
JMSException
- If there is an internal JMS Error.void continueTransfer() throws JMSException
This method is used in two places. It is used on recovery to restart sending information to the other side of the channel transfer. It also can be used in the ChannelListener callback to continue attempting to retransmit or receive fragments after a RETRY_TIMEOUT has occurred.
JMSException
- If there is an internal JMS Error.void completeConnect() throws JMSException, IllegalStateException
This method is used by a channel receiver to start transferring information between the sender and receiver.
JMSException
- If there is an internal JMS Error.
IllegalStateException
- If called on the sender.ChannelStatus getChannelStatus() throws JMSException
This method will return a ChannelStatus object that can be queried to determine the current status of the channel.
JMSException
- If there is an internal JMS Errorvoid setChannelListener(ChannelListener listener) throws JMSException
This method sets a callback that will be called whenever there is a status update or problem with a channel transfer.
JMSException
- If there is an internal JMS Error.void close() throws JMSException, IllegalStateException
JMSException
- If there is an internal JMS Error
IllegalStateException
- If the channel is already closed.void setUUID(java.lang.String uuid, int timeToLive) throws JMSException
This method will activate duplicate detection for the channel. If another channel is sent with the same UUID, an exception can occur.
uuid
- The universally unique id.timeToLive
- The time to live for this UUID before another channel can take over.
JMSException
- If there is an internal JMS Error.void completeTransfer() throws JMSException, IllegalStateException
This method can only be called from the ChannelListener after a transfer has been completed. Once completeTransfer() has been called, the ChannelListener will not be notified again.
JMSException
- If there is an internal JMS Error.
IllegalStateException
- If called before the channel transfer is complete, or outside the channel listener callback.
|
SonicMQ API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |