org.abstracthorizon.danube.tapestry
Class TapestryConnectionHandler

java.lang.Object
  extended by org.abstracthorizon.danube.tapestry.TapestryConnectionHandler
All Implemented Interfaces:
ConnectionHandler
Direct Known Subclasses:
TapestryConnectionHandler

public class TapestryConnectionHandler
extends Object
implements ConnectionHandler

Tapestry connection handler. During initialisation it reads tapestry application configuration file which defaults to TAPESTRY_DEFAULT_APPLICATION_NAME ("tapestry.application").

Author:
Daniel Sendula

Field Summary
protected  String applicationSpecificationResourceName
          Application specification resource name.
protected  org.apache.hivemind.ClassResolver classResolver
          Tapestry's class resolver
protected  Map<String,String> initialParameters
          Initial parameters
protected  org.slf4j.Logger logger
          Logger
protected  org.apache.hivemind.Registry registry
          Tapestry's registry
protected  HTTPSessionManager sessionManager
          Danube's session manager
static String TAPESTRY_DEFAULT_APPLICATION_NAME
          Default tapestry application configuration file
static String TAPESTRY_SUFFIX
          Suffix of tapestry configuration files
protected  WebActivator webActivator
          Web activator implementation reference
protected  WebContext webContext
          Web context implementation reference
protected  WebRequestServicer webRequestServicer
          Tapestry's web request servicer
 
Constructor Summary
TapestryConnectionHandler()
           
 
Method Summary
protected  org.apache.hivemind.ErrorHandler constructErrorHandler()
          Constructs error handler.
protected  org.apache.hivemind.ClassResolver createClassResolver()
          Creates class resolver.
protected  HTTPSessionManager createSessionManager()
          Creates session manager.
 String getApplicationSpecificationResourceName()
          Returns name of application specification resource
 org.apache.hivemind.ClassResolver getClassResolver()
          Returns class resolver.
 Map<String,String> getInitialParameters()
          Returns initial parameters.
 HTTPSessionManager getSessionManager()
          Returns session manager.
 WebActivator getWebActivator()
          Returns web activator.
 WebContext getWebContext()
          Returns web context assigned to this handler.
 void handleConnection(Connection connection)
          Handles connection by creating DanubeRequest and DanubeResponse and invokes servicer's service method.
 void init()
          Initialises this connection handler
protected  org.apache.hivemind.Resource obtainApplicationResource()
          Obtains application resource.
protected  WebContext obtainWebContext()
          Creates WebContext.
 void setApplicationSpecificationResourceName(String applicationSpecificationResourceName)
          Sets name of application specification resource
 void setClassResolver(org.apache.hivemind.ClassResolver classResolver)
          Sets class resolver
 void setInitialParameters(Map<String,String> parameters)
          Sets initial parameters
 void setSessionManager(HTTPSessionManager sessionManager)
          Sets session manager
 void setWebActivator(WebActivator webActivator)
          Sets web activator.
 void setWebContext(WebContext webContext)
          Sets web context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAPESTRY_SUFFIX

public static final String TAPESTRY_SUFFIX
Suffix of tapestry configuration files

See Also:
Constant Field Values

TAPESTRY_DEFAULT_APPLICATION_NAME

public static final String TAPESTRY_DEFAULT_APPLICATION_NAME
Default tapestry application configuration file

See Also:
Constant Field Values

logger

protected final org.slf4j.Logger logger
Logger


classResolver

protected org.apache.hivemind.ClassResolver classResolver
Tapestry's class resolver


registry

protected org.apache.hivemind.Registry registry
Tapestry's registry


webRequestServicer

protected WebRequestServicer webRequestServicer
Tapestry's web request servicer


webActivator

protected WebActivator webActivator
Web activator implementation reference


webContext

protected WebContext webContext
Web context implementation reference


sessionManager

protected HTTPSessionManager sessionManager
Danube's session manager


applicationSpecificationResourceName

protected String applicationSpecificationResourceName
Application specification resource name. Initial value is "tapestry.application"


initialParameters

protected Map<String,String> initialParameters
Initial parameters

Constructor Detail

TapestryConnectionHandler

public TapestryConnectionHandler()
Method Detail

handleConnection

public void handleConnection(Connection connection)
Handles connection by creating DanubeRequest and DanubeResponse and invokes servicer's service method.

Specified by:
handleConnection in interface ConnectionHandler
Parameters:
connection - connection

init

public void init()
          throws Exception
Initialises this connection handler

Throws:
Exception

obtainWebContext

protected WebContext obtainWebContext()
Creates WebContext.

Returns:
new DanubeContext

constructErrorHandler

protected org.apache.hivemind.ErrorHandler constructErrorHandler()
Constructs error handler. This method returns StrictErrorHandler

Returns:
error handler

obtainApplicationResource

protected org.apache.hivemind.Resource obtainApplicationResource()
Obtains application resource. This implementation returns "tapestry.application&qout; file resource

Returns:
application resource

getSessionManager

public HTTPSessionManager getSessionManager()
Returns session manager. If none is supplied then createSessionManager() method is called.

Returns:
the sessionManager

setSessionManager

public void setSessionManager(HTTPSessionManager sessionManager)
Sets session manager

Parameters:
sessionManager - the sessionManager to set

createSessionManager

protected HTTPSessionManager createSessionManager()
Creates session manager. This implementation returns SimpleSessionManager

Returns:
creates new session manager

getClassResolver

public org.apache.hivemind.ClassResolver getClassResolver()
Returns class resolver. If none is supplied then createClassResolver() method is called

Returns:
class resolver

setClassResolver

public void setClassResolver(org.apache.hivemind.ClassResolver classResolver)
Sets class resolver

Parameters:
classResolver - class resolver

createClassResolver

protected org.apache.hivemind.ClassResolver createClassResolver()
Creates class resolver. This implementation returns DefaultClassResolver.

Returns:
new class resolver

getInitialParameters

public Map<String,String> getInitialParameters()
Returns initial parameters. If not already set then it creates new, empty map.

Returns:
initial parameters

setInitialParameters

public void setInitialParameters(Map<String,String> parameters)
Sets initial parameters

Parameters:
parameters - initial parameters

getApplicationSpecificationResourceName

public String getApplicationSpecificationResourceName()
Returns name of application specification resource

Returns:
name of application specification resource

setApplicationSpecificationResourceName

public void setApplicationSpecificationResourceName(String applicationSpecificationResourceName)
Sets name of application specification resource

Parameters:
applicationSpecificationResourceName - name of application specification resource

getWebActivator

public WebActivator getWebActivator()
Returns web activator. If not already set then DanubeActivator will be instantiated.

Returns:
web activator

setWebActivator

public void setWebActivator(WebActivator webActivator)
Sets web activator.

Parameters:
webActivator - web activator

getWebContext

public WebContext getWebContext()
Returns web context assigned to this handler. If not already set then DanubeContext will be instantiated.

Returns:
web context

setWebContext

public void setWebContext(WebContext webContext)
Sets web context.

Parameters:
webContext - web context


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.