[jboss-user] [JBoss Microcontainer] - MemoryFileFactory in jboss-vfs 3.0.0.CR5

Ales Justin do-not-reply at jboss.com
Thu Jul 15 10:45:03 EDT 2010

Ales Justin [http://community.jboss.org/people/alesj] replied to the discussion

"MemoryFileFactory in jboss-vfs 3.0.0.CR5"

To view the discussion, visit: http://community.jboss.org/message/552818#552818

> The MemoryFileFactory class has been replaced with a InMemoryClassesDeployer which is a deployer targeted at the DESCRIBE stage. 
I wouldn't say replaced, the deployer used to use MFF, but now used different approach,
with temp file locations, instead of keeping bytes in-memory.
> What it does is that is mounts a temporary file system (by default in the servers tmp/vfs directory) that other deployments can add things to. In the ESB case, things like a generated servlets class, a wsdl file, and schema files would be added. 
> So our deployers we would do somethings like this:
> VirtualFile inMemRootDir = unit.getAttachment(InMemoryClassesDeployer.DYNAMIC_CLASS_KEY, VirtualFile.class);
> VirtualFile wsdlFile = VFS.getChild(inMemRootDir.getPathName() + "/" + serviceInfo.getWSDLFileName());
> *final* String wsdl = generateWsdl();
> VFSUtils.writeFile(wsdlFile, wsdl.getBytes());
> unit.appendMetaDataLocation(wsdlFile);
> Is this the intended usage of the InMemoryClassesDeployer?
Yes, the IMCD's intent is to create a new temp classpath root.

VirtualFile wsdlFile = VFS.getChild(inMemRootDir.getPathName() + "/" + serviceInfo.getWSDLFileName());
--> VirtualFile wsdlFile = inMemoryRootDir.getChild(serviceInfo.getWSDLFileName());

For "unit::appendMetaDataLocation", you should append file's owner directory, not the file itself.

> Now our deployer do not need to do any clean up in their undeploy methods as this is done by the InMemoryClassesDeployer which will remove the filesystem when the deployment is undeployed.


Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100715/0d224fb6/attachment.html 

More information about the jboss-user mailing list