private void open(Endpoint endpoint) { if (endpoint.getLocalState() == EndpointState.UNINITIALIZED) { endpoint.open(); } }
@Override public boolean isClosed() { return getEndpoint().getLocalState() == EndpointState.CLOSED; }
private void close(Endpoint endpoint) { if (endpoint.getLocalState() != EndpointState.CLOSED) { endpoint.close(); } }
private void close(Endpoint endpoint) { if (endpoint.getLocalState() != EndpointState.CLOSED) { endpoint.close(); } }
private void open(Endpoint endpoint) { if (endpoint.getLocalState() == EndpointState.UNINITIALIZED) { endpoint.open(); } }
public boolean isClosed() { return getEndpoint().getLocalState() == EndpointState.CLOSED; }
public boolean isClosed() { return getEndpoint().getLocalState() == EndpointState.CLOSED; }
public EndpointState getLocalState() { if (getEndpoint() == null) { return EndpointState.UNINITIALIZED; } return getEndpoint().getLocalState(); }
public EndpointState getLocalState() { if (getEndpoint() == null) { return EndpointState.UNINITIALIZED; } return getEndpoint().getLocalState(); }
public EndpointState getLocalState() { if (getEndpoint() == null) { return EndpointState.UNINITIALIZED; } return getEndpoint().getLocalState(); }
public void fireListenerEvents(AmqpListener listener) { if( listener!=null && !listenerProcessing ) { if( endpoint.getLocalState() == EndpointState.UNINITIALIZED && endpoint.getRemoteState() != EndpointState.UNINITIALIZED ) { listenerProcessing = true; listener.processRemoteOpen(endpoint, new ProcessedTask()); } else if( endpoint.getLocalState() == EndpointState.ACTIVE && endpoint.getRemoteState() == EndpointState.CLOSED ) { listenerProcessing = true; listener.processRemoteClose(endpoint, new ProcessedTask()); } } if( attachment !=null && attachment instanceof Task ) { ((Task) attachment).run(); } }
@Override public void detach(AsyncResult request) { // If already closed signal success or else the caller might never get notified. if (getEndpoint().getLocalState() == EndpointState.CLOSED || getEndpoint().getRemoteState() == EndpointState.CLOSED) { if (getEndpoint().getLocalState() != EndpointState.CLOSED) { doDetach(); getEndpoint().free(); } request.onSuccess(); } else { this.closeRequest = request; doDetach(); } }
@Override public void close(AsyncResult request) { // If already closed signal success or else the caller might never get notified. if (getEndpoint().getLocalState() == EndpointState.CLOSED || getEndpoint().getRemoteState() == EndpointState.CLOSED) { if (getEndpoint().getLocalState() != EndpointState.CLOSED) { doClose(); getEndpoint().free(); } request.onSuccess(); } else { this.closeRequest = request; doClose(); } }
if (getEndpoint().getLocalState() == EndpointState.CLOSED || getEndpoint().getRemoteState() == EndpointState.CLOSED) { if (getEndpoint().getLocalState() != EndpointState.CLOSED) { getEndpoint().close(); getEndpoint().free();
if (getEndpoint().getLocalState() == EndpointState.CLOSED || getEndpoint().getRemoteState() == EndpointState.CLOSED) { if (getEndpoint().getLocalState() != EndpointState.CLOSED) { getEndpoint().close(); getEndpoint().free();