com.cafesoft.cams.agent
Class CamsAgentContextFactory

java.lang.Object
  |
  +--com.cafesoft.cams.agent.CamsAgentContextFactory

public class CamsAgentContextFactory
extends Object

The CamsAgentContextFactory class is a factory object that is responsible for creating CamsAgentContext objects.

Furthermore, it is responsible for caching previously created instances of the CamsAgentContext objects for reuse by other agents. By using the same context objects various webagents share the same AccessControlCheckCache, CamsClient, and RemoteSessionManager.

Since:
6/23/03
See Also:
CamsAgentContext

Method Summary
 CamsAgentContext createCtx(String className, String path)
          Create a CamsAgentContext object.
 void destroyCtx(CamsAgentContext ctx)
          Destroy a CamsAgentContext object.
static CamsAgentContextFactory getInstance()
          Get the single instance of the CamsAgentContextFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final CamsAgentContextFactory getInstance()
Get the single instance of the CamsAgentContextFactory.

Returns:
the only instance of the CamsAgentContextFactory.

createCtx

public CamsAgentContext createCtx(String className,
                                  String path)
                           throws CamsAgentException
Create a CamsAgentContext object.

This method will attempt first attempt to return a cached instance of the context object. If one can be found it is returned. Otherwise, a new instance will be created and returned.

Parameters:
className - the name of the CamsAgentContext instance to create.
path - the filepath of the configuration file.
Returns:
a CamsAgentContext object.
Throws:
CamsAgentException - if any error occurs creating a CamsAgentContext.

destroyCtx

public void destroyCtx(CamsAgentContext ctx)
                throws CamsAgentException
Destroy a CamsAgentContext object.

This method will destroy a context object only if it is the last instance of the context being used. In otherwords, if two agents share a copy of the context, the last agent to be destroyed will ultimately destroy the context object.

Parameters:
ctx - the CamsAgentContext object to destroy.
Throws:
CamsAgentException - if any error occurs destroying a CamsAgentContext.


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.