[jboss-dev-forums] [Deployers on JBoss (Deployers/JBoss)] - Re: Ordering of .ear subdeployments
vickyk
do-not-reply at jboss.com
Mon Jul 31 00:18:22 EDT 2006
anonymous wrote :
| E.g. I have the feeling if you do a listDeployed() on the MainDeployer you get back the list of deployments in the order they are actually deployed. So iterate those and see if you get what you'd expect.
|
After looking at the code I could see the following code sippet in the init of the MainDeployer
| if (!inLocalCopyDir(deployment.url) && deploymentList.contains(deployment) == false)
| {
| deploymentList.add(deployment);
| log.debug("Watching new file: " + deployment.url);
| }
|
The deploymentList contains the entries which will be rendered by the listDeployed() , this does not give the proper information if the deployments are packaged.
So the alternative to get the actual deployment ordering would be based on the lastDeployed field of the DeploymentInfo . This seems to be working appropriately .
The only concern in this case is that the precision is lost as the the lastDeployed field could be same for some of the sub-deployments. Actually this is because the System.currentTimeMillis() is not enough for this purpose .
We can either think of using the System.nanoTime() in the MainDeployer but by doing this we will loose the backward compartability , as this method has been a part of the jdk1.5 .
What i did to make the UnitTest give me the accurate results was to include the following code snippet
| deployment.lastModified=lastModified;
| //Introduced for Testing JBAS-2904
| try{
| Thread.sleep(1);
| }
| catch(InterruptedException ex){
| }
| //introduced for Testing JBAS-2904
| deployment.lastDeployed=System.currentTimeMillis();
|
This gives the proper lastDeployed precision .
Since this code won't be called so frequently , thus will not result in the performance hit . This gives the appropriate deployment ordering .
Are there any other ways we can get the actual Deployment Ordering ?
Regards
Vicky
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961761#3961761
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961761
More information about the jboss-dev-forums
mailing list