callbackClient = new Client(clientLocator, "callback", clientMetadata);
protected Client createClient(InvokerLocator locator, String subSystem) throws Exception { return new Client(locator, subSystem); } }
/** * Get the remoting client connection * @return * @throws Exception */ private Client getClient() throws Exception { log.debug("Calling remoting server with locator of: " + locator); Client remotingClient = new Client(locator, subsystem); remotingClient.connect(); return remotingClient; }
/** * Creates the remoting client to server POJO. * Is not clustered. * * @param locator * @throws Exception */ private TransporterClient(InvokerLocator locator) throws Exception { remotingClient = new Client(locator); remotingClient.connect(); }
/** * Creates the remoting client to server POJO. * Is clustered * * @param locator * @param targetSubsystem * @throws Exception */ private TransporterClient(InvokerLocator locator, String targetSubsystem) throws Exception { remotingClient = new Client(locator, targetSubsystem); remotingClient.connect(); this.isClustered = true; this.subSystem = targetSubsystem; }
/** * Creates the remoting client to server POJO. * Is clustered * * @param locator * @param targetSubsystem * @param loadbalancer policy * @throws Exception */ private TransporterClient(InvokerLocator locator, String targetSubsystem, LoadBalancer loadbalancer) throws Exception { this.loadBalancer = loadbalancer; remotingClient = new Client(locator, targetSubsystem); remotingClient.connect(); this.isClustered = true; this.subSystem = targetSubsystem; }
/** * 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.CLIENT_MULTIPLEX_ID, "client3server1"); client = new Client(locator, "sample", configuration); } catch(Exception e) { e.printStackTrace(); } }
/** * Create the remoting client to use to make calls on the remoting server. * * @param locatorURI * @throws Exception */ public void createRemotingClient(String locatorURI) throws Exception { InvokerLocator locator = new InvokerLocator(locatorURI); System.out.println("Calling remoting server with locator uri of: " + locatorURI); remotingClient = new Client(locator); remotingClient.connect(); }
private MBeanServerClientInvokerProxy(ClassLoader cl, InvokerLocator invoker, String localJmxId, String id) throws Exception { this.localJmxId = localJmxId; this.serverId = id; if(this.serverId == null) { throw new IllegalArgumentException("MBeanServer ID not found - make sure the NetworkRegistry MBean is running"); } this.client = new Client(cl, invoker, Subsystem.JMX, null); this.locator = new InvokerLocator(invoker.getLocatorURI()); this.proxies.put(id, this); setupPollingTimer(); }
/** * Constructor requiring the locator url back to the client's * StreamServer connector (actually the connector's server invoker). * * @param locatorURL * @throws Exception */ //private StreamHandler(String locatorURL) throws Exception public StreamHandler(String locatorURL) throws Exception { streamServerLocator = new InvokerLocator(locatorURL); streamClient = new Client(streamServerLocator); streamClient.connect(); }
public void makeInvocation(String locatorURI) throws Throwable { // create InvokerLocator with the url type string // indicating the target remoting server to call upon. InvokerLocator locator = new InvokerLocator(locatorURI); System.out.println("Calling remoting server with locator uri of: " + locatorURI); Client remotingClient = new Client(locator); remotingClient.connect(); NonSerializablePayload payload = new NonSerializablePayload("foo", 1); System.out.println("Invoking server with request of '" + payload + "'"); Object response = remotingClient.invoke(payload); System.out.println("Invocation response: " + response); }
public void makeInvocation(String locatorURI) throws Throwable { // create InvokerLocator with the url type string // indicating the target remoting server to call upon. InvokerLocator locator = new InvokerLocator(locatorURI); System.out.println("Calling remoting server with locator uri of: " + locatorURI); Client remotingClient = new Client(locator); remotingClient.connect(); String request = "Do something"; System.out.println("Invoking server with request of '" + request + "'"); Object response = remotingClient.invoke(request); remotingClient.disconnect(); System.out.println("Invocation response: " + response); }
public void connectionLost(String locatorurl, String clientSessionId, Map requestPayload) { try { log.debug("Server connection lost to client (session id = " + clientSessionId); Client client = new Client(new InvokerLocator(locatorurl), requestPayload); client.setSessionId(clientSessionId); ConnectionListener[] list = (ConnectionListener[])listeners.toArray(new ConnectionListener[listeners.size()]); for(int x = 0; x < list.length; x++) { list[x].handleConnectionException(null, client); } } catch(Exception e) { log.error("Error notifying connection listeners of lost client connection.", e); } }
public RemoteStrategyRemoting() throws Exception { String chatManagerUriString = Parameters.getParameter("chatManagerUri"); if (chatManagerUriString == null) chatManagerUriString = chatManagerLocatorDefault; InvokerLocator chatManagerLocator = new InvokerLocator(chatManagerUriString); managerClient = new Client(chatManagerLocator); managerClient.connect(); }
public void createRemotingClient(String locatorURI) throws Exception { client = new Client(new InvokerLocator(locatorURI)); client.connect(); }
/** * 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 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 = "/?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(); } }
/** * Make call on remoting server based on locator uri provided. * * @param locatorURI the URI of the remote server we want to send the message to * @throws Throwable */ public void makeInvocation(String locatorURI) throws Throwable { InvokerLocator locator = new InvokerLocator(locatorURI); println("Sending welcome message to remoting server with locator uri of: " + locatorURI); Client remotingClient = new Client(locator); remotingClient.connect(); Object response = remotingClient.invoke("Welcome Aboard!", null); println("The newly discovered server sent this response to our welcome message: " + response); return; }
/** * Make call on remoting server based on locator uri provided. * * @param locatorURI the URI of the remote server we want to send the message to * @throws Throwable */ public void makeInvocation(String locatorURI) throws Throwable { InvokerLocator locator = new InvokerLocator(locatorURI); println("Sending welcome message to remoting server with locator uri of: " + locatorURI); Client remotingClient = new Client(locator, getConfiguration()); remotingClient.connect(); Object response = remotingClient.invoke("Welcome Aboard!", null); println("The newly discovered server sent this response to our welcome message: " + response); remotingClient.disconnect(); return; }