Interface InternalRegistry
-
- All Superinterfaces:
ObjectLocator
,OperationTracker
,Registry
,RegistryShutdownHub
- All Known Implementing Classes:
RegistryImpl
public interface InternalRegistry extends Registry, RegistryShutdownHub, OperationTracker
Internal view of the module registry, adding additional methods needed by modules.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.tapestry5.ioc.OperationTracker
OperationTracker.NonLoggableException
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
expandSymbols(java.lang.String input)
Given an input string that may contain symbols, returns the string with any and all symbols fully expanded.java.util.List<ServiceAdvisor>
findAdvisorsForService(ServiceDef3 serviceDef)
Searches for advisors for a particular service, returning them in order of application.java.util.List<ServiceDecorator>
findDecoratorsForService(ServiceDef3 serviceDef)
Searches for decorators for a particular service.<K,V>
java.util.Map<K,V>getMappedConfiguration(ServiceDef3 serviceDef, java.lang.Class<K> keyType, java.lang.Class<V> valueType)
Builds up a map of key/value pairs by invoking service contribution methods that target the service (from any module, unless the service is private).java.util.Set<java.lang.Class>
getMarkerAnnotations()
Returns a Set of Annotation classes that are used as service markers.<T> T
getObject(java.lang.Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator, Module localModule)
As withObjectLocator.getObject(Class, org.apache.tapestry5.commons.AnnotationProvider)
, but handles theLocal
annotation.<T> java.util.List<T>
getOrderedConfiguration(ServiceDef3 serviceDef, java.lang.Class<T> valueType)
Builds up an ordered collection by invoking service contributor methods that target the service (from any module, unless the service is private).ServiceLifecycle2
getServiceLifecycle(java.lang.String scope)
Returns a service lifecycle by service scope name.org.slf4j.Logger
getServiceLogger(java.lang.String serviceId)
Returns a logger for the service, which consists of the Module'slog name
suffixed with a period and the service id.<T> java.util.Collection<T>
getUnorderedConfiguration(ServiceDef3 serviceDef, java.lang.Class<T> valueType)
Builds up an unordered collection by invoking service contributor methods that target the service (from any module, unless the service is private).<T> T
proxy(java.lang.Class<T> interfaceClass, java.lang.Class<? extends T> implementationClass, ObjectLocator locator)
Creates a just-in-time (and possibly, live reloading) proxy for the indicated class and interface, using the provided locator to autobuild the implementationClass (when necessary).-
Methods inherited from interface org.apache.tapestry5.commons.ObjectLocator
autobuild, autobuild, getObject, getService, getService, getService, proxy
-
Methods inherited from interface org.apache.tapestry5.ioc.OperationTracker
invoke, perform, run
-
Methods inherited from interface org.apache.tapestry5.ioc.Registry
cleanupThread, performRegistryStartup, shutdown
-
Methods inherited from interface org.apache.tapestry5.ioc.services.RegistryShutdownHub
addRegistryShutdownListener, addRegistryShutdownListener, addRegistryWillShutdownListener
-
-
-
-
Method Detail
-
getObject
<T> T getObject(java.lang.Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator, Module localModule)
As withObjectLocator.getObject(Class, org.apache.tapestry5.commons.AnnotationProvider)
, but handles theLocal
annotation.- Parameters:
objectType
- type of object o be injectedannotationProvider
- access to annotations at point of injectionlocator
- used to resolve any subsequent injectionslocalModule
- module to limit services to, if Local annotaton present- Returns:
- the service or object
-
getServiceLifecycle
ServiceLifecycle2 getServiceLifecycle(java.lang.String scope)
Returns a service lifecycle by service scope name.- Parameters:
scope
- the name of the service scope (case insensitive)- Returns:
- the lifecycle corresponding to the scope
- Throws:
java.lang.RuntimeException
- if the lifecycle name does not match a known lifecycle
-
findDecoratorsForService
java.util.List<ServiceDecorator> findDecoratorsForService(ServiceDef3 serviceDef)
Searches for decorators for a particular service. The resultingDecoratorDef
s are ordered, then converted intoServiceDecorator
s.
-
findAdvisorsForService
java.util.List<ServiceAdvisor> findAdvisorsForService(ServiceDef3 serviceDef)
Searches for advisors for a particular service, returning them in order of application.- Since:
- 5.1.0.0
-
getUnorderedConfiguration
<T> java.util.Collection<T> getUnorderedConfiguration(ServiceDef3 serviceDef, java.lang.Class<T> valueType)
Builds up an unordered collection by invoking service contributor methods that target the service (from any module, unless the service is private).- Type Parameters:
T
-- Parameters:
serviceDef
- defines the service for which configuration data is being assembledvalueType
- identifies the type of object allowed into the collection- Returns:
- the final collection
-
getOrderedConfiguration
<T> java.util.List<T> getOrderedConfiguration(ServiceDef3 serviceDef, java.lang.Class<T> valueType)
Builds up an ordered collection by invoking service contributor methods that target the service (from any module, unless the service is private). Once all values have been added (each with an id, and pre/post constraints), the values are ordered, null values dropped, and the final sorted list is returned.- Type Parameters:
T
-- Parameters:
serviceDef
- defines the service for which configuration data is being assembledvalueType
- identifies the type of object allowed into the collection- Returns:
- the final ordered list
-
getMappedConfiguration
<K,V> java.util.Map<K,V> getMappedConfiguration(ServiceDef3 serviceDef, java.lang.Class<K> keyType, java.lang.Class<V> valueType)
Builds up a map of key/value pairs by invoking service contribution methods that target the service (from any module, unless the service is private). Values and keys may not be null. Invalid values (keys or values that are the wrong type, or duplicate keys) result in warnings and are ignored.- Type Parameters:
K
-V
-- Parameters:
serviceDef
- defines the service for which configuration data is being assembledkeyType
- identifies the type of key object allowed into the mapvalueType
- identifies the type of value object allowed into the map- Returns:
- the final ordered list
-
expandSymbols
java.lang.String expandSymbols(java.lang.String input)
Given an input string that may contain symbols, returns the string with any and all symbols fully expanded.- Parameters:
input
-- Returns:
- expanded input
-
getServiceLogger
org.slf4j.Logger getServiceLogger(java.lang.String serviceId)
Returns a logger for the service, which consists of the Module'slog name
suffixed with a period and the service id.- Parameters:
serviceId
-- Returns:
- the logger for the service
-
proxy
<T> T proxy(java.lang.Class<T> interfaceClass, java.lang.Class<? extends T> implementationClass, ObjectLocator locator)
Creates a just-in-time (and possibly, live reloading) proxy for the indicated class and interface, using the provided locator to autobuild the implementationClass (when necessary).- Since:
- 5.2.0
-
getMarkerAnnotations
java.util.Set<java.lang.Class> getMarkerAnnotations()
Returns a Set of Annotation classes that are used as service markers.- Since:
- 5.2.0
-
-