/** * narrow this invoker to a specific RemoteClientInvoker instance * * @return * @throws Exception */ public ClientInvoker narrow() throws Exception { return InvokerRegistry.createClientInvoker(this); }
/** * create a ClientInvoker instance, using the specific InvokerLocator, which is just a client-side * invoker to a remote server. Will use the default configuration values for the transport. * * @param locator * @return * @throws Exception */ public static ClientInvoker createClientInvoker(InvokerLocator locator) throws Exception { return createClientInvoker(locator, null); }
try this.invoker = InvokerRegistry.createClientInvoker(locator, configuration); if(wasConnected)
/** * Will cause the underlying transport to make connection to the target server. This is * important for any stateful transports, like socket or multiplex. This is also when a client * lease with the server is started. */ public void connect() throws Exception { if (isConnected()) return; if (locator == null) { throw new IllegalStateException("Cannot connect a client with a null locator"); } if (invoker == null) { if (socketFactory != null) { configuration.put(Remoting.CUSTOM_SOCKET_FACTORY, socketFactory); this.socketFactory = null; } invoker = InvokerRegistry.createClientInvoker(locator, configuration); } connect(invoker); connected = true; }
private void connectAsync() { try { if(log.isTraceEnabled()) { log.trace("attempting an bi-directional connection back to client [" + locator + "], server id [" + sessionId + "]"); } // attempt connection back clientInvoker = InvokerRegistry.createClientInvoker(locator); clientInvoker.connect(); client = new Client(Thread.currentThread().getContextClassLoader(), clientInvoker, Subsystem.JMX); asyncQueue = new LinkedQueue(); biDirectionalSender = new BiDirectionClientNotificationSender(); biDirectionalSender.start(); asyncSend = true; } catch(Throwable e) { log.debug("attempted a bi-directional connection back to client [" + locator + "], but it failed", e); } }
private void start() { configMap = createPingConfig(client.getConfiguration(), metadata); log.debug(this + " timeout: " + configMap.get(ServerInvoker.TIMEOUT)); log.debug(this + " ping retries: " + configMap.get("NumberOfCallRetries")); log.debug(this + " connection retries: " + configMap.get("NumberOfRetries")); locator = client.getInvoker().getLocator(); try { clientInvoker = InvokerRegistry.createClientInvoker(locator, configMap); } catch (Exception e) { log.debug("Unable to create client invoker for locator: " + locator); throw new RuntimeException("Unable to create client invoker for locator: " + locator, e); } if (!clientInvoker.isConnected()) { if (trace) { log.trace("inner client invoker not connected, connecting ..."); } clientInvoker.connect(); } TimerUtil.schedule(this, pingPeriod); stopped = false; log.debug(this + " started"); }
innerClientInvoker = InvokerRegistry.createClientInvoker(locator, configMap);