org.equanda.test.gui.services
Class AppModule

java.lang.Object
  extended by org.equanda.test.gui.services.AppModule

public class AppModule
extends Object

This module is automatically included as part of the Tapestry IoC Registry, it's a good place to configure and extend Tapestry, or to place your own service definitions.


Constructor Summary
AppModule()
           
 
Method Summary
static void bind(org.apache.tapestry5.ioc.ServiceBinder binder)
          Bind extra services.
 org.apache.tapestry5.services.RequestFilter buildTimingFilter(org.slf4j.Logger log)
          This is a service definition, the service will be named "TimingFilter".
static void contributeApplicationDefaults(org.apache.tapestry5.ioc.MappedConfiguration<String,String> configuration)
          Contribute application defaults
 void contributeRequestHandler(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.services.RequestFilter> configuration, org.apache.tapestry5.services.RequestFilter filter)
          This is a contribution to the RequestHandler service configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppModule

public AppModule()
Method Detail

bind

public static void bind(org.apache.tapestry5.ioc.ServiceBinder binder)
Bind extra services.

Parameters:
binder - object to bind services to

contributeApplicationDefaults

public static void contributeApplicationDefaults(org.apache.tapestry5.ioc.MappedConfiguration<String,String> configuration)
Contribute application defaults

Parameters:
configuration - configuration to add to

buildTimingFilter

public org.apache.tapestry5.services.RequestFilter buildTimingFilter(org.slf4j.Logger log)
This is a service definition, the service will be named "TimingFilter". The interface, RequestFilter, is used within the RequestHandler service pipeline, which is built from the RequestHandler service configuration. Tapestry IoC is responsible for passing in an appropriate Log instance. Requests for static resources are handled at a higher level, so this filter will only be invoked for Tapestry related requests.

Service builder methods are useful when the implementation is inline as an inner class (as here) or require some other kind of special initialization. In most cases, use the static bind() method instead.

If this method was named "build", then the service id would be taken from the service interface and would be "RequestFilter". Since Tapestry already defines a service named "RequestFilter" we use an explicit service id that we can reference inside the contribution method.

Parameters:
log - log
Returns:
request filter

contributeRequestHandler

public void contributeRequestHandler(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.services.RequestFilter> configuration,
                                     @InjectService(value="TimingFilter")
                                     org.apache.tapestry5.services.RequestFilter filter)
This is a contribution to the RequestHandler service configuration. This is how we extend Tapestry using the timing filter. A common use for this kind of filter is transaction management or security.

Parameters:
configuration - configuration to add to
filter - filter info


Copyright © 2007-2008. All Rights Reserved.