/** * If an async exception occurs, then assume no responses will arrive for * any of current requests. Lets let them know of the problem. */ public void onException(IOException error) { dispose(new TransportDisposedIOException("Disposed due to prior exception", error)); super.onException(error); }
public Object request(Object command, int timeout) throws IOException { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if (logging) logWriter.logRequest(log, command); Object rc = super.request(command, timeout); if (logging) logWriter.logResponse(log, command); return rc; }
/** * Configure transport * * @param transport * @return the Transport */ public static Transport configure(Transport transport) { transport = new MutexTransport(transport); transport = new ResponseCorrelator(transport); return transport; }
public void onCommand(Object command) { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if( logging && log.isDebugEnabled() ) { logWriter.logReceivedCommand(log, command); } getTransportListener().onCommand(command); }
public void onException(IOException error) { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if( logging && log.isDebugEnabled() ) { logWriter.logReceivedException(log, error); } getTransportListener().onException(error); }
@Override protected synchronized void startMonitorThreads() throws IOException { if (isMonitorStarted()) { return; } long readCheckTime = getReadCheckTime(); if (readCheckTime > 0) { setWriteCheckTime(writeCheckValueFromReadCheck(readCheckTime)); } super.startMonitorThreads(); }
@Override public void stop() throws Exception { stopMonitorThreads(); next.stop(); }
@Override public void oneway(Object command) throws IOException { try { registerWrite(this); super.oneway(command); } catch (IOException x) { throw x; } finally { deRegisterWrite(this,false,null); } }
@Override public void start() throws Exception { next.start(); startMonitorThreads(); }
public Object request(Object command, int timeout) throws IOException { FutureResponse response = asyncRequest(command, null); return response.getResult(timeout); }
public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if (logging) logWriter.logAsyncRequest(log, command); FutureResponse rc = next.asyncRequest(command, responseCallback); return rc; }
@Override public void stop() throws Exception { super.stop(); if (view != null) { view.unregister(); } } }
protected void transportListenerOnCommand(Command command) { if (transportListener != null) { transportListener.onCommand(command); } }
@Override public void start() throws Exception { if (!isMonitorStarted()) { startConnectCheckTask(); } super.start(); }
@Override public int getReceiveCounter() { int rc = 0; synchronized (reconnectMutex) { for (FanoutTransportHandler th : transports) { if (th.transport != null) { rc += th.transport.getReceiveCounter(); } } } return rc; }
@Override public void onFailure() { if (delegate != null) { delegate.onFailure(); } } });
/** * Returns a TransportLoggerFactory object which can be used to create TransportLogger objects. * @return a TransportLoggerFactory object */ public static synchronized TransportLoggerFactory getInstance() { if (instance == null) { instance = new TransportLoggerFactory(); } return instance; }
/** * Disable logging for all Transport Loggers at once. */ public static void disableAllTransportLoggers() { for (TransportLoggerView view : transportLoggerViews) { view.disableLogging(); } }
public Object request(Object command) throws IOException { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if (logging) logWriter.logRequest(log, command); Object rc = super.request(command); if (logging) logWriter.logResponse(log, command); return rc; }
public Object request(Object command) throws IOException { FutureResponse response = asyncRequest(command, null); return response.getResult(); }