[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Changing the way AbstractVFSDeployment serializes root
alesj
do-not-reply at jboss.com
Wed Aug 13 06:49:56 EDT 2008
"alesj" wrote :
| Or I can leave this one?
| Since how many times do we expect the root to be Memory VirtualFile? :-)
I've added this to AbstractVFSDeployment:
| /**
| * Should we serialize root directly.
| * e.g. the root is memory virtual file instance
| * @see org.jboss.virtual.plugins.context.memory.MemoryContextHandler
| *
| * @param directRootSerialization the direct root serialization flag
| */
| public void setDirectRootSerialization(boolean directRootSerialization)
| {
| this.directRootSerialization = directRootSerialization;
| }
|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
| {
| super.readExternal(in);
| directRootSerialization = in.readBoolean();
| if (directRootSerialization)
| root = (VirtualFile)in.readObject();
| else
| {
| VirtualFileSerializator serializator = (VirtualFileSerializator)in.readObject();
| root = serializator.getFile();
| }
| }
|
| public void writeExternal(ObjectOutput out) throws IOException
| {
| super.writeExternal(out);
| out.writeBoolean(directRootSerialization);
| if (directRootSerialization)
| out.writeObject(root);
| else
| out.writeObject(new VirtualFileSerializator(root));
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170293#4170293
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170293
More information about the jboss-dev-forums
mailing list