To create a self-contained message that encapsulates a proxy:
// taken from the javadocs
RequestFactory myFactory = ...; MyFooProxy someProxy = ...; DefaultProxyStore store = new DefaultProxyStore(); ProxySerializer ser = myFactory.getSerializer(store); // More than one proxy could be serialized String key = ser.serialize(someProxy); // Create the flattened representation String payload = store.encode();To recreate the object:
ProxyStore store = new DefaultProxyStore(payload); ProxySerializer ser = myFactory.getSerializer(store); MyFooProxy someProxy = ser.deserialize(MyFooProxy.class, key);
In that case, should we store the key seperately. Or am I missing something??