Configuration Platform SDK 7.6 API Reference

com.genesyslab.platform.commons.protocol
Class ServerChannel

java.lang.Object
  extended bycom.genesyslab.platform.commons.protocol.AbstractChannel
      extended bycom.genesyslab.platform.commons.protocol.ServerChannel
All Implemented Interfaces:
AsyncChannel, AsyncInvokerSupport, Channel, ChannelListenerSupport, ConfigurationSupport, ConnectionInvokerSupport, EndpointSupport, OutputChannel, ProtocolDescriptionSupport, Receiver, ReceiverManagement, RequestReceiver, RequestReceiverManagement, ResponseChannel

public class ServerChannel
extends AbstractChannel
implements OutputChannel, ResponseChannel, RequestReceiver, EndpointSupport, ConfigurationSupport, ProtocolDescriptionSupport, RequestReceiverManagement

This channel accepts connection on some Endpoint. Method addChannelListener accepts ServerChannelListener, which defines on additional method. When connection is established onClientChannelOpened method is notified.


Field Summary
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Channel
DEFAULT_TIMEOUT, INFINITE_TIMEOUT
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Receiver
DEF_INPUT_SIZE
 
Constructor Summary
ServerChannel(Endpoint endpoint, long timeout, ProtocolFactory protocolFactory)
           
ServerChannel(Endpoint endpoint, ProtocolFactory protocolFactory)
           
 
Method Summary
 void beginClose()
          Method is asynchronous.
 void beginOpen()
          Method is asynchronous.
 void clearInput()
          Clears input of the receiver.
 void close()
           
 void close(long timeout)
           
 void closeClientChannels()
           
 void configure(ConnectionConfiguration config)
          Set Configuration for all new channels.
 java.util.Collection getChannels()
           
 int getInputSize()
          Return the amount of messages this Receiver can hold before start to "forget stale messages"
 ProtocolDescription getProtocolDescription()
           
 void open()
           
 void open(long timeout)
           
 Message receive()
           
 Message receive(long timeout)
           
 RequestContext receiveRequest()
          Receive request from the client.
 RequestContext receiveRequest(long timeout)
          Receive request from the client.
 void releaseReceivers()
          Notify receivers (threads waiting on receive() methods) they should stop waiting and return null.
 void resetReceiver()
           
 void send(Message message)
          Send message to remote party.
 void sendToChannelsExcept(Message message, OutputChannel except)
          Send message to all channels except the one.
 void setInputSize(int inputSize)
          Set the amount of messages this Receiver can hold before start to "forget stale messages"
 void setReceiver(RequestReceiverSupport receiver)
           
 
Methods inherited from class com.genesyslab.platform.commons.protocol.AbstractChannel
addChannelListener, getConfiguration, getEndpoint, getState, getTimeout, removeChannelListener, setConnectionInvoker, setEndpoint, setInvoker, setTimeout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Channel
getTimeout, setTimeout
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.AsyncChannel
getState
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ChannelListenerSupport
addChannelListener, removeChannelListener
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.EndpointSupport
getEndpoint, setEndpoint
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ConfigurationSupport
getConfiguration
 

Constructor Detail

ServerChannel

public ServerChannel(Endpoint endpoint,
                     ProtocolFactory protocolFactory)

ServerChannel

public ServerChannel(Endpoint endpoint,
                     long timeout,
                     ProtocolFactory protocolFactory)
Method Detail

open

public void open()
          throws ProtocolException,
                 java.lang.InterruptedException,
                 java.lang.IllegalStateException
Specified by:
open in interface Channel
Throws:
ProtocolException
java.lang.InterruptedException
java.lang.IllegalStateException

open

public void open(long timeout)
          throws ProtocolException,
                 java.lang.InterruptedException,
                 java.lang.IllegalStateException
Specified by:
open in interface Channel
Throws:
ProtocolException
java.lang.InterruptedException
java.lang.IllegalStateException

close

public void close()
           throws ProtocolException,
                  java.lang.InterruptedException,
                  java.lang.IllegalStateException
Specified by:
close in interface Channel
Throws:
ProtocolException
java.lang.InterruptedException
java.lang.IllegalStateException

close

public void close(long timeout)
           throws ProtocolException,
                  java.lang.InterruptedException,
                  java.lang.IllegalStateException
