org.apache.geronimo.remoting.transport.async.bio
Class BlockingChannel

java.lang.Object
  extended byorg.apache.geronimo.proxy.SimpleComponent
      extended byorg.apache.geronimo.remoting.transport.async.bio.BlockingChannel
All Implemented Interfaces:
Channel, org.apache.geronimo.core.service.Component, Runnable, Serializable

public class BlockingChannel
extends org.apache.geronimo.proxy.SimpleComponent
implements Runnable, Channel

The Blocking implementation of the AsynchChannel interface. This implemenation uses the standard Java 1.3 blocking socket IO.

Version:
$Revision: 1.3 $ $Date: 2004/03/10 09:59:20 $
See Also:
Serialized Form

Constructor Summary
BlockingChannel()
           
 
Method Summary
 void close()
          Starts to terminate the connection.
 AsyncMsg deserialize(ByteBuffer[] message)
           
 URI getRemoteURI()
           
 URI getRequestedURI()
           
 void init(URI localURI, SocketChannel socketChannel)
           
 void open(ChannelListner listner)
          starts an accepted connection.
 void open(URI remoteURI, URI backConnectURI, ChannelListner listner)
          opens a connection to another server.
 void run()
           
 void send(AsyncMsg data)
          Sends an asynch packet of data down the channel.
 
Methods inherited from class org.apache.geronimo.proxy.SimpleComponent
getContainer, getObjectName, setContainer, setObjectName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingChannel

public BlockingChannel()
Method Detail

open

public void open(URI remoteURI,
                 URI backConnectURI,
                 ChannelListner listner)
          throws TransportException
Description copied from interface: Channel
opens a connection to another server.

Specified by:
open in interface Channel
Parameters:
remoteURI -
listner -
Throws:
TransportException

init

public void init(URI localURI,
                 SocketChannel socketChannel)
          throws IOException,
                 URISyntaxException
Throws:
IOException
URISyntaxException

open

public void open(ChannelListner listner)
          throws TransportException
Description copied from interface: Channel
starts an accepted connection.

Specified by:
open in interface Channel
Parameters:
listner -
Throws:
TransportException

send

public void send(AsyncMsg data)
          throws TransportException
Description copied from interface: Channel
Sends an asynch packet of data down the channel. It does not wait wait for a response if possible.

Specified by:
send in interface Channel
Throws:
TransportException

deserialize

public AsyncMsg deserialize(ByteBuffer[] message)
                     throws IOException
Throws:
IOException

run

public void run()
Specified by:
run in interface Runnable

close

public void close()
Starts to terminate the connection. Lets the remote end know that we are closing. The client side calls this close. Could be called in response to 2 events: - the remote sever initiated the close(). (so we finish the close) - we initiated the close() (so we wait for the remote side to finish the close) We keep state to know if we started the socket close().

Specified by:
close in interface Channel

getRemoteURI

public URI getRemoteURI()
Returns:

getRequestedURI

public URI getRequestedURI()
Returns:
Returns the requestedURI.


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.