org.jboss.remoting.transport.async.bio
Class BlockingChannel

java.lang.Object
  extended byorg.jboss.remoting.transport.async.bio.BlockingChannel
All Implemented Interfaces:
Channel, Runnable

public class BlockingChannel
extends Object
implements Runnable, Channel

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

Author:
Hiram Chirino

Constructor Summary
BlockingChannel()
           
 
Method Summary
 void close()
          Starts to terminate the connection.
 InvokerLocator getRemoteURI()
           
 void init(InvokerLocator localURI, Socket socket)
           
 void open(ChannelListner listner)
          starts an accepted connection.
 void open(InvokerLocator remoteURI, ChannelListner listner)
          opens a connection to another server.
 void run()
           
 void send(byte[][] data)
          Sends an asynch packet of data down the channel.
 
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(InvokerLocator remoteURI,
                 ChannelListner listner)
          throws IOException,
                 ConnectionFailedException
Description copied from interface: Channel
opens a connection to another server.

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

init

public void init(InvokerLocator localURI,
                 Socket socket)
          throws IOException
Throws:
IOException

open

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

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

send

public void send(byte[][] data)
          throws IOException
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:
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
See Also:
org.jboss.remoting.transport.async.AsynchChannel#close()

getRemoteURI

public InvokerLocator getRemoteURI()
Returns:


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.