use of com.sun.messaging.jmq.jmsserver.data.TransactionWork in project openmq by eclipse-ee4j.
the class ClusterTransaction2PPrepareEvent method readFromBytes.
@Override
public void readFromBytes(byte[] data) throws IOException, BrokerException {
if (Store.getDEBUG()) {
Globals.getLogger().log(Logger.DEBUG, getPrefix() + "readFromBytes");
}
ByteArrayInputStream bais = new ByteArrayInputStream(data);
DataInputStream dis = new DataInputStream(bais);
clusterTransaction = new ClusterTransaction();
dis.skip(2);
clusterTransaction.getTransactionDetails().readContent(dis);
if (Store.getDEBUG()) {
Globals.getLogger().log(Logger.DEBUG, getPrefix() + "read details " + clusterTransaction.getTransactionDetails());
}
TransactionWork work = new TransactionWork();
work.readWork(dis);
clusterTransaction.setTransactionWork(work);
int objectBodySize = dis.readInt();
byte[] objectBody = new byte[objectBodySize];
dis.read(objectBody);
ByteArrayInputStream bais2 = new ByteArrayInputStream(objectBody);
ObjectInputStream ois = new FilteringObjectInputStream(bais2);
try {
clusterTransaction.setTransactionState((TransactionState) ois.readObject());
clusterTransaction.setTransactionBrokers((TransactionBroker[]) ois.readObject());
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
ois.close();
bais2.close();
dis.close();
bais.close();
}
Aggregations