[jboss-dev-forums] [Design of POJO Server] - Re: VFS Permissions - JBMICROCONT-149
alesj
do-not-reply at jboss.com
Fri Nov 28 09:20:27 EST 2008
"anil.saldhana at jboss.com" wrote : This is because I got the policy working for the vfs urls and now the mc releases have switched to real urls.
|
You can do something like this:
| import org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule;
| import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
| import org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy;
| import org.jboss.deployers.plugins.classloading.AbstractClassLoaderDescribeDeployer;
| import org.jboss.deployers.spi.DeploymentException;
| import org.jboss.deployers.structure.spi.DeploymentUnit;
| import org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule;
|
| /**
| * VFSClassLoaderDescribeDeployer that exposes realURL flag in VFSDeploymentClassLoaderPolicyModule.
| *
| * @author ales.justin at jboss.org
| */
| public class VFSClassLoaderDescribeDeployer extends AbstractClassLoaderDescribeDeployer
| {
| /**
| * The useRealURL flag.
| */
| private boolean useRealURL;
|
| protected ClassLoaderPolicyModule createModule(DeploymentUnit unit, ClassLoadingMetaData classLoadingMetaData) throws DeploymentException
| {
| return new UseRealFlagVFSDeploymentClassLoaderPolicyModule(unit);
| }
|
| private class UseRealFlagVFSDeploymentClassLoaderPolicyModule extends VFSDeploymentClassLoaderPolicyModule
| {
| private UseRealFlagVFSDeploymentClassLoaderPolicyModule(DeploymentUnit deploymentUnit)
| {
| super(deploymentUnit);
| }
|
| @Override
| protected VFSClassLoaderPolicy determinePolicy()
| {
| VFSClassLoaderPolicy policy = super.determinePolicy();
| policy.setUseRealURL(useRealURL);
| return policy;
| }
| }
|
| /**
| * Set use real url flag.
| *
| * @param useRealURL the real url flag
| */
| public void setUseRealURL(boolean useRealURL)
| {
| this.useRealURL = useRealURL;
| }
| }
|
And change the existing VFSClassLoaderDescribeDeployer in deployers.xml.
Just make sure you add this class where deployers.xml classpath points to.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193038#4193038
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193038
More information about the jboss-dev-forums
mailing list