org.openorb.iiop
Class IIOPServerChannel

java.lang.Object
  |
  +--org.openorb.iiop.IIOPServerChannel
All Implemented Interfaces:
Channel, ServerChannel

public class IIOPServerChannel
extends java.lang.Object
implements ServerChannel

IIOP implementation of ServerChannel

Version:
$Revision: 1.22 $ $Date: 2002/09/26 08:16:46 $
Author:
Chris Wood

Field Summary
static int CONN_SC_BIDIR
           
static int CONN_SC_CODESETS
           
static int CONN_SC_TOTAL
           
 
Fields inherited from interface org.openorb.net.ServerChannel
STATE_CLOSED, STATE_CONNECTED
 
Constructor Summary
IIOPServerChannel(ServerManager serverManager, IIOPClientChannel peer, Codec codec)
          Constructor for bidir delegates.
IIOPServerChannel(ServerManager serverManager, Transport transport, IIOPClientProtocol clientProtocol, Codec codec)
          Creates new IIOPServerChannel
 
Method Summary
 int active_requests()
          Active request count.
 int channel_age()
          Indication of channel age.
 void checkBiDirActivation(IIOPServerRequest request)
          Completes the bidir activation.
 void close()
          Close the connection.
 java.util.Map getActiveRequestMap()
          Return the array with active requests.
 int getChannelAge()
          Return the age of the channel.
 ServerManager getServerManager()
          Return the server manager of this channel.
 SocketQueue getSocketQueue()
          Return the socket queue.
 java.lang.Object getSyncState()
          Return the synchronization state of the client channel.
 int getTCSC()
          returns the selected char codeset.
 int getTCSW()
          Returns the selected wide char codeset.
 ORB orb()
          Return the orb instance.
 boolean recv(int timeout)
          Wait the specified amount of time for an incoming message.
 void run_recv()
          Donate a thread for recieving messages.
 void setClientPeer(IIOPClientChannel cltchan)
          Set this server's peer, which is usually the client.
 void setPendingClose()
          Set the channel to a closing state..
 void setState(int state)
          Sets the state of the channel.
 void setTCSC(int tcsc)
          Sets the selected char codeset.
 void setTCSW(int tcsw)
          Sets the selected wide char codeset.
 void soft_close(boolean ifActive)
          Close the connection after all currently processing requests are complete.
 int state()
          Return the state of the channel.
 java.lang.String toString()
          Creates a stringified representation of this class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONN_SC_TOTAL

public static final int CONN_SC_TOTAL

CONN_SC_CODESETS

public static final int CONN_SC_CODESETS

CONN_SC_BIDIR

public static final int CONN_SC_BIDIR
Constructor Detail

IIOPServerChannel

public IIOPServerChannel(ServerManager serverManager,
                         Transport transport,
                         IIOPClientProtocol clientProtocol,
                         Codec codec)
Creates new IIOPServerChannel

IIOPServerChannel

public IIOPServerChannel(ServerManager serverManager,
                         IIOPClientChannel peer,
                         Codec codec)
Constructor for bidir delegates.
Method Detail

getActiveRequestMap

public java.util.Map getActiveRequestMap()
Return the array with active requests.
Returns:
The active requests.

getSocketQueue

public SocketQueue getSocketQueue()
Return the socket queue.
Returns:
The socket queue.

getServerManager

public ServerManager getServerManager()
Return the server manager of this channel.
Returns:
The server manager.

getSyncState

public java.lang.Object getSyncState()
Return the synchronization state of the client channel.
Returns:
The synchronization state.

getChannelAge

public int getChannelAge()
Return the age of the channel.
Returns:
The channel's age.

setClientPeer

public void setClientPeer(IIOPClientChannel cltchan)
Set this server's peer, which is usually the client.
Parameters:
cltchan - The client channel.

getTCSC

public int getTCSC()
returns the selected char codeset.
Returns:
The char codeset.

setTCSC

public void setTCSC(int tcsc)
Sets the selected char codeset.
Parameters:
tcsc - The char codest.

getTCSW

public int getTCSW()
Returns the selected wide char codeset.
Returns:
The wide char codeset.

setTCSW

public void setTCSW(int tcsw)
Sets the selected wide char codeset.
Parameters:
tcsw - The wide char codeset.

setPendingClose

public void setPendingClose()
Set the channel to a closing state..

toString

public java.lang.String toString()
Creates a stringified representation of this class.
Overrides:
toString in class java.lang.Object
Returns:
A string showing information about this class.

orb

public ORB orb()
Return the orb instance.
Specified by:
orb in interface ServerChannel
Returns:
The orb.

state

public int state()
Description copied from interface: ServerChannel
Return the state of the channel.
Specified by:
state in interface ServerChannel

setState

public void setState(int state)
Sets the state of the channel.
Parameters:
state - The state to switch this channel into.

active_requests

public int active_requests()
Active request count. This is the number of requests which have not yet been sent or are still expecting a reply. This will return -1 if the channel has been perminently closed.
Specified by:
active_requests in interface Channel

channel_age

public int channel_age()
Indication of channel age. On the client side this is the request ID of the oldest active request, Since request IDs rise sequentialy this gives an indication of the activity on the channel. On server channels this will result in a call to peek_request_id if active_requests would be non-zero, otherwise it returns whatever peek_request_id returned the last time active_requests dropped to zero.
Specified by:
channel_age in interface Channel

close

public void close()
Close the connection. This closes the channel immediatly, all replys to current requests will be discarded. This is a disorderly shutdown.
Specified by:
close in interface ServerChannel

soft_close

public void soft_close(boolean ifActive)
Close the connection after all currently processing requests are complete. If there are no currently active requests the channel will close immediatly otherwise if ifActive is true then the channel will close once all currently active requests have completed, and in the mean time new incomming requests will be silently discarded. This call returns immediatly, use the state function to interrogate the state while a close is pending.
Specified by:
soft_close in interface ServerChannel

recv

public boolean recv(int timeout)
Wait the specified amount of time for an incoming message.
Specified by:
recv in interface Channel
Returns:
false if the channel is closed.

run_recv

public void run_recv()
Donate a thread for recieving messages. This function returns when interrupt is called on the thread or the channel is closed.
Specified by:
run_recv in interface Channel

checkBiDirActivation

public void checkBiDirActivation(IIOPServerRequest request)
Completes the bidir activation. This is called by the server interceptor.