/** * This will create the Client. */ public void init() { try { String locatorURI = "multiplex://localhost:9090"; InvokerLocator locator = new InvokerLocator(locatorURI); Map configuration = new HashMap(); configuration.put(Multiplex.MULTIPLEX_BIND_HOST, "localhost"); configuration.put(Multiplex.MULTIPLEX_BIND_PORT, "8080"); configuration.put(Multiplex.CLIENT_MULTIPLEX_ID, "client2server2"); client = new Client(locator, "sample", configuration); client.connect(); System.out.println("Connected client to server at: " + client.getInvoker().getLocator().getLocatorURI()); } catch(Exception e) { e.printStackTrace(); } }
/** * This will create the Client. */ public void init() { try { String locatorURI = "multiplex://localhost:9090"; InvokerLocator locator = new InvokerLocator(locatorURI); Map configuration = new HashMap(); configuration.put(Multiplex.MULTIPLEX_BIND_HOST, "localhost"); configuration.put(Multiplex.MULTIPLEX_BIND_PORT, "8080"); client = new Client(locator, "sample", configuration); client.connect(); System.out.println("Connected client to server at: " + client.getInvoker().getLocator().getLocatorURI()); } catch(Exception e) { e.printStackTrace(); } }
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"); }
private void getParameters(Client client, Map metadata) { getParametersFromMap(client.getConfiguration()); getParametersFromMap(metadata); ClientInvoker clientInvoker = client.getInvoker(); if (clientInvoker instanceof MicroRemoteClientInvoker) { invokerSessionId = ((MicroRemoteClientInvoker) clientInvoker).getSessionId(); } else { throw new RuntimeException("creating a ConnectionValidator on a local connection"); } }
public void setUp() throws Exception { init(); locator = initServer(); client.connect(); System.out.println("Connected client to server at: " + client.getInvoker().getLocator().getLocatorURI()); }
/** * This will create the Client. */ public void init() { try { String locatorURI = "multiplex://localhost:9090/?multiplexBindHost=localhost&multiplexBindPort=8080"; InvokerLocator locator = new InvokerLocator(locatorURI); client = new Client(locator, "sample"); client.connect(); System.out.println("Connected client to server at: " + client.getInvoker().getLocator().getLocatorURI()); } catch(Exception e) { e.printStackTrace(); } }
/** * This will create the Client. */ public void init() { try { String parameters = "/?clientMultiplexId=server3client1"; String locatorURI = "multiplex://localhost:9090" + parameters; InvokerLocator locator = new InvokerLocator(locatorURI); client = new Client(locator, "sample"); client.connect(); System.out.println("Connected client to server at: " + client.getInvoker().getLocator().getLocatorURI()); } catch(Exception e) { e.printStackTrace(); } }
/** * This will create the Client. */ public void init() { try { String parameters = "/?multiplexBindHost=localhost&multiplexBindPort=8080&clientMultiplexId=server2client1"; String locatorURI = "multiplex://localhost:9090" + parameters; InvokerLocator locator = new InvokerLocator(locatorURI); client = new Client(locator, "sample"); client.connect(); System.out.println("Connected client to server at: " + client.getInvoker().getLocator().getLocatorURI()); } catch(Exception e) { e.printStackTrace(); } }
MicroRemoteClientInvoker invoker = (MicroRemoteClientInvoker) client.getInvoker(); invoker.terminateLease(null, client.getDisconnectTimeout()); log.debug(this + " shut down lease pinger");
return "MBeanServerClientInvokerProxy [serverid:" + serverId + ",locator:" + client.getInvoker().getLocator() + "]";
InvokerLocator newLocator = data.getInvokerLocator(); if (!remotingClient.getInvoker().getLocator().equals(newLocator))
/** * Invokes JBoss Remoting using the given command. * Attempts to cache the client if sending the message was successful. * * @return object as a result of this call */ private Object invoke(Command command) throws Throwable { InvokerLocator locator = m_invokerLocator; if (locator == null) { throw new IllegalStateException("m_invokerLocator is null"); } Client client = m_client.get(); if (client != null && client.getInvoker() == null) { client.disconnect(); } if (client == null || !client.isConnected()) { client = new Client(locator, getSubsystem(), m_clientConfiguration); client.connect(); try { return client.invoke(command); } finally { cacheClient(client); } } // Note: Despite all the checks above, the client might have been // disconnected before invoke is reached. Let's hope that doesn't happen. return client.invoke(command); }
/** * Invokes JBoss Remoting using the given command. * Attempts to cache the client if sending the message was successful. * * @return object as a result of this call */ private Object invoke(Command command) throws Throwable { InvokerLocator locator = m_invokerLocator; if (locator == null) { throw new IllegalStateException("m_invokerLocator is null"); } Client client = m_client.get(); if (client != null && client.getInvoker() == null) { client.disconnect(); } if (client == null || !client.isConnected()) { client = new Client(locator, getSubsystem(), m_clientConfiguration); client.connect(); try { return client.invoke(command); } finally { cacheClient(client); } } // Note: Despite all the checks above, the client might have been // disconnected before invoke is reached. Let's hope that doesn't happen. return client.invoke(command); }
log.trace("Making invocation on " + clientInstance.getInvoker().getLocator());
ClientInvoker clientInvoker = client.getInvoker(); clientInvoker.setSocketFactory(sf2);