public class JavaRestService extends RestService
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<?> |
cls
The Java class defining this REST service.
|
private java.lang.reflect.Method |
method
The Java method (in the target
class ) which implements this service. |
cfg, definitionParameters, key, ls, serviceSignature, timeout
Constructor and Description |
---|
JavaRestService(java.lang.Class<?> cls,
java.lang.reflect.Method m,
LegacyService ls,
ServiceKey key,
int timeout)
Create a new REST service implemented in a Java method.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buildDefinitionParameters()
Build the parameter definitions, from the
LegacyServiceParameter annotations at the method
definition. |
protected ArgumentsParser |
getParser(ServiceArgumentsParser argumentsParser)
Get the parser to be used for parsing the arguments, to be attached to the service's parser.
|
protected ArgumentsSerializer |
getSerializer(ResponseArguments argumentsSerializer)
Get the serialized to be used for writing the response arguments.
|
java.lang.Object |
invoke(AppServerHelper helper,
java.lang.String token,
java.lang.Object[] args)
Invoke this service.
|
getDefinitionParameters, getExecutionMode, getProcedureHandle, getRequestID, isPersistent, nextRequestId, reset, resolveModes
private final java.lang.Class<?> cls
private final java.lang.reflect.Method method
class
) which implements this service. Must be a public
instance or static method; for an instance method, the Java class must have a no-argument constructor
and must not be abstract.public JavaRestService(java.lang.Class<?> cls, java.lang.reflect.Method m, LegacyService ls, ServiceKey key, int timeout)
cls
- The target class.m
- The target method.ls
- The service signature, as it appears at the method annotation.key
- The service key.timeout
- The invocation timeout.public java.lang.Object invoke(AppServerHelper helper, java.lang.String token, java.lang.Object[] args)
invoke
in class RestService
helper
- The appserver helper used to execute the requests.token
- When not null, it represents the token of a FWD context created for an authenticated and
authorized web service call. The API call will be performed in that context.args
- The arguments. Any change to a mutable argument will be reflected back at the caller.protected ArgumentsParser getParser(ServiceArgumentsParser argumentsParser)
getParser
in class RestService
argumentsParser
- The service's parser.LegacyArgumentsParser
instance.protected ArgumentsSerializer getSerializer(ResponseArguments argumentsSerializer)
getSerializer
in class RestService
argumentsSerializer
- The service's serializer.LegacyArgumentsSerializer
instance.protected void buildDefinitionParameters()
LegacyServiceParameter
annotations at the method
definition. This will set the RestService.definitionParameters
.buildDefinitionParameters
in class RestService