This content has been marked as final.
Show 3 replies
-
1. Re: Running a deployer on resource in classpath
alesj Nov 30, 2009 11:40 AM (in response to rareddy)That should be simple - extend AbstractSimpleVFSRealDeployer.
And use its VFSDeploymentUnit to find the resource you're looking for.
If it exists, do whatever ... -
2. Re: Running a deployer on resource in classpath
rareddy Dec 9, 2009 12:52 PM (in response to rareddy)I extended the my deployer using the AbstractSimpleVFSRealDeployer as below
public class SystemVDBDeployer extends AbstractSimpleVFSRealDeployer<SystemVDBMetadata> { public SystemVDBDeployer() { super(SystemVDBMetadata.class); } @Override public void deploy(VFSDeploymentUnit unit, SystemVDBMetadata deployment) throws DeploymentException { System.out.println("My deployer invoked"); } }
added the "-jboss-beans.xml" file to the "deployers" directory, but "deploy" call never invoked by the container.
Then I thought there is no "deployment unit" available for this to be invoked, so added "@ManagementDeployment" and "@ManagementObject" annotations to my metadata object "SystemVDBMetadata" class and deployed that object, this object is available as input to the deployer by adding "setInput", still the deployer never invoked.@ManagementObject @ManagementDeployment(types = {"vdb"}) public class SystemVDBMetadata implements Serializable { }
What I am confused is what will be my deployment unit in this case, as the resource I want to load is inside a JAR in "lib" directory. My intention was use the above code and once I am in the "deploy" call use the technique mentioned above to load resource.
Any suggestions as what I may be doing wrong?
Thank you. -
3. Re: Running a deployer on resource in classpath
alesj Dec 9, 2009 2:50 PM (in response to rareddy)"rareddy" wrote:
Then I thought there is no "deployment unit" available for this to be invoked, so added "@ManagementDeployment" and "@ManagementObject" annotations to my metadata object "SystemVDBMetadata" class and deployed that object, this object is available as input to the deployer by adding "setInput", still the deployer never invoked.@ManagementObject @ManagementDeployment(types = {"vdb"}) public class SystemVDBMetadata implements Serializable { }
There is no need for this -- this is just for management features, ProfileService etc."rareddy" wrote:
What I am confused is what will be my deployment unit in this case, as the resource I want to load is inside a JAR in "lib" directory. My intention was use the above code and once I am in the "deploy" call use the technique mentioned above to load resource.
Who creates and attaches this SystemVDBMetadata to DeploymentUnit?
Parsing deployers only look into metadata locations.
For spec defined deployments these are:
* META-INF for .jar and .ear
* WEB-INF for .war
(see StructureDeployer(s) for more details)
So, jar's lib directory won't be checked unless you explicitly configure it.
The DeploymentUnit == (Sub)Deployment == .ear or .war or .jar
(.jar which is not just lib, but real (sub)deployment)