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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
expandSymbols(String input)
Given an input string that may contain symbols, returns the string with any and all symbols fully expanded.List<ServiceAdvisor>
findAdvisorsForService(ServiceDef3 serviceDef)
Searches for advisors for a particular service, returning them in order of application.List<ServiceDecorator>
findDecoratorsForService(ServiceDef3 serviceDef)
Searches for decorators for a particular service.<K,V>
Map<K,V>getMappedConfiguration(ServiceDef3 serviceDef, Class<K> keyType, 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).Set<Class>
getMarkerAnnotations()
Returns a Set of Annotation classes that are used as service markers.<T> T
getObject(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator, Module localModule)
As withObjectLocator.getObject(Class, org.apache.tapestry5.commons.AnnotationProvider)
, but handles theLocal
annotation.<T> List<T>
getOrderedConfiguration(ServiceDef3 serviceDef, 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(String scope)
Returns a service lifecycle by service scope name.org.slf4j.Logger
getServiceLogger(String serviceId)
Returns a logger for the service, which consists of the Module'slog name
suffixed with a period and the service id.<T> Collection<T>
getUnorderedConfiguration(ServiceDef3 serviceDef, 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(Class<T> interfaceClass, 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(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(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:
RuntimeException
- if the lifecycle name does not match a known lifecycle
-
findDecoratorsForService
List<ServiceDecorator> findDecoratorsForService(ServiceDef3 serviceDef)
Searches for decorators for a particular service. The resultingDecoratorDef
s are ordered, then converted intoServiceDecorator
s.
-
findAdvisorsForService
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> Collection<T> getUnorderedConfiguration(ServiceDef3 serviceDef, 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> List<T> getOrderedConfiguration(ServiceDef3 serviceDef, 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> Map<K,V> getMappedConfiguration(ServiceDef3 serviceDef, Class<K> keyType, 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
String expandSymbols(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(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(Class<T> interfaceClass, 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
Set<Class> getMarkerAnnotations()
Returns a Set of Annotation classes that are used as service markers.- Since:
- 5.2.0
-
-