/** * @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(); } }
/** * @see java.io.InputStream#close() */ public void close() throws IOException { if (!_closed) { _closed = true; if (_streamService != null) { TransporterClient.destroyTransporterClient(_streamService); _streamService = null; } _currentBuffer = null; } }
public void makeClientCall() throws Exception { Customer customer = createCustomer(); CustomerProcessor customerProcessor = (CustomerProcessor) TransporterClient.createTransporterClient(locatorURI, CustomerProcessor.class); System.out.println("Customer to be processed: " + customer); Customer processedCustomer = customerProcessor.processCustomer(customer); System.out.println("Customer is now: " + processedCustomer); AccountProcessor accountProcessor = (AccountProcessor) TransporterClient.createTransporterClient(locatorURI, AccountProcessor.class); System.out.println("Asking for a new account to be created for customer."); Account account = accountProcessor.createAccount(processedCustomer); System.out.println("New account: " + account); TransporterClient.destroyTransporterClient(customerProcessor); TransporterClient.destroyTransporterClient(accountProcessor); }
public void makeClientCall() throws Exception { Order order = createOrder(); OrderProcessor orderProcessor = (OrderProcessor) TransporterClient.createTransporterClient(locatorURI, OrderProcessor.class); System.out.println("Order to be processed: " + order); Order changedOrder = orderProcessor.processOrder(order); System.out.println("Order now processed " + changedOrder); TransporterClient.destroyTransporterClient(orderProcessor); }
public void makeClientCall() throws Exception { Customer customer = createCustomer(); CustomerProcessor customerProcessor = (CustomerProcessor) TransporterClient.createTransporterClient(locatorURI, CustomerProcessor.class); System.out.println("Customer to be processed: " + customer); Customer processedCustomer = customerProcessor.processCustomer(customer); System.out.println("Customer is now: " + processedCustomer); TransporterClient.destroyTransporterClient(customerProcessor); }
public void makeClientCall() throws Exception { Customer customer = createCustomer(); CustomerProcessor customerProcessor = (CustomerProcessor) TransporterClient.createTransporterClient(locatorURI, CustomerProcessor.class); System.out.println("Customer to be processed: " + customer); ICustomer processedCustomer = customerProcessor.processCustomer(customer); // processedCustomer returned is actually a proxy to the Customer instnace // that lives on the server. So when print it out below, will actually // be calling back to the server to get the string (vi toString() call). // Notice the output of 'Customer.toString() being called.' on the server side. System.out.println("Customer is now: " + processedCustomer); TransporterClient.destroyTransporterClient(customerProcessor); }
TransporterClient.destroyTransporterClient(providerProcessor);