|
|||||||||
| Home >> All >> org >> enhydra >> servlet >> [ connectionMethods overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.enhydra.servlet.connectionMethods
Class StandardConnectionMethod

java.lang.Objectorg.enhydra.servlet.connectionMethods.StandardConnectionMethod
- All Implemented Interfaces:
- ConnectionMethod, java.io.Serializable
- public abstract class StandardConnectionMethod
- extends java.lang.Object
- implements ConnectionMethod
- extends java.lang.Object
This is a sample implementation of a ConnectionMethod. It is an abstract class because this class does not actually recieve or generate requests. It does do all the channel managment. Implementations of ConnectionMethod should extend this object, unless there is a specific reason not to.
Classes that extend this class will need to implement the
getChannelURL() and
channelURLIsValid() functions. They will also need to
ensure that they contain a thread that is started in the constructor
or (prefered) initialize(), and stopped in
destroy().
| Field Summary | |
private static int |
channelNameCounter
|
protected ChannelTable |
channelTable
Stores a set of ChannelTableEntries. |
org.enhydra.servlet.filter.FilterManager |
filterManager
The FilterManager passed in to the initialize() method. |
private static int |
filterNameCounter
|
org.enhydra.servlet.servletManager.ServletManager |
servletManager
The ServletManager passed in to the initialize() method. |
| Fields inherited from interface org.enhydra.servlet.connectionMethods.ConnectionMethod |
disabledChannelHtml, errorHtml, noChannelHtml |
| Constructor Summary | |
StandardConnectionMethod()
|
|
| Method Summary | |
void |
addChannel(java.lang.String channelID,
java.lang.String URLPrefix,
java.lang.String servletID)
Add a new channel. |
void |
addTransactionFilter(java.lang.String channelID,
java.lang.String filterID)
Add a new Filter to the specified channel. |
void |
deleteChannel(java.lang.String channelID)
Delete a channel. |
void |
destroy()
Shut down the connection method. |
void |
disableChannel(java.lang.String channelID)
Turn off the channel. |
void |
enableChannel(java.lang.String channelID)
Turn on the channel. |
boolean |
equivalent(ConnectionMethod compareObject)
Compares the connection specific attributes for equivalency |
java.lang.String[] |
getChannelIDs()
Returns the identifier names of all the channels currently in the ConnectionMethod. |
ChannelStatus |
getChannelStatus(java.lang.String channelID)
Get the current status of a channel. |
java.lang.String[] |
getTransactionFilterIDs(java.lang.String channelID)
Get a list of all the filter names. |
java.lang.String |
getType()
|
java.lang.String |
getUniqueChannelName()
This returns a channel name that is not currently in use. |
void |
initialize(com.lutris.util.Config connectionConfig,
java.lang.String id,
org.enhydra.servlet.servletManager.ServletManager servletManager,
org.enhydra.servlet.filter.FilterManager filterManager)
Start up. |
void |
initialize(java.lang.String id,
org.enhydra.servlet.servletManager.ServletManager servletManager,
org.enhydra.servlet.filter.FilterManager filterManager)
Start up. |
void |
removeTransactionFilter(java.lang.String channelID,
java.lang.String filterID)
Remove the given Filter from the specified channel. |
void |
resetRequestCount(java.lang.String channelID)
Reset the specified channel's request count to zero. |
void |
writeToConfig(com.lutris.util.Config connectionConfig,
java.lang.String base)
Write out self into config fie |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.enhydra.servlet.connectionMethods.ConnectionMethod |
channelURLIsValid, getChannelURL |
| Field Detail |
servletManager
public org.enhydra.servlet.servletManager.ServletManager servletManager
- The ServletManager passed in to the
initialize()method. If you are extending this class, you should use this ServletManager to convert the servletID string to Servlets. The servletID strings are only valid in this ServletManager.
filterManager
public org.enhydra.servlet.filter.FilterManager filterManager
- The FilterManager passed in to the
initialize()method. If you are extending this class, you should use this FilterManager to convert the filterID string to Filters. The filterID strings are only valid in this FilterManager.
channelTable
protected ChannelTable channelTable
- Stores a set of ChannelTableEntries. This is where all the information
about the channels is stored. All the methods that modify the
status of channels synchronize on this object.
channelNameCounter
private static int channelNameCounter
filterNameCounter
private static int filterNameCounter
| Constructor Detail |
StandardConnectionMethod
public StandardConnectionMethod()
| Method Detail |
initialize
public void initialize(com.lutris.util.Config connectionConfig, java.lang.String id, org.enhydra.servlet.servletManager.ServletManager servletManager, org.enhydra.servlet.filter.FilterManager filterManager) throws ConnectionMethodException
- Start up. Initially there are no channels.
Saves the ServletManager for later use.
This will be called before any other method in this class.
- Specified by:
initializein interfaceConnectionMethod
initialize
public void initialize(java.lang.String id, org.enhydra.servlet.servletManager.ServletManager servletManager, org.enhydra.servlet.filter.FilterManager filterManager) throws ConnectionMethodException
- Start up. Initially there are no channels.
Saves the ServletManager for later use.
This will be called before any other method in this class.
- Specified by:
initializein interfaceConnectionMethod
writeToConfig
public void writeToConfig(com.lutris.util.Config connectionConfig, java.lang.String base) throws com.lutris.util.ConfigException, com.lutris.util.KeywordValueException
- Write out self into config fie
- Specified by:
writeToConfigin interfaceConnectionMethod
addChannel
public void addChannel(java.lang.String channelID, java.lang.String URLPrefix, java.lang.String servletID) throws ConnectionMethodException
- Add a new channel. The new channel is not enabled, and has
no Filters.
- Specified by:
addChannelin interfaceConnectionMethod
getChannelStatus
public ChannelStatus getChannelStatus(java.lang.String channelID)
- Get the current status of a channel.
- Specified by:
getChannelStatusin interfaceConnectionMethod
deleteChannel
public void deleteChannel(java.lang.String channelID) throws ConnectionMethodException
- Delete a channel.
- Specified by:
deleteChannelin interfaceConnectionMethod
getChannelIDs
public java.lang.String[] getChannelIDs()
- Returns the identifier names of all the channels currently in
the ConnectionMethod.
- Specified by:
getChannelIDsin interfaceConnectionMethod
enableChannel
public void enableChannel(java.lang.String channelID) throws ConnectionMethodException
- Turn on the channel. Allows requests to be sent to the servlet.
- Specified by:
enableChannelin interfaceConnectionMethod
disableChannel
public void disableChannel(java.lang.String channelID) throws ConnectionMethodException
- Turn off the channel. Incomming requests should be refused.
No requests should be allowed through to the servlet.
- Specified by:
disableChannelin interfaceConnectionMethod
resetRequestCount
public void resetRequestCount(java.lang.String channelID) throws ConnectionMethodException
- Reset the specified channel's request count to zero.
The counter measures the number of requests processed by this channel.
- Specified by:
resetRequestCountin interfaceConnectionMethod
addTransactionFilter
public void addTransactionFilter(java.lang.String channelID, java.lang.String filterID) throws ConnectionMethodException
- Add a new Filter to the specified channel.
- Specified by:
addTransactionFilterin interfaceConnectionMethod
removeTransactionFilter
public void removeTransactionFilter(java.lang.String channelID, java.lang.String filterID) throws ConnectionMethodException
- Remove the given Filter from the specified channel.
- Specified by:
removeTransactionFilterin interfaceConnectionMethod
getTransactionFilterIDs
public java.lang.String[] getTransactionFilterIDs(java.lang.String channelID) throws ConnectionMethodException
- Get a list of all the filter names.
- Specified by:
getTransactionFilterIDsin interfaceConnectionMethod
getUniqueChannelName
public java.lang.String getUniqueChannelName()
- This returns a channel name that is not currently in use. Use this
when you want to programatically create a channel, and you don't
care what it's name is. The name returned will not be in the list
of current channels, and will not be returned on any other calls
to this function.
The names will be of the form "channel". - Specified by:
getUniqueChannelNamein interfaceConnectionMethod
destroy
public void destroy()
throws ConnectionMethodException
- Shut down the connection method. This class simply throws out all
the channels. If you extend this class, you will probably want to
perform some actions to close down the external part of the
connection and kill any threads you started.
After this call, none of these methods will be called again.
- Specified by:
destroyin interfaceConnectionMethod
equivalent
public boolean equivalent(ConnectionMethod compareObject)
- Compares the connection specific attributes for equivalency
- Specified by:
equivalentin interfaceConnectionMethod
getType
public java.lang.String getType()
- Specified by:
getTypein interfaceConnectionMethod
|
|||||||||
| Home >> All >> org >> enhydra >> servlet >> [ connectionMethods overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.enhydra.servlet.connectionMethods.StandardConnectionMethod