private String begin() throws IOException { VersionedIoFuture<TypeExceptionHolder<String>> future = new VersionedIoFuture<TypeExceptionHolder<String>>(); final int correlationId = clientRequestManager.reserveNextCorrelationId(future); try { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(BEGIN); output.writeInt(correlationId); } }); log.tracef("[%d] begin - Request Sent", correlationId); IoFuture.Status result = future.await(timeoutSeconds, TimeUnit.SECONDS); switch (result) { case FAILED: throw future.getException(); case DONE: TypeExceptionHolder<String> response = future.get(); if (response.e == null) { return response.value; } throw toIoException(response.e); default: throw new IOException("Unable to invoke begin, status=" + result.toString()); } } finally { clientRequestManager.releaseCorrelationId(correlationId); } }
clientRequestManager.releaseCorrelationId(correlationId);
public String[] getDomains() throws IOException { VersionedIoFuture<TypeExceptionHolder<String[]>> future = new VersionedIoFuture<TypeExceptionHolder<String[]>>(); final int correlationId = clientRequestManager.reserveNextCorrelationId(future); try { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(GET_DOMAINS); output.writeInt(correlationId); } }); log.tracef("[%d] getDomains - Request Sent", correlationId); IoFuture.Status result = future.await(timeoutSeconds, TimeUnit.SECONDS); switch (result) { case DONE: TypeExceptionHolder<String[]> response = future.get(); if (response.e == null) { return response.value; } jmRuntimeException(response.e); throw toIoException(response.e); case FAILED: throw future.getException(); default: throw new IOException("Unable to obtain Domains, status=" + result.toString()); } } finally { clientRequestManager.releaseCorrelationId(correlationId); } }
public String getDefaultDomain() throws IOException { VersionedIoFuture<TypeExceptionHolder<String>> future = new VersionedIoFuture<TypeExceptionHolder<String>>(); final int correlationId = clientRequestManager.reserveNextCorrelationId(future); try { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(GET_DEFAULT_DOMAIN); output.writeInt(correlationId); } }); log.tracef("[%d] getDefaultDomain - Request Sent", correlationId); IoFuture.Status result = future.await(timeoutSeconds, TimeUnit.SECONDS); switch (result) { case DONE: TypeExceptionHolder<String> response = future.get(); if (response.e == null) { return response.value; } jmRuntimeException(response.e); throw toIoException(response.e); case FAILED: throw future.getException(); default: throw new IOException("Unable to obtain DefaultDomain, status=" + result.toString()); } } finally { clientRequestManager.releaseCorrelationId(correlationId); } }
public Integer getMBeanCount() throws IOException { VersionedIoFuture<TypeExceptionHolder<Integer>> future = new VersionedIoFuture<TypeExceptionHolder<Integer>>(); final int correlationId = clientRequestManager.reserveNextCorrelationId(future); try { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(GET_MBEAN_COUNT); output.writeInt(correlationId); } }); log.tracef("[%d] getMBeanCount - Request Sent", correlationId); IoFuture.Status result = future.await(timeoutSeconds, TimeUnit.SECONDS); switch (result) { case DONE: TypeExceptionHolder<Integer> response = future.get(); if (response.e == null) { return response.value; } jmRuntimeException(response.e); throw toIoException(response.e); case FAILED: throw future.getException(); default: throw new IOException("Unable to obtain MBeanCount, status=" + result.toString()); } } finally { clientRequestManager.releaseCorrelationId(correlationId); } }
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);
clientRequestManager.releaseCorrelationId(correlationId);