/** {@inheritDoc} */ public void writeInt(final int val) throws IOException { marshaller.writeInt(val); }
/** {@inheritDoc} */ public void write(final Marshaller marshaller) throws IOException { marshaller.writeInt(value); }
/** {@inheritDoc} */ public void writeInt(final int val) throws IOException { output.writeInt(val); }
/** {@inheritDoc} */ public void writeInt(final int v) throws IOException { marshaller.writeInt(v); }
@Override public void write(DataOutput output) throws IOException { output.writeByte(GET_ATTRIBUTES); output.writeInt(correlationId); output.writeByte(OBJECT_NAME); Marshaller marshaller = prepareForMarshalling(output); marshaller.writeObject(name); marshaller.writeByte(STRING_ARRAY); marshaller.writeInt(attributes.length); for (String current : attributes) { marshaller.writeUTF(current); } marshaller.close(); } });
@Override public void write(DataOutput output) throws IOException { output.writeByte(GET_ATTRIBUTES); output.writeInt(correlationId); output.writeByte(OBJECT_NAME); Marshaller marshaller = prepareForMarshalling(output); marshaller.writeObject(name); marshaller.writeByte(STRING_ARRAY); marshaller.writeInt(attributes.length); for (String current : attributes) { marshaller.writeUTF(current); } marshaller.close(); } });
@Override public void write(DataOutput output) throws IOException { output.writeByte(INVOKE); output.writeInt(correlationId); output.writeByte(OBJECT_NAME); Marshaller marshaller = prepareForMarshalling(output); marshaller.writeObject(name); marshaller.writeByte(STRING); marshaller.writeUTF(operationName); marshaller.writeByte(OBJECT_ARRAY); if (params != null) { marshaller.writeInt(params.length); for (Object current : params) { marshaller.writeObject(current); } } else { marshaller.writeInt(0); } marshaller.writeByte(STRING_ARRAY); if (signature != null) { marshaller.writeInt(signature.length); for (String current : signature) { marshaller.writeUTF(current); } } else { marshaller.writeInt(0); } marshaller.close(); } });
@Override public void write(DataOutput output) throws IOException { output.writeByte(INVOKE); output.writeInt(correlationId); output.writeByte(OBJECT_NAME); Marshaller marshaller = prepareForMarshalling(output); marshaller.writeObject(name); marshaller.writeByte(STRING); marshaller.writeUTF(operationName); marshaller.writeByte(OBJECT_ARRAY); if (params != null) { marshaller.writeInt(params.length); for (Object current : params) { marshaller.writeObject(current); } } else { marshaller.writeInt(0); } marshaller.writeByte(STRING_ARRAY); if (signature != null) { marshaller.writeInt(signature.length); for (String current : signature) { marshaller.writeUTF(current); } } else { marshaller.writeInt(0); } marshaller.close(); } });
@Override public void write(DataOutput output) throws IOException { output.writeByte(CREATE_MBEAN); output.writeInt(correlationId); output.writeByte(INTEGER); output.writeInt(4); // Sending 4 parameters. Marshaller marshaller = prepareForMarshalling(output); marshaller.writeByte(STRING); marshaller.writeUTF(className); marshaller.writeByte(OBJECT_NAME); marshaller.writeObject(name); marshaller.writeByte(OBJECT_ARRAY); marshaller.writeInt(params.length); for (Object current : params) { marshaller.writeObject(current); } marshaller.writeByte(STRING_ARRAY); marshaller.writeInt(signature.length); for (String current : signature) { marshaller.writeUTF(current); } marshaller.close(); } });
@Override public void write(DataOutput output) throws IOException { output.writeByte(CREATE_MBEAN); output.writeInt(correlationId); output.writeByte(INTEGER); output.writeInt(4); // Sending 4 parameters. Marshaller marshaller = prepareForMarshalling(output); marshaller.writeByte(STRING); marshaller.writeUTF(className); marshaller.writeByte(OBJECT_NAME); marshaller.writeObject(name); marshaller.writeByte(OBJECT_ARRAY); marshaller.writeInt(params.length); for (Object current : params) { marshaller.writeObject(current); } marshaller.writeByte(STRING_ARRAY); marshaller.writeInt(signature.length); for (String current : signature) { marshaller.writeUTF(current); } marshaller.close(); } });
@Override public void write(DataOutput output) throws IOException { output.writeByte(ADD_NOTIFICATION_LISTENER); output.writeInt(correlationId); output.writeByte(OBJECT_NAME); Marshaller marshaller = prepareForMarshalling(output); marshaller.writeObject(name); // This indicates that the target is remote. marshaller.writeByte(INTEGER); marshaller.writeInt(notificationId); marshaller.writeByte(NOTIFICATION_FILTER); marshaller.writeObject(filter); marshaller.writeByte(OBJECT); marshaller.writeObject(null); marshaller.close(); } });
@Override public void write(DataOutput output) throws IOException { output.writeByte(ADD_NOTIFICATION_LISTENER); output.writeInt(correlationId); output.writeByte(OBJECT_NAME); Marshaller marshaller = prepareForMarshalling(output); marshaller.writeObject(name); // This indicates that the target is remote. marshaller.writeByte(INTEGER); marshaller.writeInt(notificationId); marshaller.writeByte(NOTIFICATION_FILTER); marshaller.writeObject(filter); marshaller.writeByte(OBJECT); marshaller.writeObject(handback); marshaller.close(); } });
@Override public void write(DataOutput output) throws IOException { output.writeByte(CREATE_MBEAN); output.writeInt(correlationId); output.writeByte(INTEGER); output.writeInt(5); // Sending 5 parameters. Marshaller marshaller = prepareForMarshalling(output); marshaller.writeByte(STRING); marshaller.writeUTF(className); marshaller.writeByte(OBJECT_NAME); marshaller.writeObject(name); marshaller.writeByte(OBJECT_NAME); marshaller.writeObject(loaderName); marshaller.writeByte(OBJECT_ARRAY); marshaller.writeInt(params.length); for (Object current : params) { marshaller.writeObject(current); } marshaller.writeByte(STRING_ARRAY); marshaller.writeInt(signature.length); for (String current : signature) { marshaller.writeUTF(current); } marshaller.close(); } });
@Override public void write(DataOutput output) throws IOException { output.writeByte(CREATE_MBEAN); output.writeInt(correlationId); output.writeByte(INTEGER); output.writeInt(5); // Sending 5 parameters. Marshaller marshaller = prepareForMarshalling(output); marshaller.writeByte(STRING); marshaller.writeUTF(className); marshaller.writeByte(OBJECT_NAME); marshaller.writeObject(name); marshaller.writeByte(OBJECT_NAME); marshaller.writeObject(loaderName); marshaller.writeByte(OBJECT_ARRAY); marshaller.writeInt(params.length); for (Object current : params) { marshaller.writeObject(current); } marshaller.writeByte(STRING_ARRAY); marshaller.writeInt(signature.length); for (String current : signature) { marshaller.writeUTF(current); } marshaller.close(); } });
Marshaller marshaller = targetContext.createMarshaller(HttpRemoteTransactionPeer.createMarshallingConf()); marshaller.start(Marshalling.createByteOutput(output)); marshaller.writeInt(id.getFormatId()); final byte[] gtid = id.getGlobalTransactionId(); marshaller.writeInt(gtid.length); marshaller.write(gtid); final byte[] bq = id.getBranchQualifier(); marshaller.writeInt(bq.length); marshaller.write(bq); marshaller.finish();
Marshaller marshaller = targetContext.createMarshaller(HttpRemoteTransactionPeer.createMarshallingConf()); marshaller.start(Marshalling.createByteOutput(output)); marshaller.writeInt(id.getFormatId()); final byte[] gtid = id.getGlobalTransactionId(); marshaller.writeInt(gtid.length); marshaller.write(gtid); final byte[] bq = id.getBranchQualifier(); marshaller.writeInt(bq.length); marshaller.write(bq); marshaller.finish();
public void writeClass(final Marshaller marshaller, final Class<?> clazz) throws IOException { marshaller.write(1); final Module module = Module.forClass(clazz); if (module == null) { marshaller.writeObject(null); } else { final ModuleIdentifier identifier = module.getIdentifier(); marshaller.writeObject(identifier.getName()); marshaller.writeObject(identifier.getSlot()); } final Class<?>[] interfaces = clazz.getInterfaces(); marshaller.writeInt(interfaces.length); for (Class<?> interfaze : interfaces) { marshaller.writeObject(interfaze.getName()); } } }
Marshaller marshaller = targetContext.createMarshaller(HttpRemoteTransactionPeer.createMarshallingConf()); marshaller.start(Marshalling.createByteOutput(output)); marshaller.writeInt(id.getFormatId()); final byte[] gtid = id.getGlobalTransactionId(); marshaller.writeInt(gtid.length); marshaller.write(gtid); final byte[] bq = id.getBranchQualifier(); marshaller.writeInt(bq.length); marshaller.write(bq); marshaller.finish();
@Override public void handleRequest(HttpServerExchange exchange) throws Exception { try { String timeoutString = exchange.getRequestHeaders().getFirst(TransactionConstants.TIMEOUT); if (timeoutString == null) { exchange.setStatusCode(StatusCodes.BAD_REQUEST); HttpRemoteTransactionMessages.MESSAGES.debugf("Exchange %s is missing %s header", exchange, TransactionConstants.TIMEOUT); return; } final Integer timeout = Integer.parseInt(timeoutString); exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, TransactionConstants.NEW_TRANSACTION.toString()); final LocalTransaction transaction = transactionContext.beginTransaction(timeout); final Xid xid = xidResolver.apply(transaction); final ByteArrayOutputStream out = new ByteArrayOutputStream(); Marshaller marshaller = MARSHALLER_FACTORY.createMarshaller(createMarshallingConf()); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(out))); marshaller.writeInt(xid.getFormatId()); marshaller.writeInt(xid.getGlobalTransactionId().length); marshaller.write(xid.getGlobalTransactionId()); marshaller.writeInt(xid.getBranchQualifier().length); marshaller.write(xid.getBranchQualifier()); marshaller.finish(); exchange.getResponseSender().send(ByteBuffer.wrap(out.toByteArray())); } catch (Exception e) { sendException(exchange, StatusCodes.INTERNAL_SERVER_ERROR, e); } } }
Marshaller marshaller = MARSHALLER_FACTORY.createMarshaller(createMarshallingConf()); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(out))); marshaller.writeInt(recoveryList.length); for (int i = 0; i < recoveryList.length; ++i) { Xid xid = recoveryList[i]; marshaller.writeInt(xid.getFormatId()); marshaller.writeInt(xid.getGlobalTransactionId().length); marshaller.write(xid.getGlobalTransactionId()); marshaller.writeInt(xid.getBranchQualifier().length); marshaller.write(xid.getBranchQualifier());