|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 ServiceLayerDecorator
T
- the requested domain typeclazz
- the requested domain type
public <T extends Locator<?,?>> T createLocator(java.lang.Class<T> clazz)
ServiceLayer
Locator
type.
createLocator
in class ServiceLayerDecorator
T
- the requested Locator typeclazz
- the requested Locator type
public java.lang.Object createServiceInstance(java.lang.Class<? extends RequestContext> requestContext)
ServiceLayer
createServiceInstance
in class ServiceLayerDecorator
requestContext
- the RequestContext type for which a service object
must be instantiated.
public <T extends ServiceLocator> T createServiceLocator(java.lang.Class<T> serviceLocatorType)
ServiceLayer
ServiceLocator
type.
createServiceLocator
in class ServiceLayerDecorator
T
- the requested ServiceLocator typeserviceLocatorType
- the requested ServiceLocator type
public java.lang.Object getId(java.lang.Object domainObject)
ServiceLayer
null
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 ServiceLayerDecorator
domainObject
- a domain object
null
if the
object is not persistentpublic java.lang.Class<?> getIdType(java.lang.Class<?> domainType)
ServiceLayer
findFoo()
or
Locator.getId()
expects to receive.
getIdType
in class ServiceLayerDecorator
domainType
- a domain entity type
public java.lang.Object getVersion(java.lang.Object domainObject)
ServiceLayer
null
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 ServiceLayerDecorator
domainObject
- a domain object
null
if the object is
not persistentpublic boolean isLive(java.lang.Object domainObject)
ServiceLayer
true
if the given domain object is still live (i.e. not
deleted) in the backing store.
isLive
in class ServiceLayerDecorator
domainObject
- a domain entity
true
if domainObject
could be retrieved at a later
point in timepublic <T> T loadDomainObject(java.lang.Class<T> clazz, java.lang.Object domainId)
ServiceLayer
null
to indicate that the requested object is no longer available.
loadDomainObject
in class ServiceLayerDecorator
T
- 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 ServiceLayerDecorator
contextMethod
- 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)
ServiceLayer
Locator
that should be used to access the given
domain type.
resolveLocator
in class ServiceLayerDecorator
domainType
- 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)
ServiceLayer
ServiceLocator
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 ServiceLayerDecorator
requestContext
- 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 |