Class ModuleImpl
java.lang.Object
org.apache.tapestry5.ioc.internal.ModuleImpl
- All Implemented Interfaces:
Module
,ModuleBuilderSource
-
Constructor Summary
ConstructorsConstructorDescriptionModuleImpl
(InternalRegistry registry, ServiceActivityTracker tracker, ModuleDef moduleDef, PlasticProxyFactory proxyFactory, org.slf4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Locates services with theEagerLoad
annotation and generates proxies for them, then adds them to the proxies list for instantiation.findMatchingDecoratorDefs
(ServiceDef serviceDef) Iterates over any decorator definitions defined by the module and returns those that apply to the provided service definition.findMatchingServiceAdvisors
(ServiceDef serviceDef) Iterates over any advisor definitions defined by the module and returns those that apply to the provided service definition.findServiceIdsForInterface
(Class serviceInterface) Locates the ids of all services that implement the provided service interface, or whose service interface is assignable to the provided service interface (is a super-class or super-interface).getContributorDefsForService
(ServiceDef serviceDef) Finds any contributions that are targeted at the indicated service.Returns the name used to obtain a logger for the module.Returns the instantiated version of the Tapestry IoC module class.<T> T
getService
(String serviceId, Class<T> serviceInterface) Locates a service given a service id and the corresponding service interface type.getServiceDef
(String serviceId) Returns the service definition for the given service id.toString()
-
Constructor Details
-
ModuleImpl
public ModuleImpl(InternalRegistry registry, ServiceActivityTracker tracker, ModuleDef moduleDef, PlasticProxyFactory proxyFactory, org.slf4j.Logger logger)
-
-
Method Details
-
getService
Description copied from interface:Module
Locates a service given a service id and the corresponding service interface type.- Specified by:
getService
in interfaceModule
- Parameters:
serviceId
- identifies the service to accessserviceInterface
- the interface the service implements- Returns:
- the service's proxy
-
findMatchingDecoratorDefs
Description copied from interface:Module
Iterates over any decorator definitions defined by the module and returns those that apply to the provided service definition.- Specified by:
findMatchingDecoratorDefs
in interfaceModule
- Parameters:
serviceDef
- for which decorators are being assembled- Returns:
- set of decorators, possibly empty (but not null)
-
findMatchingServiceAdvisors
Description copied from interface:Module
Iterates over any advisor definitions defined by the module and returns those that apply to the provided service definition.- Specified by:
findMatchingServiceAdvisors
in interfaceModule
- Parameters:
serviceDef
- for which advisors are being assembled- Returns:
- set of advisors, possibly empty but not null
-
findServiceIdsForInterface
Description copied from interface:Module
Locates the ids of all services that implement the provided service interface, or whose service interface is assignable to the provided service interface (is a super-class or super-interface).- Specified by:
findServiceIdsForInterface
in interfaceModule
- Parameters:
serviceInterface
- the interface to search for- Returns:
- a collection of service ids
-
collectEagerLoadServices
Description copied from interface:Module
Locates services with theEagerLoad
annotation and generates proxies for them, then adds them to the proxies list for instantiation.- Specified by:
collectEagerLoadServices
in interfaceModule
- Parameters:
proxies
- collection of proxies to which any eager load services in the module should be added
-
getModuleBuilder
Description copied from interface:ModuleBuilderSource
Returns the instantiated version of the Tapestry IoC module class.- Specified by:
getModuleBuilder
in interfaceModuleBuilderSource
-
getContributorDefsForService
Description copied from interface:Module
Finds any contributions that are targeted at the indicated service.- Specified by:
getContributorDefsForService
in interfaceModule
-
getServiceDef
Description copied from interface:Module
Returns the service definition for the given service id.- Specified by:
getServiceDef
in interfaceModule
- Parameters:
serviceId
- unique id for the service (caseless)- Returns:
- the service definition or null
-
getLoggerName
Description copied from interface:Module
Returns the name used to obtain a logger for the module. Services within the module suffix this with a period and the service id.- Specified by:
getLoggerName
in interfaceModule
- Returns:
- module logger name
-
toString
-