org.jacorb.orb.giop
Class GIOPConnection

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.jacorb.orb.giop.GIOPConnection
Direct Known Subclasses:
ClientGIOPConnection, ServerGIOPConnection

public abstract class GIOPConnection
extends java.io.OutputStream

GIOPConnection.java Created: Sun Aug 12 21:30:48 2002

Version:
$Id: GIOPConnection.java,v 1.52 2006/01/09 16:32:54 andre.spiegel Exp $
Author:
Nicolas Noffke

Field Summary
protected  java.lang.Object connect_sync
           
protected  ConnectionListener connection_listener
           
protected  boolean discard_messages
           
protected  boolean do_close
           
protected  org.apache.avalon.framework.logger.Logger logger
           
protected  java.lang.Object pendingUndecidedSync
           
protected  Profile profile
          Profile describing the remote endpoint of this connection.
protected  StatisticsProvider statistics_provider
           
protected  Connection transport
           
 
Constructor Summary
GIOPConnection(Profile profile, Connection transport, RequestListener request_listener, ReplyListener reply_listener, StatisticsProvider statistics_provider)
           
 
Method Summary
static int allocate_cubby_id()
           
 void close()
           
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void decPendingMessages()
           
 void flush()
           
 java.lang.Object get_cubby(int id)
           
protected  RequestListener getRequestListener()
          Get the value of request_listener.
 StatisticsProvider getStatisticsProvider()
          Get the statistics provider for transport usage statistics.
 int getTCS()
           
 int getTCSW()
           
 Connection getTransport()
           
protected  void getWriteLock()
           
 boolean hasPendingMessages()
           
 void incPendingMessages()
           
 boolean isSSL()
           
 boolean isTCSNegotiated()
           
 void markTCSNegotiated()
           
protected abstract  void readTimedOut()
          Called by this.getMessage() to signal that the attempt to read a message resulted in a timeout.
 void receiveMessages()
           
protected  void releaseWriteLock()
           
 void sendReply(MessageOutputStream out)
           
 void sendRequest(MessageOutputStream out, boolean expect_reply)
           
 void set_cubby(int id, java.lang.Object obj)
           
 void setCodeSets(int TCS, int TCSW)
           
 void setConnectionListener(ConnectionListener connection_listener)
           
 void setReplyListener(ReplyListener v)
          Set the value of reply_listener.
 void setRequestListener(RequestListener v)
          Set the value of request_listener.
protected abstract  void streamClosed()
          Called by this.getMessage() to signal that the underlying transport was closed while attempting to read a message.
 void write(byte[] b)
           
 void write(byte[] fragment, int start, int size)
          write (a fragment of) the message (passes it on to the wire)
 void write(int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

profile

protected Profile profile
Profile describing the remote endpoint of this connection.


transport

protected Connection transport

connection_listener

protected ConnectionListener connection_listener

connect_sync

protected java.lang.Object connect_sync

logger

protected org.apache.avalon.framework.logger.Logger logger

discard_messages

protected boolean discard_messages

pendingUndecidedSync

protected java.lang.Object pendingUndecidedSync

do_close

protected boolean do_close

statistics_provider

protected StatisticsProvider statistics_provider
Constructor Detail

GIOPConnection

public GIOPConnection(Profile profile,
                      Connection transport,
                      RequestListener request_listener,
                      ReplyListener reply_listener,
                      StatisticsProvider statistics_provider)
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

setCodeSets

public final void setCodeSets(int TCS,
                              int TCSW)

getTCS

public final int getTCS()

getTCSW

public final int getTCSW()

markTCSNegotiated

public final void markTCSNegotiated()

isTCSNegotiated

public final boolean isTCSNegotiated()

getRequestListener

protected final RequestListener getRequestListener()
Get the value of request_listener.

Returns:
value of request_listener.

setRequestListener

public final void setRequestListener(RequestListener v)
Set the value of request_listener.

Parameters:
v - Value to assign to request_listener.

setReplyListener

public final void setReplyListener(ReplyListener v)
Set the value of reply_listener.

Parameters:
v - Value to assign to reply_listener.

setConnectionListener

public final void setConnectionListener(ConnectionListener connection_listener)

getTransport

public final Connection getTransport()

readTimedOut

protected abstract void readTimedOut()
Called by this.getMessage() to signal that the attempt to read a message resulted in a timeout. This method is implemented differently on the client and server side.


streamClosed

protected abstract void streamClosed()
Called by this.getMessage() to signal that the underlying transport was closed while attempting to read a message. This method is implemented differently on the client and server side.


receiveMessages

public final void receiveMessages()
                           throws java.io.IOException
Throws:
java.io.IOException

getWriteLock

protected final void getWriteLock()

releaseWriteLock

protected final void releaseWriteLock()

incPendingMessages

public final void incPendingMessages()

decPendingMessages

public final void decPendingMessages()

hasPendingMessages

public final boolean hasPendingMessages()

write

public final void write(byte[] fragment,
                        int start,
                        int size)
write (a fragment of) the message (passes it on to the wire)


write

public final void write(int i)
                 throws java.io.IOException
Throws:
java.io.IOException

write

public final void write(byte[] b)
                 throws java.io.IOException
Throws:
java.io.IOException

flush

public final void flush()
                 throws java.io.IOException
Throws:
java.io.IOException

sendRequest

public final void sendRequest(MessageOutputStream out,
                              boolean expect_reply)
                       throws java.io.IOException
Throws:
java.io.IOException

sendReply

public final void sendReply(MessageOutputStream out)
                     throws java.io.IOException
Throws:
java.io.IOException

isSSL

public final boolean isSSL()

close

public void close()

getStatisticsProvider

public final StatisticsProvider getStatisticsProvider()
Get the statistics provider for transport usage statistics.


allocate_cubby_id

public static int allocate_cubby_id()

get_cubby

public java.lang.Object get_cubby(int id)

set_cubby

public void set_cubby(int id,
                      java.lang.Object obj)