use of com.swiftmq.tools.dump.DumpableFactory in project swiftmq-client by iitsoftware.
the class Versionable method create.
private Object create(VEntry entry) throws Exception {
DataByteArrayInputStream dis = new DataByteArrayInputStream();
dis.setBuffer(entry.versioned.getPayload(), 0, entry.versioned.getLength());
Object obj = null;
if (entry.version == -1) {
obj = DestinationFactory.createDestination(dis);
} else {
DumpableFactory factory = null;
if (classLoader == null)
factory = (DumpableFactory) Class.forName(entry.factoryClass).newInstance();
else
factory = (DumpableFactory) classLoader.loadClass(entry.factoryClass).newInstance();
Dumpable d = factory.createDumpable(dis.readInt());
d.readContent(dis);
obj = d;
}
return obj;
}
use of com.swiftmq.tools.dump.DumpableFactory in project swiftmq-client by iitsoftware.
the class CommandRegistry method readContent.
public void readContent(DataInput in) throws IOException {
DumpableFactory factory = new MgmtFactory();
contextName = readDump(in);
if (in.readByte() == 1)
myEntity = (Entity) Dumpalizer.construct(in, factory);
commands = new ArrayList();
int size = in.readInt();
for (int i = 0; i < size; i++) {
commands.add(Dumpalizer.construct(in, factory));
}
}
Aggregations