Package org.jboss.deployers.structure.spi

Examples of org.jboss.deployers.structure.spi.DeploymentUnit


  public void deploy(DeploymentUnit du) throws DeploymentException {
       
    if (du instanceof VFSDeploymentUnit &&
          (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
              du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {   
      DeploymentUnit top=du;
     
      if (top.isTopLevel() == false) {
        top = du.getTopLevel();
      }
     
      VirtualFile root=((VFSDeploymentUnit)du).getRoot();
     
      logger.debug("Deployment descriptor file="+root);

      try {
        VirtualFile parent=((VFSDeploymentUnit)du).getRoot().getParent();
       
        long lastModTime=0;
       
        if (top instanceof VFSDeploymentUnit) {
          lastModTime = ((VFSDeploymentUnit)top).getRoot().getLastModified();
        } else {
          logger.warn("Unable to determine last modified time for: "+top);
        }
       
        // TODO: Need to be a more unique name, as it is possible that more
        // than one deployment descriptor may exist in the same AS archive
        BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), lastModTime);

        if (m_deploymentUnits.containsKey(unit.getName())) {
          doUndeploy(du, top);
        }
                   
         
        logger.info("Deploy: "+top.getSimpleName()+" relativePath="+
            du.getRelativePath());
       
        logger.debug("Deployment unit dir="+parent);
     
        // Explore the deployment unit (in place of previous VFSUtils.explode() which no longer exists)
View Full Code Here


  public void undeploy(DeploymentUnit du) {
   
    if (du instanceof VFSDeploymentUnit &&
        (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
            du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {   
      DeploymentUnit top=du;
     
      if (top.isTopLevel() == false) {
        top = du.getTopLevel();
      }
     
      try {
        BPELDeploymentUnit prev=m_deploymentUnits.get(top.getSimpleName());
       
        java.io.File deployFile=new java.io.File(((VFSDeploymentUnit)top).getRoot().asFileURL().getFile());
       
        // Undeploy if deployment unit no longer exists on the filesystem, OR
        // the last modified time of the cached deployment unit is older than
        // the last modified time of the current deployment unit, signifying
        // it has been updated and therefore must be undeployed first
       
        if (top instanceof VFSDeploymentUnit &&
            (deployFile.exists() == false ||
                (prev != null && prev.getLastModified() <
                    ((VFSDeploymentUnit)top).getRoot().getLastModified()))) {
          doUndeploy(du, top);
        } else {
          logger.debug("Not undeploying BPEL: "+top.getSimpleName()+" relativePath="+
              du.getRelativePath());
        }
      } catch(Exception e) {
        logger.error("Failed to undeploy '"+du+"'", e);
      }
View Full Code Here

  public void deploy(DeploymentUnit du) throws DeploymentException {
       
    if (du instanceof VFSDeploymentUnit &&
          (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
              du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {   
      DeploymentUnit top=du;
     
      if (top.isTopLevel() == false) {
        top = du.getTopLevel();
      }
     
      logger.info("Deploy: "+top.getSimpleName()+" relativePath="+
          du.getRelativePath());
     
      VirtualFile root=((VFSDeploymentUnit)du).getRoot();
     
      logger.debug("Deployment descriptor file="+root);

      try {
        VirtualFile parent=((VFSDeploymentUnit)du).getRoot().getParent();
       
        logger.debug("Deployment unit dir="+parent);
     
        VirtualFile tmp=VFSUtils.explode(parent);
       
        java.net.URL url=VFSUtils.getCompatibleURL(tmp);
       
        logger.debug("Deployment exploded to dir="+tmp+" URL="+url);

        long lastModTime=0;
       
        if (top instanceof VFSDeploymentUnit) {
          lastModTime = ((VFSDeploymentUnit)top).getRoot().getLastModified();
        } else {
          logger.warn("Unable to determine last modified time for: "+top);
        }
       
        // TODO: Need to be a more unique name, as it is possible that more
        // than one deployment descriptor may exist in the same AS archive
        BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), lastModTime);
       
        java.io.File ddfile=new java.io.File(url.getFile(), du.getSimpleName()); //BPELDeploymentUnit.BPEL_DEPLOY_XML);
       
        if (ddfile.exists() == false) {
          logger.error("Failed to deploy '"+ddfile+
View Full Code Here

  public void undeploy(DeploymentUnit du) {
   
    if (du instanceof VFSDeploymentUnit &&
        (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
            du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {   
      DeploymentUnit top=du;
     
      if (top.isTopLevel() == false) {
        top = du.getTopLevel();
      }
     
      logger.info("Undeploy: "+top.getSimpleName()+" relativePath="+
          du.getRelativePath());
     
      try {
        BPELDeploymentUnit prev=m_deploymentUnits.get(top.getSimpleName());
       
        // Undeploy if deployment unit no longer exists on the filesystem, OR
        // the last modified time of the cached deployment unit is older than
        // the last modified time of the current deployment unit, signifying
        // it has been updated and therefore must be undeployed first
        if (top instanceof VFSDeploymentUnit &&
            (((VFSDeploymentUnit)top).getRoot().exists() == false ||
                (prev != null && prev.getLastModified() <
                  ((VFSDeploymentUnit)top).getRoot().getLastModified()))) {
     
          // TODO: Unique name - see deploy
          BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), 0);
         
          // NOTE: File required to provide path for use in ODE
          // process store impl. When this is replaced, this information
          // will not be required.
          java.io.File ddfile=new java.io.File(((VFSDeploymentUnit)du).getRoot().toURL().getFile());
         
          unit.setDeploymentDescriptor(ddfile);

          synchronized(m_deploymentUnits) {
            m_deploymentUnits.remove(unit.getName());
           
            if (m_listener != null) {
              m_listener.undeploy(unit);
            }
          }
        } else {
          logger.info("Not undeploying BPEL: "+top.getSimpleName()+" relativePath="+
              du.getRelativePath());
        }
      } catch(Exception e) {
        logger.error("Failed to undeploy '"+du+"'", e);
      }
View Full Code Here

   public static String getBootstrapBeanName(DeploymentUnit unit)
   {
      if (unit == null)
         throw new IllegalArgumentException("Null deployment unit");

      DeploymentUnit top = unit.getTopLevel();
      return top.getName() + WELD_BOOTSTRAP_BEAN;
   }
View Full Code Here

    * @return true if there is bootstrap bean in attachments, false otherwise
    */
   public static boolean isBootstrapBeanPresent(DeploymentUnit unit)
   {
      String attachmentName = getBootstrapBeanAttachmentName(unit);
      DeploymentUnit top = unit.getTopLevel();
      return top.isAttachmentPresent(attachmentName);
   }
View Full Code Here

   public static boolean checkForWeldFilesAcrossDeployment(DeploymentUnit unit)
   {
      if (unit == null)
         throw new IllegalArgumentException("Null deployment unit");

      DeploymentUnit top = unit.getTopLevel();

      Boolean flag = top.getAttachment(WELD_DEPLOYMENT_FLAG, Boolean.class);
      if (flag != null)
         return flag;

      flag = checkForWeldFiles(top, true);
      top.addAttachment(WELD_DEPLOYMENT_FLAG, flag, Boolean.class);

      return flag;
   }
View Full Code Here

      return path;
   }

   public static String getGlobalBeanManagerPath(JavaEEModuleInformer moduleInformer, DeploymentUnit unit)
   {
      DeploymentUnit deploymentUnit = unit.isComponent() ? unit.getParent() : unit;
      String subcontexPathForBeanManager = getJndiSubcontexPathForBeanManager(moduleInformer, deploymentUnit);
      return "java:global/" + BEAN_MANAGER_GLOBAL_SUBCONTEXT + "/" + subcontexPathForBeanManager + "/BeanManager";
   }
View Full Code Here

      {
         return cl;
      }

      AbstractDeploymentClassLoaderPolicyModule abclm = (AbstractDeploymentClassLoaderPolicyModule) module;
      DeploymentUnit du = abclm.getDeploymentUnit();
      return du.getTopLevel().getClassLoader();
   }
View Full Code Here

  
   /** Ensure we handle DUs that we're not interested in */
   public void testNoNamedModules() throws DeploymentException
   {
      DUIH duih = new DUIH();
      DeploymentUnit unit = getDeploymentUnitProxy(duih);
      testee.deploy(unit);
      assertNull(duih.getNamedModuleMetaData(NamedModule.class));
   }
View Full Code Here

TOP

Related Classes of org.jboss.deployers.structure.spi.DeploymentUnit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.