java.lang.Object | |
↳ | com.google.gwt.user.server.rpc.RPC |
Utility class for integrating with the RPC system. This class exposes methods for decoding of RPC requests, encoding of RPC responses, and invocation of RPC calls on service objects. The operations exposed by this class can be reused by framework implementors such as Spring and G4jsf to support a wide range of service invocation policies.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an
RPCRequest that is built by decoding the contents of an
encoded RPC request. | |||||||||||
Returns an
RPCRequest that is built by decoding the contents of an
encoded RPC request and optionally validating that type can handle the
request. | |||||||||||
Returns an
RPCRequest that is built by decoding the contents of an
encoded RPC request and optionally validating that type can handle the
request. | |||||||||||
Returns a string that encodes an exception.
| |||||||||||
Returns a string that encodes an exception.
| |||||||||||
Returns a string that encodes the object.
| |||||||||||
Returns a string that encodes the object.
| |||||||||||
Returns a default serialization policy.
| |||||||||||
Returns a string that encodes the result of calling a service method, which
could be the value returned by the method or an exception thrown by it.
| |||||||||||
Returns a string that encodes the result of calling a service method, which
could be the value returned by the method or an exception thrown by it.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Returns an RPCRequest
that is built by decoding the contents of an
encoded RPC request.
This method is equivalent to calling decodeRequest(String, Class)
with null
for the type parameter.
encodedRequest | a string that encodes the RemoteService
interface, the service method to call, and the arguments to for
the service method |
---|
RPCRequest
instanceIncompatibleRemoteServiceException | if any of the following
conditions apply:
|
---|
Returns an RPCRequest
that is built by decoding the contents of an
encoded RPC request and optionally validating that type can handle the
request. If the type parameter is not null
, the implementation
checks that the type is assignable to the RemoteService
interface
requested in the encoded request string.
If the serializationPolicyProvider parameter is not null
, it
is asked for a SerializationPolicy
to use to restrict the set of
types that can be decoded from the request. If this parameter is
null
, then only subtypes of
IsSerializable
or
types which have custom field serializers can be decoded.
Invoking this method with null
for the type parameter,
decodeRequest(encodedRequest, null)
, is equivalent to calling
decodeRequest(encodedRequest)
.
encodedRequest | a string that encodes the RemoteService
interface, the service method, and the arguments to pass to the
service method |
---|---|
type | if not null , the implementation checks that the
type is assignable to the RemoteService interface encoded
in the encoded request string. |
serializationPolicyProvider | if not null , the
implementation asks this provider for a
SerializationPolicy which will be used to restrict the set
of types that can be decoded from this request |
RPCRequest
instanceNullPointerException | if the encodedRequest is null |
---|---|
IllegalArgumentException | if the encodedRequest is an empty string |
IncompatibleRemoteServiceException | if any of the following
conditions apply:
|
Returns an RPCRequest
that is built by decoding the contents of an
encoded RPC request and optionally validating that type can handle the
request. If the type parameter is not null
, the implementation
checks that the type is assignable to the RemoteService
interface
requested in the encoded request string.
Invoking this method with null
for the type parameter,
decodeRequest(encodedRequest, null)
, is equivalent to calling
decodeRequest(encodedRequest)
.
encodedRequest | a string that encodes the RemoteService
interface, the service method, and the arguments to pass to the
service method |
---|---|
type | if not null , the implementation checks that the
type is assignable to the RemoteService interface encoded
in the encoded request string. |
RPCRequest
instanceNullPointerException | if the encodedRequest is null |
---|---|
IllegalArgumentException | if the encodedRequest is an empty string |
IncompatibleRemoteServiceException | if any of the following
conditions apply:
|
Returns a string that encodes an exception. If method is not
null
, it is an error if the exception is not in the method's
list of checked exceptions.
serviceMethod | the method that threw the exception, may be
null |
---|---|
cause | the Throwable that was thrown |
NullPointerException | if the the cause is null |
---|---|
SerializationException | if the result cannot be serialized |
UnexpectedException | if the result was an unexpected exception (a checked exception not declared in the serviceMethod's signature) |
Returns a string that encodes an exception. If method is not
null
, it is an error if the exception is not in the method's
list of checked exceptions.
If the serializationPolicy parameter is not null
, it is used
to determine what types can be encoded as part of this response. If this
parameter is null
, then only subtypes of
IsSerializable
or
types which have custom field serializers may be encoded.
serviceMethod | the method that threw the exception, may be
null |
---|---|
cause | the Throwable that was thrown |
serializationPolicy | determines the serialization policy to be used |
NullPointerException | if the the cause or the serializationPolicy
are null |
---|---|
SerializationException | if the result cannot be serialized |
UnexpectedException | if the result was an unexpected exception (a checked exception not declared in the serviceMethod's signature) |
SerializationException |
---|
Returns a string that encodes the object. It is an error to try to encode an object that is not assignable to the service method's return type.
serviceMethod | the method whose result we are encoding |
---|---|
object | the instance that we wish to encode |
IllegalArgumentException | if the result is not assignable to the service method's return type |
---|---|
NullPointerException | if the service method is null |
SerializationException | if the result cannot be serialized |
SerializationException |
---|
Returns a string that encodes the object. It is an error to try to encode an object that is not assignable to the service method's return type.
If the serializationPolicy parameter is not null
, it is used
to determine what types can be encoded as part of this response. If this
parameter is null
, then only subtypes of
IsSerializable
or
types which have custom field serializers may be encoded.
serviceMethod | the method whose result we are encoding |
---|---|
object | the instance that we wish to encode |
serializationPolicy | determines the serialization policy to be used |
IllegalArgumentException | if the result is not assignable to the service method's return type |
---|---|
NullPointerException | if the serviceMethod or the
serializationPolicy are null |
SerializationException | if the result cannot be serialized |
Returns a default serialization policy.
Returns a string that encodes the result of calling a service method, which could be the value returned by the method or an exception thrown by it.
If the serializationPolicy parameter is not null
, it is used
to determine what types can be encoded as part of this response. If this
parameter is null
, then only subtypes of
IsSerializable
or
types which have custom field serializers may be encoded.
This method does no security checking; security checking must be done on the method prior to this invocation.
target | instance on which to invoke the serviceMethod |
---|---|
serviceMethod | the method to invoke |
args | arguments used for the method invocation |
serializationPolicy | determines the serialization policy to be used |
NullPointerException | if the serviceMethod or the
serializationPolicy are null |
---|---|
SecurityException | if the method cannot be accessed or if the number or type of actual and formal arguments differ |
SerializationException | if an object could not be serialized by the stream |
UnexpectedException | if the serviceMethod throws a checked exception that is not declared in its signature |
Returns a string that encodes the result of calling a service method, which could be the value returned by the method or an exception thrown by it.
This method does no security checking; security checking must be done on the method prior to this invocation.
target | instance on which to invoke the serviceMethod |
---|---|
serviceMethod | the method to invoke |
args | arguments used for the method invocation |
SecurityException | if the method cannot be accessed or if the number or type of actual and formal arguments differ |
---|---|
SerializationException | if an object could not be serialized by the stream |
UnexpectedException | if the serviceMethod throws a checked exception that is not declared in its signature |
SerializationException |
---|