Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.servlet.connectionMethods
Class ChannelTable  view ChannelTable download ChannelTable.java

java.lang.Object
  extended byorg.enhydra.servlet.connectionMethods.ChannelTable

public class ChannelTable
extends java.lang.Object

A table of Channel elements.


Field Summary
protected  java.util.Vector channelTable
          This is the actual table.
 
Constructor Summary
ChannelTable()
          Constructor
 
Method Summary
 void add(Channel channel)
          Add a new channel.
 void add(java.lang.String channelID, java.lang.String URLPrefix, java.lang.String servletID)
          Add a new channel.
 void delete(java.lang.String channelID)
          Delete a channel.
 Channel findID(java.lang.String channelID)
          Return the Channel for the given identification name.
 Channel findURLPrefix(java.lang.String URL)
          Search the set of channels for one whose URLPrefix matches the beginning of the given URL.
 Channel getChannelByID(java.lang.String channelID)
          Return the Channel for the given identification name.
 Channel getChannelByURLPrefix(java.lang.String urlPrefix)
          Return the Channel for the given URL prefix.
 java.lang.String[] getChannelIDs()
          Returns the identifier names of all the channels currently in the ChannelTable.
 java.lang.String toString()
          Return a multi-line string listing the channel ids.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

channelTable

protected java.util.Vector channelTable
This is the actual table. If you need to synchronize across multiple calls to this class, you may synchronize on this object. Internally, all synchronization is done on this object.

Maybe this should be replaced with a public Object, and it should be used for all locking?

Constructor Detail

ChannelTable

public ChannelTable()
Constructor

Method Detail

add

public void add(java.lang.String channelID,
                java.lang.String URLPrefix,
                java.lang.String servletID)
Add a new channel. The new channel is not enabled and has no TransactionFilters.


add

public void add(Channel channel)
Add a new channel. The new channel is not enabled and has no TransactionFilters.


delete

public void delete(java.lang.String channelID)
Delete a channel.


getChannelIDs

public java.lang.String[] getChannelIDs()
Returns the identifier names of all the channels currently in the ChannelTable.


getChannelByID

public Channel getChannelByID(java.lang.String channelID)
Return the Channel for the given identification name. Returns null if not found.


findID

public Channel findID(java.lang.String channelID)
Return the Channel for the given identification name. Returns null if not found. Warning: this method does not synchronize on channelTable. The caller must synchronize on it. Normally you will want to synchronize on it, call this method to look up a Channel, modify the Channel or the table itself, then release the lock on channelTable. That way you know that the table will not change between the time you fetch an entry to the time you modify the entry or the table.


getChannelByURLPrefix

public Channel getChannelByURLPrefix(java.lang.String urlPrefix)
Return the Channel for the given URL prefix. Returns null if not found.


findURLPrefix

public Channel findURLPrefix(java.lang.String URL)
Search the set of channels for one whose URLPrefix matches the beginning of the given URL. Returns null if not found. If you are extending this class, you should use this method to determine which channel applies to a request URL. The Channel returned is a reference to the object stored in the table, so any changes made to it are also made to the working instance in the table.

Warning: this method does not synchronize on channelTable. The caller must synchronize on it. Normally you will want to synchronize on it, call this method to look up a Channel, modify the Channel or the table its self, then release the lock on channelTable. That way you know that the table will not change between the time you fetch an entry to the time you modify the entry or the table.


toString

public java.lang.String toString()
Return a multi-line string listing the channel ids.