/** * @param askForReconnect - true = connection was lost because of error and * ask the user if he want to try to reconnect */ @Override public synchronized void disconnect(boolean askForReconnect) { if (isConnected()) { logger.info("DISCONNECT (still connected)"); sessionState = SessionState.DISCONNECTING; } if (connection == null || sessionState == SessionState.DISCONNECTED) { return; } try { callbackClient.removeListener(callbackHandler); callbackClient.disconnect(); TransporterClient.destroyTransporterClient(server); } catch (Throwable ex) { logger.fatal("Error disconnecting ...", ex); } if (sessionState == SessionState.DISCONNECTING || sessionState == SessionState.CONNECTING) { sessionState = SessionState.DISCONNECTED; logger.info("Disconnected ... "); if (askForReconnect) { client.showError("Network error. You have been disconnected from " + connection.getHost()); } client.disconnected(askForReconnect); // MageFrame with check to reconnect pingTime.clear(); } }
/** * Disconnects the remoting client */ private void disconnect() { if (remotingClient != null) { remotingClient.disconnect(); } }
public void disconnectRemotingClient() { if (client != null) client.disconnect(); }
/** * Cache the client, disconnecting the old client. * * @param client optionally null; new client to cache */ private void cacheClient(Client client) { Client old = m_client.getAndSet(client); if (old != null) { old.disconnect(); m_needToCallInitializeCallback = (getInitializeCallback() != null); } }
/** * Cache the client, disconnecting the old client. * * @param client optionally null; new client to cache */ private void cacheClient(Client client) { Client old = m_client.getAndSet(client); if (old != null) { old.disconnect(); m_needToCallInitializeCallback = (getInitializeCallback() != null); } }
/** * Will disconnect loader client if is present. */ public void destroy() { if(loaderClient != null && loaderClient.isConnected()) { loaderClient.disconnect(); } }
/** * This method is required to be called upon removing a callback listener * so can clean up resources used by the handler. In particular, should * call disconnect on internal Client. */ public synchronized void destroy() { if(callBackClient != null) { callBackClient.disconnect(); callBackClient = null; } if(callbackStore != null) { callbackStore.purgeFiles(); callbackStore = null; } }
/** * called to destroy the proxy and the invoker */ public synchronized void destroy() { if(log.isTraceEnabled()) { log.trace("destroy called on: " + this + " for locator: " + locator + ", and serverid: " + serverId); } client.disconnect(); MBeanServerRegistry.unregister(this); cancelPoller(); removeListeners(); paramMap.clear(); proxies.remove(serverId); }
public void prepare(DeploymentID dtID) throws Exception { Client client = getClient(); try { log.debug("Begin prepare: " + dtID); invoke(client, "prepare", createArgs(dtID)); log.debug("End prepare: "+dtID); } finally { client.disconnect(); } }
public void redeploy(DeploymentID dtID) throws Exception { Client client = getClient(); try { log.debug("Begin redeploy: " + dtID); invoke(client, "redeploy", createArgs(dtID)); log.debug("End redeploy: "+dtID); } finally { client.disconnect(); } }
public String[] getRepositoryNames(DeploymentID dtID) throws Exception { Client client = getClient(); try { log.debug("Begin getRepositoryNames: " + Arrays.asList(dtID.getNames())); String[] rnames = (String[]) invoke(client, "getRepositoryNames", createArgs(dtID)); log.debug("End getRepositoryNames: " + Arrays.asList(rnames)); return rnames; } finally { client.disconnect(); } }
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); }
/** * Start a given deployment(s) */ public void start(DeploymentID dtID) throws Exception { Client client = getClient(); try { log.debug("Start: " + dtID); invoke(client, "start", createArgs(dtID)); log.debug("End start: "+dtID); } finally { client.disconnect(); } }
/** * Stop a given module */ public void stop(DeploymentID dtID) throws Exception { Client client = getClient(); try { log.debug("Begin stop: " + dtID); invoke(client, "stop", createArgs(dtID)); log.debug("End stop"); } finally { client.disconnect(); } }
public void tearDown() throws Throwable { while (!handler.gotCallbacks) Thread.sleep(1000); client.removeListener(handler); if(connector != null) { connector.stop(); connector.destroy(); connector = null; } locator = null; if(client != null) { client.disconnect(); client = null; } }
public void tearDown() throws Throwable { while (!handler.gotCallbacks) Thread.sleep(1000); client.removeListener(handler); if(connector != null) { connector.stop(); connector.destroy(); connector = null; } locator = null; if(client != null) { client.disconnect(); client = null; } }
public void tearDown() throws Throwable { while (!handler.gotCallbacks) Thread.sleep(1000); client.removeListener(handler); if(connector != null) { connector.stop(); connector.destroy(); connector = null; } locator = null; if(client != null) { client.disconnect(); client = null; } }
public void tearDown() throws Throwable { while (!handler.gotCallbacks) Thread.sleep(1000); client.removeListener(handler); if(connector != null) { connector.stop(); connector.destroy(); connector = null; } locator = null; if(client != null) { client.disconnect(); client = null; } }
public void tearDown() throws Throwable { while (!handler.gotCallbacks) Thread.sleep(1000); client.removeListener(handler); if(connector != null) { connector.stop(); connector.destroy(); connector = null; } locator = null; if(client != null) { client.disconnect(); client = null; } }
public void tearDown() throws Throwable { while (!handler.gotCallbacks) Thread.sleep(1000); client.removeListener(handler); if(connector != null) { connector.stop(); connector.destroy(); connector = null; } locator = null; if(client != null) { client.disconnect(); client = null; } }