break; InvokerLocator clientLocator = new InvokerLocator(connection.getURI());
try { InvokerLocator serverLocator = new InvokerLocator(connection.getURI()); if (!isAlreadyRunning(serverLocator)) { server = new MageTransporterServer(serverLocator, new MageServerImpl(adminPassword, testMode), MageServer.class.getName(), new MageServerInvocationHandler());
/** * Constructor for {@link JBossRemotingRemoteCommunicator} that allows you to indicate the * {@link InvokerLocator invoker locator} to use by specifying the locator's URI. The subsystem will be set to the * {@link #DEFAULT_SUBSYSTEM}. * * @param locatorUri the locator's URI (must not be <code>null</code>) * * @throws MalformedURLException if failed to create the locator (see {@link InvokerLocator#InvokerLocator(String)}) */ public JBossRemotingRemoteCommunicator(String locatorUri) throws MalformedURLException { this(new InvokerLocator(locatorUri), DEFAULT_SUBSYSTEM, null); }
/** * Constructor for {@link JBossRemotingRemoteCommunicator} that allows you to indicate the * {@link InvokerLocator invoker locator} to use by specifying the locator's URI. The subsystem will be set to the * {@link #DEFAULT_SUBSYSTEM}. * * @param locatorUri the locator's URI (must not be <code>null</code>) * * @throws MalformedURLException if failed to create the locator (see {@link InvokerLocator#InvokerLocator(String)}) */ public JBossRemotingRemoteCommunicator(String locatorUri) throws MalformedURLException { this(new InvokerLocator(locatorUri), DEFAULT_SUBSYSTEM, null); }
public void createRemotingClient(String locatorURI) throws Exception { client = new Client(new InvokerLocator(locatorURI)); client.connect(); }
/** * Create a remote proxy to a POJO on a remote server. * * @param locatorURI - the remoting locator uri to the target server where the target POJO exists. * @param targetClass - the interface class of the POJO will be calling upon. * @return dynamic remote proxy typed to the interface specified by the targetClass param. * @throws Exception */ public static Object createTransporterClient(String locatorURI, Class targetClass) throws Exception { InvokerLocator locator = new InvokerLocator(locatorURI); return createTransporterClient(locator, targetClass); }
/** * 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(); }
/** * @see SetupValidityChecker#checkValidity(String, String, Preferences, PrintWriter) */ public boolean checkValidity(String pref_name, String value_to_check, Preferences preferences, PrintWriter out) { try { new InvokerLocator(value_to_check); return true; } catch (Exception e) { out.println(CommI18NFactory.getMsg() .getMsg(CommI18NResourceKeys.SETUP_NOT_A_LOCATOR_URI, value_to_check, e)); return false; } } }
/** * @see SetupValidityChecker#checkValidity(String, String, Preferences, PrintWriter) */ public boolean checkValidity(String pref_name, String value_to_check, Preferences preferences, PrintWriter out) { try { new InvokerLocator(value_to_check); return true; } catch (Exception e) { out.println(CommI18NFactory.getMsg() .getMsg(CommI18NResourceKeys.SETUP_NOT_A_LOCATOR_URI, value_to_check, e)); return false; } } }
public void setupServer(String locatorURI) throws Exception { connector = new Connector(new InvokerLocator(locatorURI)); connector.start(); connector.addInvocationHandler("test", new TestInvoocationHandler()); }
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 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 setupServer() throws Exception { InvokerLocator locator = new InvokerLocator(locatorURI); System.out.println("Starting remoting server with locator uri of: " + locatorURI); connector = new Connector(); connector.setInvokerLocator(locator.getLocatorURI()); connector.create(); TestStreamInvocationHandler invocationHandler = new TestStreamInvocationHandler(); // first parameter is sub-system name. can be any String value. connector.addInvocationHandler("test_stream", invocationHandler); connector.start(true); }
/** * @return An invoker locator instance with the same connection info as this * HQ invoker locator. */ public InvokerLocator toInvokerLocator() { return new InvokerLocator(this.getProtocol(), this.getHost(), this.getPort(), this.getPath(), this .getParameters()); }
public void init() throws Exception { connector = new Connector(); InvokerLocator locator = new InvokerLocator("multiplex://localhost:9090"); connector.setInvokerLocator(locator.getLocatorURI()); connector.create(); handler = new SampleInvocationHandler(); connector.addInvocationHandler("sample", handler); connector.start(); System.out.println("Started server at: " + connector.getInvokerLocator()); }
protected int assignPort() throws IOException { int port; port = PortUtil.findFreePort(locator.getHost()); // re-write locator since the port is different InvokerLocator newLocator = new InvokerLocator(locator.getProtocol(), locator.getHost(), port, locator.getPath(), locator.getParameters()); // need to update the locator key used in the invoker registry InvokerRegistry.updateServerInvokerLocator(locator, newLocator); this.locator = newLocator; return port; }
public void setupServer(String locatorURI) throws Exception { InvokerLocator locator = new InvokerLocator(locatorURI); connector = new Connector(); connector.setInvokerLocator(locator.getLocatorURI()); connector.create(); ServerInvocationHandler invocationHandler = new Handler(connector); connector.addInvocationHandler("stream", invocationHandler); connector.start(); }