Specified by:
close in interface Channel
Throws:
ProtocolException
java.lang.InterruptedException
java.lang.IllegalStateException

closeClientChannels

public void closeClientChannels()
                         throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

send

public void send(Message message)
          throws ProtocolException
Description copied from interface: OutputChannel
Send message to remote party. This method is usually asynchronous, so not every problem that occures during send operation is thrown as exception. Detected problem may lead to error handler execution or even connection termination.

Specified by:
send in interface OutputChannel
Parameters:
message - Message to send
Throws:
ProtocolException - some generic problems

sendToChannelsExcept

public void sendToChannelsExcept(Message message,
                                 OutputChannel except)
                          throws ProtocolException
Send message to all channels except the one.

Parameters:
message - Message to send
except - channel to miss from sending
Throws:
ProtocolException - if exception occured during sending

beginOpen

public void beginOpen()
               throws ProtocolException
Description copied from interface: AsyncChannel
Method is asynchronous. It will start connection sequence and return. Whether connection is established on return is not specified.

Specified by:
beginOpen in interface AsyncChannel
Throws:
ProtocolException - in case of problems establishing connection

beginClose

public void beginClose()
Description copied from interface: AsyncChannel
Method is asynchronous. It will start disconnection and return. Whether connection is closed on return is not specified.

Specified by:
beginClose in interface AsyncChannel

receiveRequest

public RequestContext receiveRequest()
                              throws java.lang.InterruptedException
Description copied from interface: RequestReceiver
Receive request from the client. Depending on implementation this method will or won't block for some or infinite time.

Specified by:
receiveRequest in interface ResponseChannel
Throws:
java.lang.InterruptedException

receiveRequest

public RequestContext receiveRequest(long timeout)
                              throws java.lang.InterruptedException
Description copied from interface: RequestReceiver
Receive request from the client. Depending on timeout value this method will or won't block for some time. See Channel description for timeout values meaning.

Specified by:
receiveRequest in interface ResponseChannel
Throws:
java.lang.InterruptedException

getChannels

public java.util.Collection getChannels()

getProtocolDescription

public ProtocolDescription getProtocolDescription()
Specified by:
getProtocolDescription in interface ProtocolDescriptionSupport

receive

public Message receive()
                throws java.lang.InterruptedException,
                       java.lang.IllegalStateException
Throws:
java.lang.InterruptedException
java.lang.IllegalStateException

receive

public Message receive(long timeout)
                throws java.lang.InterruptedException,
                       java.lang.IllegalStateException
Throws:
java.lang.InterruptedException
java.lang.IllegalStateException

clearInput

public void clearInput()
Description copied from interface: Receiver
Clears input of the receiver. Please note, that there is no strict guaranties that input will be empty after this method has returned, the messages could be delivered by another thread.

Specified by:
clearInput in interface Receiver

getInputSize

public int getInputSize()
Description copied from interface: Receiver
Return the amount of messages this Receiver can hold before start to "forget stale messages"

Specified by:
getInputSize in interface Receiver
Returns:
maximum count of messages stored in receiver

setInputSize

public void setInputSize(int inputSize)
Description copied from interface: Receiver
Set the amount of messages this Receiver can hold before start to "forget stale messages"

Specified by:
setInputSize in interface Receiver
Parameters:
inputSize - maximum count of messages stored in receiver

releaseReceivers

public void releaseReceivers()
Description copied from interface: Receiver
Notify receivers (threads waiting on receive() methods) they should stop waiting and return null.

Specified by:
releaseReceivers in interface Receiver

configure

public void configure(ConnectionConfiguration config)
Set Configuration for all new channels. Please note, that clien channels that were created before calling this method are not affected by this call. Also note, that configuration can be modified to be passive (in case of ADDP it wan't send init request, but waits for remote side), so ConnectionConfiguration object returned from getConfiguration() method can be different

Specified by:
configure in interface ConfigurationSupport
Overrides:
configure in class AbstractChannel
Parameters:
config - connection configuration object

setReceiver

public void setReceiver(RequestReceiverSupport receiver)
Specified by:
setReceiver in interface RequestReceiverManagement

resetReceiver

public void resetReceiver()
Specified by:
resetReceiver in interface ReceiverManagement

Configuration Platform SDK 7.6 API Reference

Send comments on this topic.
Copyright © 2006–2008 Genesys Telecommunication Laboratories, Inc. All rights reserved.