org.apache.geronimo.messaging.remotenode
Class LogicalCompression

java.lang.Object
  extended byorg.apache.geronimo.messaging.remotenode.LogicalCompression
All Implemented Interfaces:
PopSynchronization, PushSynchronization

public class LogicalCompression
extends Object
implements PopSynchronization, PushSynchronization

Logical compression of Msgs.
Its goal is to compress Msgs to be sent to other nodes. The compression is based on a shared knowledge such as a Topology.

Version:
$Revision: 1.4 $ $Date: 2004/07/20 00:26:04 $

Constructor Summary
LogicalCompression()
           
 
Method Summary
 void afterPop(StreamInputStream anIn, Msg aMsg, Object anOpaque)
          Notifies the implementation that a Msg has been popped.
 void afterPush(StreamOutputStream anOut, Msg aMsg, Object anOpaque)
          Notifies the implementation that a Msg has been pushed.
 Object beforePop(StreamInputStream anIn)
          Notifies the implementation that a Msg is being popped.
 Object beforePush(StreamOutputStream anOut, Msg aMsg)
          Notifies the implementation that a Msg is being pushed.
 void commitTopology()
          Commits the previousy prepared topology.
 void prepareTopology(NodeTopology aTopology)
          Registers a future topology.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicalCompression

public LogicalCompression()
Method Detail

prepareTopology

public void prepareTopology(NodeTopology aTopology)
Registers a future topology. It is only used to uncompress Msgs which have not been compressed by the topology currently committed.

Parameters:
aTopology - Topology.

commitTopology

public void commitTopology()
Commits the previousy prepared topology. It is used to compress and uncompress Msgs. If it is not possible to uncompress a Msg with the current topology, then the future topology is used.


beforePop

public Object beforePop(StreamInputStream anIn)
                 throws IOException
Description copied from interface: PopSynchronization
Notifies the implementation that a Msg is being popped.
This method is called before the actual pop of the Msg.

Specified by:
beforePop in interface PopSynchronization
Parameters:
anIn - Used to read information from the input stream before the Msg itself.
Returns:
Opaque object which is passed back to this instance via afterPop. It can be used to pass information between a beforePop and an afterPop call.
Throws:
IOException - Indicates that an I/O error has occured.

afterPop

public void afterPop(StreamInputStream anIn,
                     Msg aMsg,
                     Object anOpaque)
              throws IOException
Description copied from interface: PopSynchronization
Notifies the implementation that a Msg has been popped.

Specified by:
afterPop in interface PopSynchronization
Parameters:
anIn - Used to read information from the input stream after the Msg itself.
aMsg - Msg which has just been popped.
anOpaque - Value returned by beforePop.
Throws:
IOException - Indicates that an I/O error has occured.

beforePush

public Object beforePush(StreamOutputStream anOut,
                         Msg aMsg)
                  throws IOException
Description copied from interface: PushSynchronization
Notifies the implementation that a Msg is being pushed.
This method is called before the actual push of the Msg.

Specified by:
beforePush in interface PushSynchronization
Parameters:
anOut - Used to write information before the Msg itself.
aMsg - Msg being pushed.
Returns:
Opaque object which is passed by to this instance via afterPush. It can be used to pass information between a beforePush and a afterPush call.
Throws:
IOException - Indicates that an I/O error has occured.

afterPush

public void afterPush(StreamOutputStream anOut,
                      Msg aMsg,
                      Object anOpaque)
               throws IOException
Description copied from interface: PushSynchronization
Notifies the implementation that a Msg has been pushed.

Specified by:
afterPush in interface PushSynchronization
Parameters:
anOut - Used to write information after the Msg itself.
aMsg - Msg which has just been pushed.
anOpaque - Value returned by beforePush.
Throws:
IOException - Indicates that an I/O error has occured.


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