Package org.epics.pvaccess.server.rpc
Class RPCServer
- java.lang.Object
-
- org.epics.pvaccess.server.rpc.RPCServer
-
public class RPCServer extends Object
pvAccess RPC server implementation.- Author:
- msekoranja
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroy (shutdown) the server.voidprintInfo()Display basic information about the context.voidregisterService(String serviceName, RPCService service)Register RPC service.voidregisterService(String serviceName, RPCServiceAsync service)Register async.voidrun(int seconds)Run the server for a given amount of time.voidunregisterService(String serviceName)Unregister RPC service.
-
-
-
Constructor Detail
-
RPCServer
public RPCServer()
Default constructor. Creates a simple RPC server that processes requests directly in pvAccess receive thread.
-
RPCServer
public RPCServer(int threads, int queueSize)Creates a RPC server with a thread-pool used to process requests.- Parameters:
threads- number of threads in a thread-pool.queueSize- thread-pool request queue size.
-
-
Method Detail
-
printInfo
public void printInfo()
Display basic information about the context.
-
run
public void run(int seconds) throws PVAExceptionRun the server for a given amount of time.- Parameters:
seconds- time (in seconds) to run the server, if0server is run until destroyed.- Throws:
PVAException- exception thrown in case of an unexpected error.
-
destroy
public void destroy() throws PVAExceptionDestroy (shutdown) the server.- Throws:
PVAException- exception thrown in case of an unexpected error.
-
registerService
public void registerService(String serviceName, RPCService service)
Register RPC service. Multiple services (with different name) can be registered. In case of name duplicates, the last registered service (with the same name) is used.- Parameters:
serviceName- RPC service name. This name is used by client to discover/connect to the service.service- service implementation.
-
registerService
public void registerService(String serviceName, RPCServiceAsync service)
Register async. RPC service. Multiple services (with different name) can be registered. In case of name duplicates, the last registered service (with the same name) is used.- Parameters:
serviceName- RPC service name. This name is used by client to discover/connect to the service.service- async. service implementation.
-
unregisterService
public void unregisterService(String serviceName)
Unregister RPC service.- Parameters:
serviceName- name of the RPC service to be unregistered.
-
-