Class ServiceResourcesImpl
- java.lang.Object
-
- org.apache.tapestry5.ioc.internal.ObjectLocatorImpl
-
- org.apache.tapestry5.ioc.internal.ServiceResourcesImpl
-
- All Implemented Interfaces:
ObjectLocator,AnnotationAccess,ModuleBuilderSource,ServiceBuilderResources,ServiceResources
public class ServiceResourcesImpl extends ObjectLocatorImpl implements ServiceBuilderResources
Implementation ofServiceBuilderResources. We just have one implementation that fills the purposes of methods that need aServiceResources(which includes service decorator methods) as well as methods that need aServiceBuilderResources(which is just service builder methods). Since it is most commonly used for the former, we'll just leave the name as ServiceResourcesImpl.
-
-
Constructor Summary
Constructors Constructor Description ServiceResourcesImpl(InternalRegistry registry, Module module, ServiceDef3 serviceDef, PlasticProxyFactory proxyFactory, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tautobuild(java.lang.Class<T> clazz)Autobuilds a class by finding the public constructor with the most parameters.<T> Tautobuild(java.lang.String description, java.lang.Class<T> clazz)Preferred version ofObjectLocator.autobuild(Class)that tracks the operation usingOperationTracker.invoke(String, org.apache.tapestry5.ioc.Invokable).AnnotationProvidergetClassAnnotationProvider()Returns a provider for annotations on the service class and interface.java.lang.ClassgetImplementationClass()org.slf4j.LoggergetLogger()Returns a Logger appropriate for logging messages.<K,V>
java.util.Map<K,V>getMappedConfiguration(java.lang.Class<K> keyType, java.lang.Class<V> valueType)AnnotationProvidergetMethodAnnotationProvider(java.lang.String methodName, java.lang.Class... parameterTypes)Returns a provider for annotations of a method of the class.java.lang.ObjectgetModuleBuilder()Returns the instantiated version of the Tapestry IoC module class.<T> java.util.List<T>getOrderedConfiguration(java.lang.Class<T> valueType)java.lang.StringgetServiceId()Returns the fully qualified id of the service.java.lang.ClassgetServiceImplementation()Returns the service implementation.java.lang.ClassgetServiceInterface()Returns the service interface implemented by the service.OperationTrackergetTracker()Returns an object that can be used to track operations related to constructing, configuring, decorating and initializing the service.<T> java.util.Collection<T>getUnorderedConfiguration(java.lang.Class<T> valueType)-
Methods inherited from class org.apache.tapestry5.ioc.internal.ObjectLocatorImpl
getObject, getService, getService, getService, proxy
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.tapestry5.commons.ObjectLocator
getObject, getService, getService, getService, proxy
-
-
-
-
Constructor Detail
-
ServiceResourcesImpl
public ServiceResourcesImpl(InternalRegistry registry, Module module, ServiceDef3 serviceDef, PlasticProxyFactory proxyFactory, org.slf4j.Logger logger)
-
-
Method Detail
-
getServiceId
public java.lang.String getServiceId()
Description copied from interface:ServiceResourcesReturns the fully qualified id of the service.- Specified by:
getServiceIdin interfaceServiceResources
-
getServiceInterface
public java.lang.Class getServiceInterface()
Description copied from interface:ServiceResourcesReturns the service interface implemented by the service.- Specified by:
getServiceInterfacein interfaceServiceResources
-
getServiceImplementation
public java.lang.Class getServiceImplementation()
Description copied from interface:ServiceResourcesReturns the service implementation.- Specified by:
getServiceImplementationin interfaceServiceResources
-
getLogger
public org.slf4j.Logger getLogger()
Description copied from interface:ServiceResourcesReturns a Logger appropriate for logging messages. This includes debug level messages about the creation and configuration of the underlying service, as well as debug, warning, or error level messages from the service itself. Often service interceptors will make use of the service's logger.- Specified by:
getLoggerin interfaceServiceResources
-
getUnorderedConfiguration
public <T> java.util.Collection<T> getUnorderedConfiguration(java.lang.Class<T> valueType)
- Specified by:
getUnorderedConfigurationin interfaceServiceBuilderResources
-
getOrderedConfiguration
public <T> java.util.List<T> getOrderedConfiguration(java.lang.Class<T> valueType)
- Specified by:
getOrderedConfigurationin interfaceServiceBuilderResources
-
getMappedConfiguration
public <K,V> java.util.Map<K,V> getMappedConfiguration(java.lang.Class<K> keyType, java.lang.Class<V> valueType)
- Specified by:
getMappedConfigurationin interfaceServiceBuilderResources
-
getModuleBuilder
public java.lang.Object getModuleBuilder()
Description copied from interface:ModuleBuilderSourceReturns the instantiated version of the Tapestry IoC module class.- Specified by:
getModuleBuilderin interfaceModuleBuilderSource
-
autobuild
public <T> T autobuild(java.lang.String description, java.lang.Class<T> clazz)
Description copied from interface:ObjectLocatorPreferred version ofObjectLocator.autobuild(Class)that tracks the operation usingOperationTracker.invoke(String, org.apache.tapestry5.ioc.Invokable).- Specified by:
autobuildin interfaceObjectLocator- Overrides:
autobuildin classObjectLocatorImpl- Parameters:
description- description used withOperationTrackerclazz- the type of object to instantiate- Returns:
- the instantiated instance
-
autobuild
public <T> T autobuild(java.lang.Class<T> clazz)
Description copied from interface:ObjectLocatorAutobuilds a class by finding the public constructor with the most parameters. Services and other resources or dependencies will be injected into the parameters of the constructor and into private fields marked with theInjectannotation. There are two cases: constructing a service implementation, and constructing an arbitrary object. In the former case, many service resources are also available for injection, not just dependencies or objects provided via the MasterObjectProvider service.- Specified by:
autobuildin interfaceObjectLocator- Overrides:
autobuildin classObjectLocatorImpl- Parameters:
clazz- the type of object to instantiate- Returns:
- the instantiated instance
-
getTracker
public OperationTracker getTracker()
Description copied from interface:ServiceResourcesReturns an object that can be used to track operations related to constructing, configuring, decorating and initializing the service.- Specified by:
getTrackerin interfaceServiceResources
-
getImplementationClass
public java.lang.Class getImplementationClass()
-
getClassAnnotationProvider
public AnnotationProvider getClassAnnotationProvider()
Description copied from interface:AnnotationAccessReturns a provider for annotations on the service class and interface. This will reflect annotations defined by the implementation class itself, plus annotations defined by the service interface (implementation class annotations take precedence).- Specified by:
getClassAnnotationProviderin interfaceAnnotationAccess- Returns:
- an AnnotationProvider instance.
-
getMethodAnnotationProvider
public AnnotationProvider getMethodAnnotationProvider(java.lang.String methodName, java.lang.Class... parameterTypes)
Description copied from interface:AnnotationAccessReturns a provider for annotations of a method of the class. This includes annotations on the implementation method, plus annotations on the corresponding service interface method (if such a method exists), with precedence on the implementation class method annotations.- Specified by:
getMethodAnnotationProviderin interfaceAnnotationAccess- Parameters:
methodName- the name of the method.parameterTypes- the types of the parameters of the method.- Returns:
- an AnnotationProvider instance. *
-
-