org.apache.tapestry5.ioc.services
Class TapestryIOCModule

java.lang.Object
  extended by org.apache.tapestry5.ioc.services.TapestryIOCModule

@Marker(value=Builtin.class)
public final class TapestryIOCModule
extends Object

Defines the base set of services for the Tapestry IOC container.


Constructor Summary
TapestryIOCModule()
           
 
Method Summary
static void bind(ServiceBinder binder)
           
static ServiceLifecycleSource build(Map<String,ServiceLifecycle> configuration)
          Provides access to additional service lifecycles.
static ParallelExecutor buildDeferredExecution(int coreSize, int maxSize, int keepAliveMillis, boolean threadPoolEnabled, int queueSize, PerthreadManager perthreadManager, RegistryShutdownHub shutdownHub, ThunkCreator thunkCreator)
           
static void provideBasicTypeCoercions(Configuration<CoercionTuple> configuration)
          Contributes a set of standard type coercions to the TypeCoercer service: Object to String Object to Boolean String to Double String to BigDecimal BigDecimal to Double Double to BigDecimal String to BigInteger BigInteger to Long String to Long Long to Byte Long to Short Long to Integer Double to Long Double to Float Float to Double Long to Double String to Boolean ("false" is always false, other non-blank strings are true) Number to Boolean (true if number value is non zero) Null to Boolean (always false) Collection to Boolean (false if empty) Object[] to List primitive[] to List Object to List (by wrapping as a singleton list) String to File String to TimeInterval TimeInterval to Long Object to Object[] (wrapping the object as an array) Collection to Object[] (via the toArray() method) Flow to List Flow to Boolean (false if empty)
static void providePerthreadScope(MappedConfiguration<String,ServiceLifecycle> configuration)
          Contributes the "perthread" scope.
static void setupDefaultSymbols(MappedConfiguration<String,Object> configuration)
           
static void setupObjectProviders(OrderedConfiguration<ObjectProvider> configuration, ServiceOverride serviceOverride)
           AnnotationBasedContributions Empty placeholder used to separate annotation-based ObjectProvider contributions (which come before) from non-annotation based (such as ServiceOverride) which come after. Value Supports the Value annotation Symbol Supports the Symbol annotations Autobuild Supports the Autobuild annotation ServiceOverride Allows simple service overrides via the ServiceOverride service (and its configuration)
static void setupStandardSymbolProviders(OrderedConfiguration<SymbolProvider> configuration, SymbolProvider applicationDefaults, SymbolProvider factoryDefaults)
           SystemProperties Exposes JVM System properties as symbols (currently case-sensitive) EnvironmentVariables Exposes environment variables as symbols (adding a "env." prefix) ApplicationDefaults Values contributed to @SymbolProvider @ApplicationDefaults FactoryDefaults Values contributed to @SymbolProvider @FactoryDefaults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TapestryIOCModule

public TapestryIOCModule()
Method Detail

bind

public static void bind(ServiceBinder binder)

build

@PreventServiceDecoration
public static ServiceLifecycleSource build(Map<String,ServiceLifecycle> configuration)
Provides access to additional service lifecycles. One lifecycle is built in ("singleton") but additional ones are accessed via this service (and its mapped configuration). Only proxiable services (those with explicit service interfaces) can be managed in terms of a lifecycle.


providePerthreadScope

@Contribute(value=ServiceLifecycleSource.class)
public static void providePerthreadScope(MappedConfiguration<String,ServiceLifecycle> configuration)
Contributes the "perthread" scope.


setupObjectProviders

@Contribute(value=MasterObjectProvider.class)
public static void setupObjectProviders(OrderedConfiguration<ObjectProvider> configuration,
                                                                                  @Local
                                                                                  ServiceOverride serviceOverride)
AnnotationBasedContributions
Empty placeholder used to separate annotation-based ObjectProvider contributions (which come before) from non-annotation based (such as ServiceOverride) which come after.
Value
Supports the Value annotation
Symbol
Supports the Symbol annotations
Autobuild
Supports the Autobuild annotation
ServiceOverride
Allows simple service overrides via the ServiceOverride service (and its configuration)


provideBasicTypeCoercions

@Contribute(value=TypeCoercer.class)
public static void provideBasicTypeCoercions(Configuration<CoercionTuple> configuration)
Contributes a set of standard type coercions to the TypeCoercer service:


setupStandardSymbolProviders

@Contribute(value=SymbolSource.class)
public static void setupStandardSymbolProviders(OrderedConfiguration<SymbolProvider> configuration,
                                                                                  @ApplicationDefaults
                                                                                  SymbolProvider applicationDefaults,
                                                                                  @FactoryDefaults
                                                                                  SymbolProvider factoryDefaults)
SystemProperties
Exposes JVM System properties as symbols (currently case-sensitive)
EnvironmentVariables
Exposes environment variables as symbols (adding a "env." prefix)
ApplicationDefaults
Values contributed to @SymbolProvider @ApplicationDefaults
FactoryDefaults
Values contributed to @SymbolProvider @FactoryDefaults


buildDeferredExecution

public static ParallelExecutor buildDeferredExecution(@Symbol(value="tapestry.thread-pool.core-pool-size")
                                                      int coreSize,
                                                      @Symbol(value="tapestry.thread-pool.max-pool-size")
                                                      int maxSize,
                                                      @Symbol(value="tapestry.thread-pool.keep-alive")@IntermediateType(value=TimeInterval.class)
                                                      int keepAliveMillis,
                                                      @Symbol(value="tapestry.thread-pool-enabled")
                                                      boolean threadPoolEnabled,
                                                      @Symbol(value="tapestry.thread-pool.queue-size")
                                                      int queueSize,
                                                      PerthreadManager perthreadManager,
                                                      RegistryShutdownHub shutdownHub,
                                                      ThunkCreator thunkCreator)

setupDefaultSymbols

@Contribute(value=SymbolProvider.class)
@FactoryDefaults
public static void setupDefaultSymbols(MappedConfiguration<String,Object> configuration)


Copyright © 2003-2012 The Apache Software Foundation.