Class ResolverServiceLayer
java.lang.Object
com.google.web.bindery.requestfactory.server.ServiceLayer
com.google.web.bindery.requestfactory.server.ServiceLayerDecorator
com.google.web.bindery.requestfactory.server.ResolverServiceLayer
Implements all of the resolution methods in ServiceLayer.
-
Field Summary
Fields inherited from class com.google.web.bindery.requestfactory.server.ServiceLayerDecorator
nextFields inherited from class com.google.web.bindery.requestfactory.server.ServiceLayer
top -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the ClassLoader that should be used when attempting to access domain classes or resources.resolveClass(String typeToken) Given a type token previously returned fromServiceLayer.resolveTypeToken(Class), return the Class literal associated with the token.<T> Class<? extends T> resolveClientType(Class<?> domainClass, Class<T> clientClass, boolean required) Determine the type used by the client code to represent a given domain type.Class<?> resolveDomainClass(Class<?> clazz) Determine the domain (server-side) type that the given client type is mapped to.resolveDomainMethod(String operation) Return the domain service method associated with a RequestContext method declaration.Class<? extends RequestContext> resolveRequestContext(String operation) Find a RequestContext that should be used to fulfill the requested operation.resolveRequestContextMethod(String operation) Find a RequestContext method declaration by name.Class<? extends RequestFactory> resolveRequestFactory(String binaryName) Loads and validates a RequestFactory interface.Class<?> resolveServiceClass(Class<? extends RequestContext> requestContextClass) Given aRequestContextmethod, find the service class referenced in theServiceorServiceNameannotation.resolveTypeToken(Class<? extends BaseProxy> clazz) Return a string used to represent the given type in the wire protocol.Methods inherited from class com.google.web.bindery.requestfactory.server.ServiceLayerDecorator
createDomainObject, createLocator, createServiceInstance, createServiceLocator, die, getGetter, getId, getIdType, getNext, getProperty, getRequestReturnType, getSetter, getTop, getVersion, invoke, isLive, loadDomainObject, loadDomainObjects, report, report, requiresServiceLocator, resolveLocator, resolveServiceLocator, setProperty, validateMethods inherited from class com.google.web.bindery.requestfactory.server.ServiceLayer
create
-
Constructor Details
-
ResolverServiceLayer
ResolverServiceLayer()
-
-
Method Details
-
getDomainClassLoader
Description copied from class:ServiceLayerReturns the ClassLoader that should be used when attempting to access domain classes or resources.The default implementation returns
Thread.currentThread().getContextClassLoader().- Overrides:
getDomainClassLoaderin classServiceLayerDecorator
-
resolveClass
Description copied from class:ServiceLayerGiven a type token previously returned fromServiceLayer.resolveTypeToken(Class), return the Class literal associated with the token.- Overrides:
resolveClassin classServiceLayerDecorator- Parameters:
typeToken- a string token- Returns:
- the type represented by the token
-
resolveClientType
public <T> Class<? extends T> resolveClientType(Class<?> domainClass, Class<T> clientClass, boolean required) Description copied from class:ServiceLayerDetermine the type used by the client code to represent a given domain type. If multiple proxy types have been mapped to the same domain type, theclientTypeparameter is used to ensure assignability.- Overrides:
resolveClientTypein classServiceLayerDecorator- Parameters:
domainClass- the server-side type to be transported to the clientclientClass- the type to which the returned type must be assignablerequired- iftrueand no mapping is available, throw an exception, otherwise the method will returnnull- Returns:
- a class that represents
domainClasson the client which is assignable toclientType
-
resolveDomainClass
Description copied from class:ServiceLayerDetermine the domain (server-side) type that the given client type is mapped to.- Overrides:
resolveDomainClassin classServiceLayerDecorator- Parameters:
clazz- a client-side type- Returns:
- the domain type that
clientTyperepresents
-
resolveDomainMethod
Description copied from class:ServiceLayerReturn the domain service method associated with a RequestContext method declaration. TherequestContextMethodwill have been previously resolved by.invalid reference
#resolveRequestContextMethod(String, String)- Overrides:
resolveDomainMethodin classServiceLayerDecorator- Returns:
- the domain service method that should be invoked
-
resolveRequestContext
Description copied from class:ServiceLayerFind a RequestContext that should be used to fulfill the requested operation.- Overrides:
resolveRequestContextin classServiceLayerDecorator- Parameters:
operation- the operation- Returns:
- the RequestContext or
nullif no RequestContext exists that can fulfill the operation
-
resolveRequestContextMethod
Description copied from class:ServiceLayerFind a RequestContext method declaration by name.- Overrides:
resolveRequestContextMethodin classServiceLayerDecorator- Parameters:
operation- the operation's name- Returns:
- the method declaration, or
nullif the method does not exist
-
resolveRequestFactory
Description copied from class:ServiceLayerLoads and validates a RequestFactory interface.- Overrides:
resolveRequestFactoryin classServiceLayerDecorator- Parameters:
binaryName- the RequestFactory's type token (usually the type's binary name)- Returns:
- the RequestFactory type
-
resolveServiceClass
Description copied from class:ServiceLayerGiven aRequestContextmethod, find the service class referenced in theServiceorServiceNameannotation.- Overrides:
resolveServiceClassin classServiceLayerDecorator- Parameters:
requestContextClass- a RequestContext interface- Returns:
- the type of service to use
-
resolveTypeToken
Description copied from class:ServiceLayerReturn a string used to represent the given type in the wire protocol.- Overrides:
resolveTypeTokenin classServiceLayerDecorator- Parameters:
clazz- a client-side EntityProxy or ValueProxy type- Returns:
- the type token used to represent the proxy type
-