org.apache.geronimo.messaging.io
Class StreamManagerImpl

java.lang.Object
  extended byorg.apache.geronimo.messaging.BaseEndPoint
      extended byorg.apache.geronimo.messaging.io.StreamManagerImpl
All Implemented Interfaces:
EndPoint, MsgConsProd, MsgConsumer, MsgProducer, StreamManager

public class StreamManagerImpl
extends BaseEndPoint
implements EndPoint, StreamManager

StreamManager implementation.

Version:
$Revision: 1.4 $ $Date: 2004/06/10 23:12:25 $

Nested Class Summary
protected static class StreamManagerImpl.ID
          This is the object, which is written to an OutputStream during serialization of a GInputStream.
 
Field Summary
static byte[] NULL_READ
          Used to signal an end of input stream.
protected  NodeInfo owningNode
          Node owning this manager.
 
Fields inherited from class org.apache.geronimo.messaging.BaseEndPoint
id, node, out, sender
 
Fields inherited from interface org.apache.geronimo.messaging.io.StreamManager
NAME
 
Constructor Summary
StreamManagerImpl(Node aNode)
          Creates a manager owned by the specified node.
 
Method Summary
 Object register(InputStream anIn)
          Registers the provided InputStream.
 InputStream retrieve(Object anId)
          Retrieves the InputStream having the provided id.
 byte[] retrieveLocalNext(Object anID)
          Reads from the InputStream having the specified identifier and returns the read bytes.
protected  byte[] retrieveNext(Object anID)
           
 void start()
          Starts.
 void stop()
          Stops.
 
Methods inherited from class org.apache.geronimo.messaging.BaseEndPoint
getID, getMsgConsumerOut, handleRequest, handleResponse, setMsgProducerOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.geronimo.messaging.EndPoint
getID
 
Methods inherited from interface org.apache.geronimo.messaging.MsgProducer
setMsgProducerOut
 
Methods inherited from interface org.apache.geronimo.messaging.MsgConsumer
getMsgConsumerOut
 

Field Detail

NULL_READ

public static final byte[] NULL_READ
Used to signal an end of input stream.


owningNode

protected final NodeInfo owningNode
Node owning this manager.

Constructor Detail

StreamManagerImpl

public StreamManagerImpl(Node aNode)
Creates a manager owned by the specified node.

Parameters:
aNode - Node containing this instance.
Method Detail

start

public void start()
Description copied from interface: StreamManager
Starts.

Specified by:
start in interface StreamManager

stop

public void stop()
Description copied from interface: StreamManager
Stops.

Specified by:
stop in interface StreamManager

register

public Object register(InputStream anIn)
Description copied from interface: StreamManager
Registers the provided InputStream.

Specified by:
register in interface StreamManager
Parameters:
anIn - InputStream to be tracked.
Returns:
An opaque Object identifying this stream. It must be used to retrieve the registered stream.

retrieve

public InputStream retrieve(Object anId)
                     throws IOException
Description copied from interface: StreamManager
Retrieves the InputStream having the provided id.

Specified by:
retrieve in interface StreamManager
Parameters:
anId - Identifier.
Returns:
InputStream having this id.
Throws:
IOException - Indicates that no InputStream is registered for the provided identifier.

retrieveLocalNext

public byte[] retrieveLocalNext(Object anID)
                         throws IOException
Description copied from interface: StreamManager
Reads from the InputStream having the specified identifier and returns the read bytes.

Specified by:
retrieveLocalNext in interface StreamManager
Parameters:
anID - InputStream identifier.
Returns:
byte block read from the InputStream identified by anID.
Throws:
IOException - Indicates than an I/O error has occured.

retrieveNext

protected byte[] retrieveNext(Object anID)
                       throws IOException
Throws:
IOException


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