Interface LocalRpcService
- All Known Implementing Classes:
AbstractLocalRpcService,LocalAppIdentityService,LocalBlobstoreService,LocalCapabilitiesService,LocalDatastoreV3Service,LocalImagesService,LocalLogService,LocalMailService,LocalMemcacheService,LocalModulesService,LocalSearchService,LocalTaskQueue,LocalURLFetchService,LocalUserService
public interface LocalRpcService
A local implementation of an RPC service. Services adheres to the following
method convention:
<Request extends ProtocolMessage, Response extends ProtocolMessage>
Response methodName(Status status, Request request)
For example,
public class DatabaseService {
public GetResponse get(Status status, GetRequest req) throws RpcException;
public PutResponse put(Status status, PutRequest req) throws RpcException;
// ...
}
DevAppServer discovers LocalRpcServices implementations with
ServiceLoader.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiongetDefaultDeadline(boolean isOfflineRequest) Return the number of seconds that should be used as a deadline for each API call if no other deadline is requested by the user.Returns the maximum size of an encoded API request in bytes, ornullfor the default size.getMaximumDeadline(boolean isOfflineRequest) Return the maximum number of seconds that is allowed as a deadline for each API call.Returns the package for the service, for example, "datastore_v3".voidinit(LocalServiceContext context, Map<String, String> properties) Initializes the service with a set of configuration properties.voidstart()Puts a new service into "serving" mode.voidstop()Stops the service, releasing all of its resources.
-
Method Details
-
getPackage
String getPackage()Returns the package for the service, for example, "datastore_v3".- Returns:
- a not
nullpackage name.
-
init
Initializes the service with a set of configuration properties. Must be called before a service isstarted.- Parameters:
context- A context object for the applicationproperties- A read-onlyMapof properties.
-
start
void start()Puts a new service into "serving" mode. Aside from setting properties, the service is not functional until after having been started. -
stop
void stop()Stops the service, releasing all of its resources. -
getDefaultDeadline
Return the number of seconds that should be used as a deadline for each API call if no other deadline is requested by the user. This method may returnnullif the service has no opinion about the deadline, in which case a global deadline will be used instead. -
getMaximumDeadline
Return the maximum number of seconds that is allowed as a deadline for each API call. The user cannot request a deadline higher than this value. This method may returnnullif the service has no opinion about the maximum deadline, in which case a global maximum deadline will be used instead. -
getMaxApiRequestSize
Integer getMaxApiRequestSize()Returns the maximum size of an encoded API request in bytes, ornullfor the default size.
-