FileDocCategorySizeDatePackage
JBoss5DeploymentScope.javaAPI DocJBoss 4.2.13637Fri Jul 13 20:53:48 BST 2007org.jboss.ejb3.deployers

JBoss5DeploymentScope

public class JBoss5DeploymentScope extends Object implements org.jboss.ejb3.DeploymentScope
Abstraction for an EAR/WAR or anything that scopes EJB deployments
author
Bill Burke
version
$Revision: 55144 $

Fields Summary
private ConcurrentHashMap
deployments
private String
shortName
private String
baseName
Constructors Summary
public JBoss5DeploymentScope(org.jboss.deployers.spi.structure.DeploymentContext parent)

      // Use the root vfs path name
      this.shortName = parent.getRoot().getPathName();
      if( shortName.length() == 0 )
      {
         shortName = parent.getName();
         // this is a hack because VFS has gay URL name.
         if (shortName.endsWith("!/"))
         {
            this.shortName = shortName.substring(0, shortName.length() - 2);
         }
      }
      // Further reduce the path to the last component of the url name 
      int x = shortName.lastIndexOf('/");
      this.shortName = shortName.substring(x + 1);

      baseName = shortName;
      int idx = shortName.lastIndexOf('.");
      if( idx > 0 )
         baseName = shortName.substring(0, idx);
      deployments = (ConcurrentHashMap<String, Ejb3Deployment>)parent.getDeploymentUnit().getAttachment("EJB_DEPLOYMENTS");
      if (deployments == null)
      {
         deployments = new ConcurrentHashMap<String, Ejb3Deployment>();
         parent.getDeploymentUnit().addAttachment("EJB_DEPLOYMENTS", deployments);
      }
   
Methods Summary
public org.jboss.ejb3.Ejb3DeploymentfindRelativeDeployment(java.lang.String relativeName)

      if (relativeName.startsWith("../"))
      {
         relativeName = relativeName.substring(3);
      }
      return deployments.get(relativeName);
   
public java.lang.StringgetBaseName()

      return baseName;
   
public java.util.CollectiongetEjbDeployments()

      return deployments.values();
   
public java.lang.StringgetShortName()

      return shortName;
   
public voidregister(org.jboss.ejb3.Ejb3Deployment deployment)

      deployments.put(deployment.getDeploymentUnit().getShortName(), deployment);
   
public voidunregister(org.jboss.ejb3.Ejb3Deployment deployment)

      deployments.remove(deployment.getDeploymentUnit().getShortName());