fr.ifremer.wao.ui.services
Class AppModule

java.lang.Object
  extended by fr.ifremer.wao.ui.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.

Author:
fdesbois

Nested Class Summary
protected static class AppModule.ResponseWrapper
           
protected static class AppModule.TimingFilter
           
 
Constructor Summary
AppModule()
           
 
Method Summary
static void bind(org.apache.tapestry5.ioc.ServiceBinder binder)
           
 ServiceAuthentication buildServiceAuthentication(org.apache.tapestry5.services.ApplicationStateManager stateManager)
           
 ServiceBoat buildServiceBoat(WaoManager manager)
           
 ServiceCartography buildServiceCartography(WaoManager manager, ServiceChart serviceChart, ServiceSynthesis serviceSynthesis)
           
 ServiceChart buildServiceChart(org.apache.tapestry5.services.PageRenderLinkSource pageRender)
           
 ServiceChart buildServiceChartServlet()
           
 ServiceContact buildServiceContact(WaoManager manager)
           
 ServiceNews buildServiceNews(WaoManager manager)
           
 ServiceReferential buildServiceReferential(WaoManager manager)
           
 ServiceSampling buildServiceSampling(WaoManager manager)
           
 ServiceSynthesis buildServiceSynthesis(WaoManager manager)
           
 ServiceUser buildServiceUser(WaoManager manager)
           
 org.apache.tapestry5.services.RequestFilter buildTimingFilter(org.slf4j.Logger log)
          This is a service definition, the service will be named "TimingFilter".
 WaoManager buildWaoManager(org.apache.tapestry5.ioc.services.RegistryShutdownHub hub)
          Use EagerLoad to build manager at startup.
static void contributeApplicationDefaults(org.apache.tapestry5.ioc.MappedConfiguration<String,String> configuration)
           
 void contributeApplicationStateManager(org.apache.tapestry5.ioc.MappedConfiguration<Class<?>,org.apache.tapestry5.services.ApplicationStateContribution> configuration, ServiceAuthentication serviceAuthentication)
          Used to instanciate SessionState ConnectedUser when session expires.
static void contributeComponentRequestHandler(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.services.ComponentRequestFilter> configuration)
          Contribution to ComponentRequestHandler service.
static void contributeRegistryStartup(org.apache.tapestry5.ioc.OrderedConfiguration<Runnable> configuration, WaoManager manager, ServiceUser serviceUser, org.apache.tapestry5.services.PersistentLocale persistentLocale)
          Execute WaoManager when registry startup.
 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.
static void contributeTypeCoercer(org.apache.tapestry5.ioc.Configuration<org.apache.tapestry5.ioc.services.CoercionTuple<?,?>> configuration)
          Contribute to Coercion of Tapestry for PieChartData used as page context.
 
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)

buildWaoManager

@EagerLoad
public WaoManager buildWaoManager(org.apache.tapestry5.ioc.services.RegistryShutdownHub hub)
Use EagerLoad to build manager at startup. The manager will control the application lifecycle (start and stop).

Parameters:
hub - to register the manager in the tapestry registry shutdown
Returns:
the new instance of WaoManager

contributeRegistryStartup

public static void contributeRegistryStartup(org.apache.tapestry5.ioc.OrderedConfiguration<Runnable> configuration,
                                             WaoManager manager,
                                             ServiceUser serviceUser,
                                             org.apache.tapestry5.services.PersistentLocale persistentLocale)
Execute WaoManager when registry startup. The manager will be instantiated using buildWaoManager(org.apache.tapestry5.ioc.services.RegistryShutdownHub). The serviceUser is needed to start the application.

Parameters:
configuration - to add the manager to registry startup
manager - to launch at startup
serviceUser - needed for manager start

buildServiceNews

public ServiceNews buildServiceNews(WaoManager manager)

buildServiceReferential

public ServiceReferential buildServiceReferential(WaoManager manager)

buildServiceBoat

public ServiceBoat buildServiceBoat(WaoManager manager)

buildServiceUser

public ServiceUser buildServiceUser(WaoManager manager)

buildServiceSampling

public ServiceSampling buildServiceSampling(WaoManager manager)

buildServiceContact

public ServiceContact buildServiceContact(WaoManager manager)

buildServiceSynthesis

public ServiceSynthesis buildServiceSynthesis(WaoManager manager)

buildServiceChart

public ServiceChart buildServiceChart(org.apache.tapestry5.services.PageRenderLinkSource pageRender)

buildServiceChartServlet

public ServiceChart buildServiceChartServlet()

buildServiceAuthentication

public ServiceAuthentication buildServiceAuthentication(org.apache.tapestry5.services.ApplicationStateManager stateManager)

buildServiceCartography

public ServiceCartography buildServiceCartography(WaoManager manager,
                                                  @InjectService(value="serviceChart")
                                                  ServiceChart serviceChart,
                                                  ServiceSynthesis serviceSynthesis)

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.

Parameters:
log -
Returns:

contributeApplicationStateManager

public void contributeApplicationStateManager(org.apache.tapestry5.ioc.MappedConfiguration<Class<?>,org.apache.tapestry5.services.ApplicationStateContribution> configuration,
                                              ServiceAuthentication serviceAuthentication)
Used to instanciate SessionState ConnectedUser when session expires.

Parameters:
configuration - to add the ApplicationStateCreator.
serviceAuthentication - used to instantiate the new user

contributeComponentRequestHandler

public static void contributeComponentRequestHandler(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.services.ComponentRequestFilter> configuration)
Contribution to ComponentRequestHandler service. The RequiresAuthenticationFilter is added to the configuration of the service to provide authentication managment on user connected.

Parameters:
configuration -
See Also:
ServiceAuthentication, RequiresAuthenticationFilter, ComponentRequestFilter

contributeTypeCoercer

public static void contributeTypeCoercer(org.apache.tapestry5.ioc.Configuration<org.apache.tapestry5.ioc.services.CoercionTuple<?,?>> configuration)
Contribute to Coercion of Tapestry for PieChartData used as page context.

Parameters:
configuration - Coercion configuration
See Also:
PieChart

contributeRequestHandler

public void contributeRequestHandler(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.services.RequestFilter> configuration,
                                     @Local
                                     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.



Copyright © 2009-2012 Ifremer. All Rights Reserved.