JBoss Community

MemoryFileFactory in jboss-vfs 3.0.0.CR5

reply from Daniel Bevenius in JBoss Microcontainer - View the full discussion

Just wanted to verify my understanding of using the InMemoryClassesDeployer...

 

The MemoryFileFactory class has been replaced with a InMemoryClassesDeployer which is a deployer targeted at the DESCRIBE stage. 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?

 

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.

 

Regards,

 

/Daniel

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community