| org.apache.tapestry.ioc.ObjectLocator
All known Subclasses: org.apache.tapestry.ioc.internal.ObjectLocatorImpl,
ObjectLocator | public interface ObjectLocator (Code) | | Defines an object which can provide access to services defined within a
org.apache.tapestry.ioc.Registry , or to objects or object instances available by other
means. Services are accessed via service id, or (when appropriate) by just service interface. The
Registry itself implements this interface, as does
org.apache.tapestry.ioc.ServiceResources .
|
autobuild | T autobuild(Class<T> clazz)(Code) | | Autobuilds a class by finding the public constructor with the most parameters. Services and
resources will be injected into the parameters of the constructor.
< Parameters: T - > Parameters: clazz - the type of object to instantiate the instantiated instance throws: RuntimeException - if the autobuild fails |
getObject | T getObject(Class<T> objectType, AnnotationProvider annotationProvider)(Code) | | Obtains an object indirectly, using an
ObjectProvider identified by the prefix of the
reference.
Parameters: objectType - the type of object to be returned Parameters: annotationProvider - provides access to annotations on the field or parameter for which a value is tobe obtained, which may be utilized in selecting an appropriate object, usenull when annotations are not available (in which case,selection will be based only on the object type)< Parameters: T - > the requested object See Also: ObjectProvider |
getService | T getService(String serviceId, Class<T> serviceInterface)(Code) | | Obtains a service via its unique service id. Returns the service's proxy. The service proxy
implements the same interface as the actual service, and is used to instantiate the actual
service only as needed (this is transparent to the application).
< Parameters: T - > Parameters: serviceId - unique ervice id used to locate the service object (may contain symbols,which will be expanded), case is ignored Parameters: serviceInterface - the interface implemented by the service (or an interface extended by the serviceinterface) the service instance throws: RuntimeException - if the service is not defined, or if an error occurs instantiating it |
getService | T getService(Class<T> serviceInterface)(Code) | | Locates a service given just a service interface. A single service must implement the service
interface (which can be hard to guarantee). The search takes into account inheritance of the
service interface (not the service implementation), which may result in a failure
due to extra matches.
< Parameters: T - > Parameters: serviceInterface - the interface the service implements the service's proxy throws: RuntimeException - if the service does not exist (this is considered programmer error), or multipleservices directly implement, or extend from, the service interface |
|
|