org.tynamo.jpa.sample.services
Class AppModule

java.lang.Object
  extended by org.tynamo.jpa.sample.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 adviseTransactions(JPATransactionAdvisor advisor, org.apache.tapestry5.ioc.MethodAdviceReceiver receiver)
           
static void bind(org.apache.tapestry5.ioc.ServiceBinder binder)
           
 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)
           
 
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)

contributeApplicationDefaults

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

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 Logger 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.


adviseTransactions

@Match(value="*Service")
public static void adviseTransactions(JPATransactionAdvisor advisor,
                                            org.apache.tapestry5.ioc.MethodAdviceReceiver receiver)


Copyright © 2009-2010. All Rights Reserved.