wtanaka.praya.gale
Class Multiplexer

java.lang.Object
  |
  +--wtanaka.praya.gale.Multiplexer
All Implemented Interfaces:
Pushable

public class Multiplexer
extends java.lang.Object
implements Pushable

Class that listens to GaleReadThread and multiplexes the same incoming connection into more than one virtual connection, each one with its own subscription list.

Return to Sourceforge or the Praya Homepage

Version:
$Name: $ $Date: 2001/10/04 04:08:05 $
Author:
$Author: wtanaka $

Field Summary
private  java.util.Hashtable m_listeners
          map from string name to Pushable.
private  GaleClient m_parent
          Errors are sent here.
private  java.util.Hashtable m_subscriptions
          Auxiliary map from string to SubscriptionList.
 
Constructor Summary
(package private) Multiplexer(GaleClient parent)
          Constructs a Multiplexer
 
Method Summary
(package private)  void addListener(java.lang.String name, Pushable listener)
          Adds a gale session
private  SubscriptionList getSubscriptionList()
          The main subscription list for this multiplexer
(package private)  void pushMessage(Message m)
           
 void receiveMessage(Message message)
           
(package private)  void removeListener(java.lang.String name)
           
(package private)  void resubscribe()
           
(package private)  void setSubscriptionsFor(java.lang.String name, SubscriptionList subs)
           
(package private)  void setSubscriptionsFor(java.lang.String name, SubscriptionList subs, boolean shouldResubscribe)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

m_listeners

private java.util.Hashtable m_listeners
map from string name to Pushable. A key is valid in this Multiplexer if it is a key in this hashtable.

m_subscriptions

private java.util.Hashtable m_subscriptions
Auxiliary map from string to SubscriptionList.

m_parent

private GaleClient m_parent
Errors are sent here.
Constructor Detail

Multiplexer

Multiplexer(GaleClient parent)
Constructs a Multiplexer
Method Detail

addListener

void addListener(java.lang.String name,
                 Pushable listener)
Adds a gale session

removeListener

void removeListener(java.lang.String name)

getSubscriptionList

private SubscriptionList getSubscriptionList()
The main subscription list for this multiplexer

resubscribe

void resubscribe()
           throws java.io.IOException

setSubscriptionsFor

void setSubscriptionsFor(java.lang.String name,
                         SubscriptionList subs)
                   throws java.io.IOException

setSubscriptionsFor

void setSubscriptionsFor(java.lang.String name,
                         SubscriptionList subs,
                         boolean shouldResubscribe)
                   throws java.io.IOException

pushMessage

void pushMessage(Message m)

receiveMessage

public void receiveMessage(Message message)
Specified by:
receiveMessage in interface Pushable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object