Package com.vaadin.server
Class ServerRpcManager<T extends ServerRpc>
- java.lang.Object
-
- com.vaadin.server.ServerRpcManager<T>
-
- All Implemented Interfaces:
Serializable
public class ServerRpcManager<T extends ServerRpc> extends Object implements Serializable
Server side RPC manager that handles RPC calls coming from the client. Each RPC target (typically aClientConnector) should have its own instance ofServerRpcManagerif it wants to receive RPC calls from the client.- Since:
- 7.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServerRpcManager.RpcInvocationExceptionWrapper exception for exceptions which occur during invocation of an RPC call.
-
Constructor Summary
Constructors Constructor Description ServerRpcManager(T implementation, Class<T> rpcInterface)Create a RPC manager for an RPC target.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidapplyInvocation(ClientConnector target, ServerRpcMethodInvocation invocation)Invoke a method in a server side RPC target class.voidapplyInvocation(ServerRpcMethodInvocation invocation)Invoke a method in a server side RPC target class.protected TgetImplementation()Returns the RPC interface implementation for the RPC target.Class<T>getRpcInterface()Returns the RPC interface type managed by this RPC manager instance.static <T extends ServerRpc>
TgetRpcProxy(ClientConnector connector, Class<T> rpcInterface)Returns an RPC proxy for a given client to server RPC interface for the given component or extension.
-
-
-
Method Detail
-
applyInvocation
public static void applyInvocation(ClientConnector target, ServerRpcMethodInvocation invocation) throws ServerRpcManager.RpcInvocationException
Invoke a method in a server side RPC target class. This method is to be used by the RPC framework and unit testing tools only.- Parameters:
target- non-null target of the RPC callinvocation- method invocation to perform- Throws:
ServerRpcManager.RpcInvocationException
-
getImplementation
protected T getImplementation()
Returns the RPC interface implementation for the RPC target.- Returns:
- RPC interface implementation
-
getRpcInterface
public Class<T> getRpcInterface()
Returns the RPC interface type managed by this RPC manager instance.- Returns:
- RPC interface type
-
applyInvocation
public void applyInvocation(ServerRpcMethodInvocation invocation) throws ServerRpcManager.RpcInvocationException
Invoke a method in a server side RPC target class. This method is to be used by the RPC framework and unit testing tools only.- Parameters:
invocation- method invocation to perform- Throws:
ServerRpcManager.RpcInvocationException
-
getRpcProxy
public static <T extends ServerRpc> T getRpcProxy(ClientConnector connector, Class<T> rpcInterface)
Returns an RPC proxy for a given client to server RPC interface for the given component or extension.- Parameters:
connector- the connector for which to the RPC proxyrpcInterface- the RPC interface type- Returns:
- a server RPC handler which can be used to invoke RPC methods
- Since:
- 8.0
-
-