/** * Creates a new <code>MarshalledInstance</code> that contains the * marshalled representation of the current state of the supplied * object. The object is serialized with the semantics defined by * <code>MarshalOutputStream</code>. The output stream used to marshal the * object implements {@link ObjectStreamContext} and returns the given * collection from its {@link ObjectStreamContext#getObjectStreamContext * getObjectStreamContext} method. * * @param obj The Object to be contained in the new * <code>MarshalledInstance</code> * @param context the collection of context information objects * @throws IOException if the object cannot be serialized * @throws NullPointerException if <code>context</code> is <code>null</code> */ public MarshalledInstance(Object obj, final Collection context) throws IOException { this(obj, context, new MarshalFactoryInstance()); }
/** * Sub classes implement this method to use alternative Serialization * frameworks to unmarshall data. * @return a new MarshalFactory instance. */ protected MarshalFactory getMarshalFactory(){ return new MarshalFactoryInstance(); }