Package org.jboss.deployers.vfs.spi.structure

Examples of org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit


      SessionFactoryMetaData sessionFactoryMetaData = metaData.getSessionFactory();
      if (sessionFactoryMetaData == null)
         return;

      VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
      if (scanFromTop)
         vfsUnit = vfsUnit.getTopLevel();

      // build the hibernate bean
      BeanMetaData beanMetaData = sessionFactoryMetaData.getBeanMetaData(vfsUnit.getRoot());
      vfsUnit.addAttachment(BeanMetaData.class + "$Hibernate", beanMetaData);
      log.info("Created Hibernate bean: " + beanMetaData);
   }
View Full Code Here


   public void deploy(DeploymentUnit unit, T deployment) throws DeploymentException
   {
      if (unit instanceof VFSDeploymentUnit == false)
         return;
     
      VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;
      deploy(vfsDeploymentUnit, deployment);
   }
View Full Code Here

   public void undeploy(DeploymentUnit unit, T deployment)
   {
      if (unit instanceof VFSDeploymentUnit == false)
         return;
     
      VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;
      undeploy(vfsDeploymentUnit, deployment);
   }
View Full Code Here

   @Override
   protected PersistenceUnitsMetaData parse(DeploymentUnit unit, String name, PersistenceUnitsMetaData root) throws Exception
   {
      // Try to find the metadata
      VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;

      VirtualFile file = vfsDeploymentUnit.getMetaDataFile(name);
      if (file == null)
      {
         // FIXME: hack to get a war persistence unit
         try
         {
            file = vfsDeploymentUnit.getFile("WEB-INF/classes/META-INF/persistence.xml");
            if(file == null)
               return null;
         }
         catch(IllegalStateException e)
         {
View Full Code Here

         }
           
         log.debug("********* " + this.getClass().getSimpleName() + " Begin Unit: " + unit.getSimpleName() + " jar: "
               + jar.getName());
         DeploymentScope scope = null;
         VFSDeploymentUnit parent = unit.getParent();
         if (parent != null && parent.getSimpleName().endsWith(".ear")) // todo should look for metadata instead of ".ear"
         {
            scope = parent.getAttachment(DeploymentScope.class);
            if (scope == null)
            {
               scope = new JBoss5DeploymentScope(unit.getParent());
               parent.addAttachment(DeploymentScope.class, scope);
            }
         }
         JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
         du.setDefaultPersistenceProperties(defaultPersistenceProperties);
         Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, kernel, mbeanServer, unit, scope, metaData, persistenceUnitsMetaData,
View Full Code Here

            return;
         }
           
         log.debug("********* EJBRegistrationDepoyer Begin Unit: " + unit.getSimpleName() + " jar: " + jar.getName());
         DeploymentScope scope = null;
         VFSDeploymentUnit parent = unit.getParent();
         if (parent != null && parent.getSimpleName().endsWith(".ear")) // todo should look for metadata instead of ".ear"
         {
            scope = parent.getAttachment(DeploymentScope.class);
            if (scope == null)
            {
               scope = new JBoss5DeploymentScope(unit.getParent());
               parent.addAttachment(DeploymentScope.class, scope);
            }
         }
         JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
         du.setDefaultPersistenceProperties(defaultPersistenceProperties);
         Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, kernel, mbeanServer, unit, scope, null, null, null);
View Full Code Here

      boolean hasCp = (cpFiles != null && cpFiles.isEmpty() == false);

      WebBeanDiscoveryEnvironment environment = null;
      if (hasWB || hasCp)
      {
         VFSDeploymentUnit topUnit = unit.getTopLevel();
         environment = topUnit.getAttachment(WebBeanDiscoveryEnvironment.class);
         if (environment == null)
         {
            environment = new WebBeanDiscoveryEnvironment();
            topUnit.addAttachment(WebBeanDiscoveryEnvironment.class, environment);
         }
      }

      try
      {
         if (hasWB)
         {
            for (VirtualFile file : wbFiles)
               environment.addWebBeansXmlURL(file.toURL());
         }

         if (hasCp)
         {
            Module module = unit.getAttachment(Module.class);
            if (module == null)
            {
               VFSDeploymentUnit parent = unit.getParent();
               while (parent != null && module == null)
               {
                  module = parent.getAttachment(Module.class);
                  parent = parent.getParent();
               }
               if (module == null)
                  throw new DeploymentException("No module in deployment unit's hierarchy: " + unit.getName());
            }
View Full Code Here

      JBossRAMetaData jrmd = getInstance(metadata, JBossRAMetaData.class);
      if (jrmd != null)
         deployment.setRaXmlMetaData(jrmd);

      VFSDeploymentUnit parent = unit.getParent();
      String name = unit.getSimpleName();
      if (parent != null)
         name = parent.getSimpleName() + "#" + name;

      VirtualFile file = unit.getMetaDataFile(jeeSpecRarDD);
      deployment.getConnectorMetaData().setURL(file.toURL());
      metaDataRepository.addConnectorMetaData(name, deployment.getConnectorMetaData());
View Full Code Here

   {
      if (ignoreName(unit, name))
         return null;

      // Try to find the metadata
      VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;

      VirtualFile file = getMetadataFile(vfsDeploymentUnit, getOutput(), name, true);
      return (file != null && ignoreFile(vfsDeploymentUnit, file) == false) ? parseAndInit(vfsDeploymentUnit, file, root) : null;
   }
View Full Code Here

   protected T parse(DeploymentUnit unit, Set<String> names, T root) throws Exception
   {
      if (names == null || names.isEmpty())
         throw new IllegalArgumentException("Null or empty names.");

      VFSDeploymentUnit  vfsDeploymentUnit = (VFSDeploymentUnit)unit;

      List<VirtualFile> files = new ArrayList<VirtualFile>();
      Set<String> missingFiles = new HashSet<String>();
      Set<String> ignoredFiles = new HashSet<String>();
View Full Code Here

TOP

Related Classes of org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit

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.