listenerMetadata.put(ConnectionValidator.VALIDATOR_PING_TIMEOUT, "13000"); callbackClient.connect(new ClientConnectionListener(), listenerMetadata);
public void connect() throws Exception { if (callBackClient != null) { if (callBackClient.isConnected()) return; callBackClient.connect(); } }
/** * 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; }
/** * 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(); }
/** * 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 RemoteStrategyRemoting() throws Exception { String chatManagerUriString = Parameters.getParameter("chatManagerUri"); if (chatManagerUriString == null) chatManagerUriString = chatManagerLocatorDefault; InvokerLocator chatManagerLocator = new InvokerLocator(chatManagerUriString); managerClient = new Client(chatManagerLocator); managerClient.connect(); }
/** * 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(); } }
public void createRemotingClient(String locatorURI) throws Exception { client = new Client(new InvokerLocator(locatorURI)); client.connect(); }
protected void init(InvokerLocator locator) { this.locator = locator; try { client = createClient(locator, getSubSystem()); client.connect(); } catch(Exception e) { log.fatal("Could not initialize UnifiedInvokerProxy.", e); } }
/** * 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(); } }
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 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(); } }
/** * 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; }