private void sendVersionHeader() throws IOException { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeBytes("JMX"); output.writeByte(VersionTwo.getVersionIdentifier()); } }); }
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); } }
final int correlationId = clientRequestManager.reserveNextCorrelationId(future); try { write(new MessageWriter() {
private void sendVersionHeader() throws IOException { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeBytes("JMX"); output.writeByte(VersionTwo.getVersionIdentifier()); } }); }
private void sendVersionHeader() throws IOException { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeBytes("JMX"); output.writeByte(VersionTwo.getVersionIdentifier()); } }); }
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); } }
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); } }
final int correlationId = clientRequestManager.reserveNextCorrelationId(future); try { write(new MessageWriter() {
final int correlationId = clientRequestManager.reserveNextCorrelationId(future); try { write(new MessageWriter() {