/** * Returns an RPC proxy for a given client to server RPC interface for the * given component or extension. * * @param connector * the connector for which to the RPC proxy * @param rpcInterface * the RPC interface type * * @return a server RPC handler which can be used to invoke RPC methods * @since 8.0 */ public static <T extends ServerRpc> T getRpcProxy(ClientConnector connector, final Class<T> rpcInterface) { @SuppressWarnings("unchecked") ServerRpcManager<T> rpcManager = (ServerRpcManager<T>) connector .getRpcManager(rpcInterface.getName()); if (rpcManager == null) { return null; } return rpcManager.getImplementation(); }
/** * 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. * * @param target * non-null target of the RPC call * @param invocation * method invocation to perform * @throws RpcInvocationException */ public static void applyInvocation(ClientConnector target, ServerRpcMethodInvocation invocation) throws RpcInvocationException { ServerRpcManager<?> manager = target .getRpcManager(invocation.getInterfaceName()); if (manager != null) { manager.applyInvocation(invocation); } else { getLogger().log(Level.WARNING, "RPC call received for RpcTarget {0} ({1}) but the target has not registered any RPC interfaces", new Object[] { target.getClass().getName(), invocation.getConnectorId() }); } }
return null; ServerRpcManager<?> rpcManager = connector.getRpcManager(interfaceName); if (rpcManager == null) {