final class LocatorServiceLayer extends ServiceLayerDecorator
Locator and
ServiceLocator helper objects.nexttop| Constructor and Description |
|---|
LocatorServiceLayer() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
createDomainObject(java.lang.Class<T> clazz)
Create an instance of the requested domain type.
|
<T extends Locator<?,?>> |
createLocator(java.lang.Class<T> clazz)
Create an instance of the requested
Locator type. |
java.lang.Object |
createServiceInstance(java.lang.Class<? extends RequestContext> requestContext)
Create an instance of a service object that can be used as the target for
the given method invocation.
|
<T extends ServiceLocator> |
createServiceLocator(java.lang.Class<T> serviceLocatorType)
Create an instance of the requested
ServiceLocator type. |
java.lang.Object |
getId(java.lang.Object domainObject)
Return the persistent id for a domain object.
|
java.lang.Class<?> |
getIdType(java.lang.Class<?> domainType)
Returns the type of object the domain type's
findFoo() or
Locator.getId() expects to receive. |
java.lang.Object |
getVersion(java.lang.Object domainObject)
May return
null to indicate that the domain object has not been
persisted. |
boolean |
isLive(java.lang.Object domainObject)
Returns
true if the given domain object is still live (i.e. |
<T> T |
loadDomainObject(java.lang.Class<T> clazz,
java.lang.Object domainId)
Load an object from the backing store.
|
boolean |
requiresServiceLocator(java.lang.reflect.Method contextMethod,
java.lang.reflect.Method domainMethod)
Returns true if the context method returns a
Request and the domain
method is non-static. |
java.lang.Class<? extends Locator<?,?>> |
resolveLocator(java.lang.Class<?> domainType)
Return the type of
Locator that should be used to access the given
domain type. |
java.lang.Class<? extends ServiceLocator> |
resolveServiceLocator(java.lang.Class<? extends RequestContext> requestContext)
Given a RequestContext method declaration, resolve the
ServiceLocator that should be used when invoking the domain method. |
die, getDomainClassLoader, getGetter, getNext, getProperty, getRequestReturnType, getSetter, getTop, invoke, loadDomainObjects, report, report, resolveClass, resolveClientType, resolveDomainClass, resolveDomainMethod, resolveRequestContext, resolveRequestContextMethod, resolveRequestFactory, resolveServiceClass, resolveTypeToken, setProperty, validatecreatepublic <T> T createDomainObject(java.lang.Class<T> clazz)
ServiceLayercreateDomainObject in class ServiceLayerDecoratorT - the requested domain typeclazz - the requested domain typepublic <T extends Locator<?,?>> T createLocator(java.lang.Class<T> clazz)
ServiceLayerLocator type.createLocator in class ServiceLayerDecoratorT - the requested Locator typeclazz - the requested Locator typepublic java.lang.Object createServiceInstance(java.lang.Class<? extends RequestContext> requestContext)
ServiceLayercreateServiceInstance in class ServiceLayerDecoratorrequestContext - the RequestContext type for which a service object
must be instantiated.public <T extends ServiceLocator> T createServiceLocator(java.lang.Class<T> serviceLocatorType)
ServiceLayerServiceLocator type.createServiceLocator in class ServiceLayerDecoratorT - the requested ServiceLocator typeserviceLocatorType - the requested ServiceLocator typepublic java.lang.Object getId(java.lang.Object domainObject)
ServiceLayernull to
indicate that the domain object has not been persisted. The value returned
from this method must be a simple type (e.g. Integer, String) or a domain
type for which a mapping to an EntityProxy or Value proxy exists.
The values returned from this method may be passed to
ServiceLayer.loadDomainObject(Class, Object) in the future.
getId in class ServiceLayerDecoratordomainObject - a domain objectnull if the
object is not persistentpublic java.lang.Class<?> getIdType(java.lang.Class<?> domainType)
ServiceLayerfindFoo() or
Locator.getId() expects to receive.getIdType in class ServiceLayerDecoratordomainType - a domain entity typepublic java.lang.Object getVersion(java.lang.Object domainObject)
ServiceLayernull to indicate that the domain object has not been
persisted. The value returned from this method must be a simple type (e.g.
Integer, String) or a domain type for which a mapping to an EntityProxy or
Value proxy exists.getVersion in class ServiceLayerDecoratordomainObject - a domain objectnull if the object is
not persistentpublic boolean isLive(java.lang.Object domainObject)
ServiceLayertrue if the given domain object is still live (i.e. not
deleted) in the backing store.isLive in class ServiceLayerDecoratordomainObject - a domain entitytrue if domainObject could be retrieved at a later
point in timepublic <T> T loadDomainObject(java.lang.Class<T> clazz,
java.lang.Object domainId)
ServiceLayernull
to indicate that the requested object is no longer available.loadDomainObject in class ServiceLayerDecoratorT - the type of object to loadclazz - the type of object to loaddomainId - an id previously returned from ServiceLayer.getId(Object)null if it is irretrievablepublic boolean requiresServiceLocator(java.lang.reflect.Method contextMethod,
java.lang.reflect.Method domainMethod)
Request and the domain
method is non-static.requiresServiceLocator in class ServiceLayerDecoratorcontextMethod - a method defined in a RequestContextdomainMethod - a domain methodtrue if a ServiceLocator is requiredpublic java.lang.Class<? extends Locator<?,?>> resolveLocator(java.lang.Class<?> domainType)
ServiceLayerLocator that should be used to access the given
domain type.resolveLocator in class ServiceLayerDecoratordomainType - a domain (server-side) typenull if the type conforms to
the RequestFactory entity protocolpublic java.lang.Class<? extends ServiceLocator> resolveServiceLocator(java.lang.Class<? extends RequestContext> requestContext)
ServiceLayerServiceLocator that should be used when invoking the domain method.
This method will only be called if
ServiceLayer.requiresServiceLocator(Method, Method) returned true for
the associated domain method.resolveServiceLocator in class ServiceLayerDecoratorrequestContext - the RequestContext for which a ServiceLocator must be
located