Class SystemGwtRpc
SystemGwtRpc
class is a specialized GWT-RPC which can be used
to handle remote calls to services of the Pentaho Platform itself, e.g. /ws/gwt/serviceName
.
System GWT remote services must be registered in the Spring container file pentahoServices.spring.xml
as a bean whose identifier has the structure: ws-gwt-<serviceName>
.
For example:
<bean id="ws-gwt-<serviceName>" />
This service would be exposed in the URL /ws/gwt/<serviceName>
.
If the service name itself is composed of multiple sections, separated by -
,
these will be reflected in the service's URL.
For example, if <serviceName>
would be products-manager
,
then the remote service would be exposed in the URL /ws/gwt/products/manager
.
System remote services load GWT serialization policies from the directory of the root class loader of the Pentaho web application.
For example, if the GWT module making the remote call lives at /mantle
,
then the serialization policy file name, given its strong name, would be:
/mantle/<strongName>.gwt.rpc
.
-
Field Summary
Fields inherited from class org.pentaho.platform.web.gwt.rpc.AbstractGwtRpc
HTTP_GWT_RPC_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SystemGwtRpc
getInstance
(javax.servlet.http.HttpServletRequest httpRequest) Gets the instance ofSystemGwtRpc
which is associated with the given HTTP request, creating one, if needed.static SystemGwtRpc
getInstance
(javax.servlet.http.HttpServletRequest httpRequest, IGwtRpcSerializationPolicyCache serializationPolicyCache) Gets the instance ofSystemGwtRpc
which is associated with the given HTTP request, creating one, if needed.protected com.google.gwt.user.server.rpc.SerializationPolicy
loadSerializationPolicy
(String moduleContextPath, String strongName) Loads the serialization policy having the given GWT module context path and strong name.protected Object
Resolves the target object on which the remote call will be made.Methods inherited from class org.pentaho.platform.web.gwt.rpc.AbstractGwtRpc
getAppContextPath, getDefaultSerializationPolicy, getInstance, getRequest, getRequestPayload, getSerializationPolicy, getSerializationPolicyCache, getServletContext, getServletContextPath, getServletRequest, getTarget, getTargetClassLoader, invoke, loadSerializationPolicyFromInputStream, setSerializationPolicyCache
-
Constructor Details
-
SystemGwtRpc
public SystemGwtRpc(@NonNull javax.servlet.http.HttpServletRequest request)
-
-
Method Details
-
resolveTarget
Description copied from class:AbstractGwtRpc
Resolves the target object on which the remote call will be made.- Specified by:
resolveTarget
in classAbstractGwtRpc
- Returns:
- The target object.
- Throws:
GwtRpcProxyException
- if the target object cannot be resolved.
-
loadSerializationPolicy
@Nullable protected com.google.gwt.user.server.rpc.SerializationPolicy loadSerializationPolicy(@NonNull String moduleContextPath, @Nullable String strongName) Description copied from class:AbstractGwtRpc
Loads the serialization policy having the given GWT module context path and strong name.Typically, this method loads a serialization policy from a persistence medium.
- Specified by:
loadSerializationPolicy
in classAbstractGwtRpc
- Parameters:
moduleContextPath
- The GWT module context path (e.g./content/data-access/resources/gwt/
).strongName
- The serialization policy strong name.- Returns:
- The associated serialization policy, if one can be loaded;
null
, otherwise, in which case the default serialization policy is assumed, as returned byAbstractGwtRpc.getDefaultSerializationPolicy()
.
-
getInstance
@NonNull public static SystemGwtRpc getInstance(@NonNull javax.servlet.http.HttpServletRequest httpRequest) Gets the instance ofSystemGwtRpc
which is associated with the given HTTP request, creating one, if needed.This method does not use a
IGwtRpcSerializationPolicyCache
which becomes associated to a created instance for retrieving the appropriate serialization policy. To specify a serialization policy cache, use the methodgetInstance(HttpServletRequest, IGwtRpcSerializationPolicyCache)
.- Parameters:
httpRequest
- The HTTP request.- Returns:
- The associated
SystemGwtRpc
instance.
-
getInstance
@NonNull public static SystemGwtRpc getInstance(@NonNull javax.servlet.http.HttpServletRequest httpRequest, @Nullable IGwtRpcSerializationPolicyCache serializationPolicyCache) Gets the instance ofSystemGwtRpc
which is associated with the given HTTP request, creating one, if needed.When the instance needs to be created, the given
IGwtRpcSerializationPolicyCache
, viaserializationPolicyCache
, is associated with it.- Parameters:
httpRequest
- The HTTP request.serializationPolicyCache
- A serialization policy cache instance to initialize a created instance with.- Returns:
- The associated
SystemGwtRpc
instance. - See Also:
-