Class ModuleImpl
- java.lang.Object
 - 
- org.apache.tapestry5.ioc.internal.ModuleImpl
 
 
- 
- All Implemented Interfaces:
 Module,ModuleBuilderSource
public class ModuleImpl extends Object implements Module
 
- 
- 
Constructor Summary
Constructors Constructor Description ModuleImpl(InternalRegistry registry, ServiceActivityTracker tracker, ModuleDef moduleDef, PlasticProxyFactory proxyFactory, org.slf4j.Logger logger) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollectEagerLoadServices(Collection<EagerLoadServiceProxy> proxies)Locates services with theEagerLoadannotation and generates proxies for them, then adds them to the proxies list for instantiation.Set<DecoratorDef>findMatchingDecoratorDefs(ServiceDef serviceDef)Iterates over any decorator definitions defined by the module and returns those that apply to the provided service definition.Set<AdvisorDef>findMatchingServiceAdvisors(ServiceDef serviceDef)Iterates over any advisor definitions defined by the module and returns those that apply to the provided service definition.Collection<String>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).Set<ContributionDef2>getContributorDefsForService(ServiceDef serviceDef)Finds any contributions that are targeted at the indicated service.StringgetLoggerName()Returns the name used to obtain a logger for the module.ObjectgetModuleBuilder()Returns the instantiated version of the Tapestry IoC module class.<T> TgetService(String serviceId, Class<T> serviceInterface)Locates a service given a service id and the corresponding service interface type.ServiceDef3getServiceDef(String serviceId)Returns the service definition for the given service id.StringtoString() 
 - 
 
- 
- 
Constructor Detail
- 
ModuleImpl
public ModuleImpl(InternalRegistry registry, ServiceActivityTracker tracker, ModuleDef moduleDef, PlasticProxyFactory proxyFactory, org.slf4j.Logger logger)
 
 - 
 
- 
Method Detail
- 
getService
public <T> T getService(String serviceId, Class<T> serviceInterface)
Description copied from interface:ModuleLocates a service given a service id and the corresponding service interface type.- Specified by:
 getServicein interfaceModule- Parameters:
 serviceId- identifies the service to accessserviceInterface- the interface the service implements- Returns:
 - the service's proxy
 
 
- 
findMatchingDecoratorDefs
public Set<DecoratorDef> findMatchingDecoratorDefs(ServiceDef serviceDef)
Description copied from interface:ModuleIterates over any decorator definitions defined by the module and returns those that apply to the provided service definition.- Specified by:
 findMatchingDecoratorDefsin interfaceModule- Parameters:
 serviceDef- for which decorators are being assembled- Returns:
 - set of decorators, possibly empty (but not null)
 
 
- 
findMatchingServiceAdvisors
public Set<AdvisorDef> findMatchingServiceAdvisors(ServiceDef serviceDef)
Description copied from interface:ModuleIterates over any advisor definitions defined by the module and returns those that apply to the provided service definition.- Specified by:
 findMatchingServiceAdvisorsin interfaceModule- Parameters:
 serviceDef- for which advisors are being assembled- Returns:
 - set of advisors, possibly empty but not null
 
 
- 
findServiceIdsForInterface
public Collection<String> findServiceIdsForInterface(Class serviceInterface)
Description copied from interface:ModuleLocates 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:
 findServiceIdsForInterfacein interfaceModule- Parameters:
 serviceInterface- the interface to search for- Returns:
 - a collection of service ids
 
 
- 
collectEagerLoadServices
public void collectEagerLoadServices(Collection<EagerLoadServiceProxy> proxies)
Description copied from interface:ModuleLocates services with theEagerLoadannotation and generates proxies for them, then adds them to the proxies list for instantiation.- Specified by:
 collectEagerLoadServicesin interfaceModule- Parameters:
 proxies- collection of proxies to which any eager load services in the module should be added
 
- 
getModuleBuilder
public Object getModuleBuilder()
Description copied from interface:ModuleBuilderSourceReturns the instantiated version of the Tapestry IoC module class.- Specified by:
 getModuleBuilderin interfaceModuleBuilderSource
 
- 
getContributorDefsForService
public Set<ContributionDef2> getContributorDefsForService(ServiceDef serviceDef)
Description copied from interface:ModuleFinds any contributions that are targeted at the indicated service.- Specified by:
 getContributorDefsForServicein interfaceModule
 
- 
getServiceDef
public ServiceDef3 getServiceDef(String serviceId)
Description copied from interface:ModuleReturns the service definition for the given service id.- Specified by:
 getServiceDefin interfaceModule- Parameters:
 serviceId- unique id for the service (caseless)- Returns:
 - the service definition or null
 
 
- 
getLoggerName
public String getLoggerName()
Description copied from interface:ModuleReturns 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:
 getLoggerNamein interfaceModule- Returns:
 - module logger name
 
 
 - 
 
 -