|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.google.web.bindery.requestfactory.server.ServiceLayer
com.google.web.bindery.requestfactory.server.ServiceLayerDecorator
com.google.web.bindery.requestfactory.server.LocatorServiceLayer
final class LocatorServiceLayer
Adds support to the ServiceLayer chain for using Locator and
ServiceLocator helper objects.
| Field Summary |
|---|
| Fields inherited from class com.google.web.bindery.requestfactory.server.ServiceLayerDecorator |
|---|
next |
| Fields inherited from class com.google.web.bindery.requestfactory.server.ServiceLayer |
|---|
top |
| Constructor Summary | |
|---|---|
LocatorServiceLayer()
|
|
| Method Summary | ||
|---|---|---|
|
createDomainObject(java.lang.Class<T> clazz)
Create an instance of the requested domain type. |
|
|
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. |
|
|
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. |
|
|
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. |
|
| Methods inherited from class com.google.web.bindery.requestfactory.server.ServiceLayerDecorator |
|---|
die, getDomainClassLoader, getGetter, getNext, getProperty, getRequestReturnType, getSetter, getTop, invoke, loadDomainObjects, report, report, resolveClass, resolveClientType, resolveDomainClass, resolveDomainMethod, resolveRequestContext, resolveRequestContextMethod, resolveRequestFactory, resolveServiceClass, resolveTypeToken, setProperty, validate |
| Methods inherited from class com.google.web.bindery.requestfactory.server.ServiceLayer |
|---|
create |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
LocatorServiceLayer()
| Method Detail |
|---|
public <T> T createDomainObject(java.lang.Class<T> clazz)
ServiceLayer
createDomainObject in class ServiceLayerDecoratorT - the requested domain typeclazz - the requested domain type
public <T extends Locator<?,?>> T createLocator(java.lang.Class<T> clazz)
ServiceLayerLocator type.
createLocator in class ServiceLayerDecoratorT - the requested Locator typeclazz - the requested Locator type
public java.lang.Object createServiceInstance(java.lang.Class<? extends RequestContext> requestContext)
ServiceLayer
createServiceInstance 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 type
public 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 object
null 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 type
public 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 object
null 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 entity
true if domainObject could be retrieved at a later
point in time
public <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 irretrievable
public 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 method
true 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) type
null 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
|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||