© 2001 BEA Systems, Inc.

com.beasys.commerce.foundation.flow
Class FlowManager

com.beasys.commerce.foundation.flow.FlowManager
All Implemented Interfaces:
FlowManagerConstants

public class FlowManager
implements FlowManagerConstants

Flow Manager servlet. This class is responsible for pulling the property set for the application, caching it, and passing the information to the DestinationDeterminer and DestinationHandler.


Field Summary
protected  java.util.HashMap applications
          Keep track of the applications and their data.
protected  java.lang.String defaultWebAppName
           
protected  SchemaManager schemaManager
           
 
Fields inherited from interface com.beasys.commerce.foundation.flow.FlowManagerConstants
APPLICATION_FLOW_MANAGER, APPLICATION_RESET_FLAG, PERIOD
 
Constructor Summary
FlowManager()
          Default constructor.
 
Method Summary
protected  java.lang.String cleanPathInfo(java.lang.String aPath)
          Clean the path info.
protected  java.lang.Object createObject(java.lang.String aName)
          Create a new instance for the specified name.
protected  int determineSize(java.lang.Object anObject)
          Determine the size of the session.
protected  com.beasys.commerce.foundation.flow.FlowManager.Application getApplication(java.lang.String aName, boolean forceReset)
          Get the application associated to the passed name.
protected  java.lang.String getDefaultWebAppName()
          Return the default Web Application as specified by the property commerce.defaultWebApp.
protected  java.lang.String getFlowManagerURI(javax.servlet.http.HttpServletRequest req)
          Get flow manager URI.
protected  java.util.Map getPropertySet(java.lang.String aName)
          Get the property set for the application name.
 SchemaManager getSchemaManager()
          Look up and get a handle to the SchemaManager.
 void init(javax.servlet.ServletConfig config)
          Initializes the servlet.
 void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Service the request.
 

Field Detail

applications

protected java.util.HashMap applications
Keep track of the applications and their data.

schemaManager

protected SchemaManager schemaManager

defaultWebAppName

protected java.lang.String defaultWebAppName
Constructor Detail

FlowManager

public FlowManager()
Default constructor.
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initializes the servlet.
Parameters:
config - a ServletConfig configuration
Throws:
ServletException -  

cleanPathInfo

protected java.lang.String cleanPathInfo(java.lang.String aPath)
Clean the path info. If the path starts with a '/', strip it off. If there is a trailing '/', strip it off also.
Parameters:
aPath - the path info from getPathInfo().
Returns:
String

getSchemaManager

public SchemaManager getSchemaManager()
                               throws javax.servlet.ServletException
Look up and get a handle to the SchemaManager.
Returns:
SchemaManager

createObject

protected java.lang.Object createObject(java.lang.String aName)
                                 throws javax.servlet.ServletException
Create a new instance for the specified name. Check all of the exceptions, if there is an exception, wrap it in a ServletException.
Parameters:
aName - a qualified class name.
Returns:
Object a new instance of the class name.
Throws:
ServletException -  

getApplication

protected com.beasys.commerce.foundation.flow.FlowManager.Application getApplication(java.lang.String aName,
                                                                                     boolean forceReset)
                                                                              throws javax.servlet.ServletException
Get the application associated to the passed name.
Parameters:
aName - the name of the application.
forceReset - are we forcing the cache to be reset, regardless of the last time it was retrieved.
Returns:
Application struct containing information for the application. Contains ttl, DestinationDeterminer, DestinationHandler, and the last time it was retrieved.
Throws:
ServletException -  

getPropertySet

protected java.util.Map getPropertySet(java.lang.String aName)
                                throws javax.servlet.ServletException
Get the property set for the application name.
Parameters:
aName - the application name.
Returns:
Map the property set as a Map.
Throws:
ServletException -  

getFlowManagerURI

protected java.lang.String getFlowManagerURI(javax.servlet.http.HttpServletRequest req)
Get flow manager URI.
Parameters:
req -  
Returns:
String

determineSize

protected int determineSize(java.lang.Object anObject)
Determine the size of the session. It will also check to see if everything is serializable.
Parameters:
anObject -  
Returns:
int

getDefaultWebAppName

protected java.lang.String getDefaultWebAppName()
Return the default Web Application as specified by the property commerce.defaultWebApp.
Returns:
the name of the default Web Application

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws java.io.IOException,
                    javax.servlet.ServletException
Service the request. This is the standard servlet service method. 1. Retrieve the application name. 2. Retrieve the application property set. 3. Get the DestinationDeterminer and DestinationHandler. 4. Call the DestinationDeterminer. 5. Call the DestinationHandler.
Parameters:
req - the request.
res - the response.
Throws:
IOException -  
ServletException -  

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved