org.exolab.core.mipc
Class ObjectChannel

java.lang.Object
  extended by org.exolab.core.mipc.ObjectChannel
All Implemented Interfaces:
IpcIfc

public class ObjectChannel
extends java.lang.Object
implements IpcIfc

The ObjectChannel is associated with a MultiplexConnection. It makes it easy to read and write objects from/to a multiplex channel.

Version:
$Revision: 1.4 $
Author:
Art Whitten
See Also:
MultiplexConnection

Constructor Summary
ObjectChannel(java.lang.String label, MultiplexConnectionIfc connection)
          Creates a new ObjectChannel with the given name on the specified connection.
 
Method Summary
 void close()
          Close the channel
 MultiplexConnectionIfc getConnection()
          Get the connection that this encapsulates
 java.lang.Object receive()
          Receive an object from the underlying connection
 void send(java.io.Serializable object)
          Send an object on the underlying connection
 java.lang.String toString()
          Retrieve a unique id for this connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectChannel

public ObjectChannel(java.lang.String label,
                     MultiplexConnectionIfc connection)
Creates a new ObjectChannel with the given name on the specified connection.

Parameters:
label - the name of the multiplex channel to read/write from/to.
connection - the underlying connection
Method Detail

close

public void close()
           throws java.io.IOException
Close the channel

Specified by:
close in interface IpcIfc
Throws:
java.io.IOException

send

public void send(java.io.Serializable object)
          throws java.io.IOException
Send an object on the underlying connection

Specified by:
send in interface IpcIfc
Parameters:
object - the object to send
Throws:
java.io.IOException - if the object cannot be written to the output stream.

receive

public java.lang.Object receive()
                         throws java.lang.ClassNotFoundException,
                                java.io.IOException
Receive an object from the underlying connection

Specified by:
receive in interface IpcIfc
Returns:
the received object
Throws:
java.io.IOException - if the object cannot be received
java.lang.ClassNotFoundException - If the class cannot be re-constituted.

toString

public java.lang.String toString()
Retrieve a unique id for this connection.

Specified by:
toString in interface IpcIfc
Overrides:
toString in class java.lang.Object
Returns:
the unique string id

getConnection

public MultiplexConnectionIfc getConnection()
Get the connection that this encapsulates

Returns:
MultiplexConnection the underlying connection object.


Copyright © 1999-2012 The Exolab Group. All Rights Reserved.