Examples of Ejb3Deployment


Examples of org.jboss.ejb3.Ejb3Deployment

   }
  
   @Override
   public void undeploy(VFSDeploymentUnit unit)
   {
      Ejb3Deployment deployment = unit.getAttachment(Ejb3Deployment.class);
      if(deployment == null)
         return;

      try
      {
         deployment.stop();
      }
      catch(Exception e)
      {
         log.warn("Failed to stop deployment " + deployment, e);
      }
      try
      {
         deployment.destroy();
      }
      catch(Exception e)
      {
         log.warn("Failed to destroy deployment " + deployment, e);
      }
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

      return false;
   }
  
   public void undeploy(VFSDeploymentUnit unit)
   {
      Ejb3Deployment deployment = unit.getAttachment(Ejb3Deployment.class);
      if (deployment == null) return;
      try
      {
         deployment.stop();
      }
      catch (Exception e)
      {
         log.error("failed to stop deployment", e);
      }
      try
      {
         deployment.destroy();
      }
      catch (Exception e)
      {
         log.error("failed to destroy deployment", e);
      }
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

         public void removeClassLoader(org.jboss.deployers.structure.spi.DeploymentUnit unit) throws Exception
         {
         }
      });
      DeploymentUnit unit = new MockDeploymentUnit(deploymentUnit);
      Ejb3Deployment deployment = new MockEjb3Deployment(unit, deploymentUnit);

      deployment.setEJBReferenceResolver(new ScopedEJBReferenceResolver());
     
      /*
       * Create Metadata
       */

      // Create metadata
      JBossMetaData jbossMetaData = MetaDataHelper.getMetaDataFromBeanImplClasses(beanImplementationClasses);

      unit.addAttachment(AttachmentNames.PROCESSED_METADATA, jbossMetaData);
     
      // Iterate through each EJB
      for (JBossEnterpriseBeanMetaData beanMetaData : jbossMetaData.getEnterpriseBeans())
      {

         // Ensure a Session Bean
         assert beanMetaData.isSession() || beanMetaData.isService() : "The specified EJB must be a Session Bean or a Service Bean";

         // Cast
         JBossSessionBeanMetaData smd = (JBossSessionBeanMetaData) beanMetaData;

         /*
          * Determine type
          */

         // Initialize as SLSB
         ContainerType sessionType = ContainerType.SLSB;

         // Set as SFSB if stateful
         if (smd.isStateful())
         {
            sessionType = ContainerType.SFSB;
         }
         else if (beanMetaData.isService())
            sessionType = ContainerType.SERVICE;

         // Ensure jndi.properties is accessible
         log.info("Found: " + cl.getResource("jndi.properties"));

         // Obtain properties required of container construction
         String beanClassname = smd.getEjbClass();
         Domain domain = getDomain(sessionType.equals(ContainerType.SLSB)
               ? AbstractEJB3TestCase.DOMAIN_NAME_SLSB
               : AbstractEJB3TestCase.DOMAIN_NAME_SFSB);
         Hashtable<?, ?> ctxProperties = null;
        
         // Is SFSB, manually set a PM Factory Registry and Cache Factory
         //TODO C'mon, here?  Much better elsewhere.
         if (sessionType.equals(ContainerType.SFSB))
         {
            // Lookup Factory Registries in MC
            PersistenceManagerFactoryRegistry registry = Ejb3RegistrarLocator.locateRegistrar().lookup(
                  AbstractEJB3TestCase.OBJECT_STORE_NAME_PM_FACTORY_REGISTRY, PersistenceManagerFactoryRegistry.class);
            CacheFactoryRegistry cacheFactoryRegistry = Ejb3RegistrarLocator.locateRegistrar().lookup(
                  AbstractEJB3TestCase.OBJECT_STORE_NAME_CACHE_FACTORY_REGISTRY, CacheFactoryRegistry.class);

            // Set on the deployment
            deployment.setPersistenceManagerFactoryRegistry(registry);
            deployment.setCacheFactoryRegistry(cacheFactoryRegistry);
         }

         // Create a Session Container
         SessionContainer container = instanciateContainer(sessionType, cl, beanClassname, smd.getEjbName(), domain,
               ctxProperties, deployment, smd);
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

         public void removeClassLoader(org.jboss.deployers.structure.spi.DeploymentUnit unit) throws Exception
         {
         }
      });
      DeploymentUnit unit = new MockDeploymentUnit(deploymentUnit);
      Ejb3Deployment deployment = new MockEjb3Deployment(unit, deploymentUnit);

      deployment.setEJBReferenceResolver(new ScopedEJBReferenceResolver());
     
      Class<?> beanImplementationClasses[] = { TXNotSupportedMDB.class };
      JBossMetaData jbossMetaData = MetaDataHelper.getMetaDataFromBeanImplClasses(beanImplementationClasses);
      unit.addAttachment(AttachmentNames.PROCESSED_METADATA, jbossMetaData);
     
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

         {
            log.warn("ejb link '" + ejbLink + "' is relative, but no deployment scope found");
            return null;
         }
         String relativePath = ejbLink.substring(0, hashIndex);
         Ejb3Deployment dep = deploymentScope.findRelativeDeployment(relativePath);
         if (dep == null)
         {
            log.warn("can't find a deployment for path '" + relativePath + "' of ejb link '" + ejbLink + "'");
            return null;
         }
         String ejbName = ejbLink.substring(hashIndex + 1);
         return dep.getEjbContainer(ejbName, businessIntf);
      }
      // look internally
      EJBContainer ejb = searchDeploymentInternally(ejbLink, businessIntf);
      if (ejb != null) return ejb;
      for (Object obj : Ejb3Registry.getContainers())
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

         {
            log.warn("Message destination link '" + link + "' is relative, but no deployment scope found");
            return null;
         }
         String relativePath = link.substring(0, hashIndex);
         Ejb3Deployment dep = deploymentScope.findRelativeDeployment(relativePath);
         if (dep == null)
         {
            log.warn("Can't find a deployment for path '" + relativePath + "' of message destination link '" + link + "'");
            return null;
         }
         String name = link.substring(hashIndex + 1);
         return dep.resolveMessageDestination(name);
      }
      String jndiName = getMessageDestinationJNDIName(link);
      if(jndiName != null)
         return jndiName;
      for(Ejb3Deployment dep : deploymentScope.getEjbDeployments())
      {
         jndiName = dep.resolveMessageDestination(link);
         if(jndiName != null)
            return jndiName;
      }
      log.warn("Can't find a message destination for link '" + link + "' anywhere");
      return null;
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

         {
            log.warn("Message destination link '" + link + "' is relative, but no deployment scope found");
            return null;
         }
         String relativePath = link.substring(0, hashIndex);
         Ejb3Deployment dep = deploymentScope.findRelativeDeployment(relativePath);
         if (dep == null)
         {
            log.warn("Can't find a deployment for path '" + relativePath + "' of message destination link '" + link + "'");
            return null;
         }
         String name = link.substring(hashIndex + 1);
         return dep.resolveMessageDestination(name);
      }
      String jndiName = getMessageDestinationJNDIName(link);
      if(jndiName != null)
         return jndiName;
      for(Ejb3Deployment dep : deploymentScope.getEjbDeployments())
      {
         jndiName = dep.getMessageDestinationResolver().getMessageDestinationJNDIName(link);
         if(jndiName != null)
            return jndiName;
      }
      log.warn("Can't find a message destination for link '" + link + "' anywhere");
      return null;
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

                  return pud;
               }
            }
            return null;
         }
         Ejb3Deployment dep = deploymentScope.findRelativeDeployment(relativePath);
         if (dep == null)
         {
            return null;
         }
         PersistenceUnitDeployment rtn = dep.getPersistenceUnitDeploymentInternal(name);
         return rtn;
      }
      PersistenceUnitDeployment rtn = getPersistenceUnitDeploymentInternal(unitName);
      if (rtn != null) return rtn;
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

         {
            log.warn("ejb link '" + ejbLink + "' is relative, but no deployment scope found");
            return null;
         }
         String relativePath = ejbLink.substring(0, hashIndex);
         Ejb3Deployment dep = deploymentScope.findRelativeDeployment(relativePath);
         if (dep == null)
         {
            log.warn("can't find a deployment for path '" + relativePath + "' of ejb link '" + ejbLink + "'");
            return null;
         }
         String ejbName = ejbLink.substring(hashIndex + 1);
         return dep.getEjbContainer(ejbName, businessIntf);
      }
      // look internally
      EJBContainer ejb = searchDeploymentInternally(ejbLink, businessIntf);
      if (ejb != null) return ejb;
      for (Object obj : Ejb3Registry.getContainers())
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

         public void removeClassLoader(org.jboss.deployers.structure.spi.DeploymentUnit unit) throws Exception
         {
         }
      });
      DeploymentUnit unit = new MockDeploymentUnit(deploymentUnit);
      Ejb3Deployment deployment = new MockEjb3Deployment(unit, deploymentUnit);

      deployment.setEJBReferenceResolver(new ScopedEJBReferenceResolver());
     
      /*
       * Create Metadata
       */

      // Create metadata
      JBossMetaData jbossMetaData = MetaDataHelper.getMetaDataFromBeanImplClasses(beanImplementationClasses);

      unit.addAttachment(AttachmentNames.PROCESSED_METADATA, jbossMetaData);
     
      // Iterate through each EJB
      for (JBossEnterpriseBeanMetaData beanMetaData : jbossMetaData.getEnterpriseBeans())
      {

         // Ensure a Session Bean
         assert beanMetaData.isSession() || beanMetaData.isService() : "The specified EJB must be a Session Bean or a Service Bean";

         // Cast
         JBossSessionBeanMetaData smd = (JBossSessionBeanMetaData) beanMetaData;

         /*
          * Determine type
          */

         // Initialize as SLSB
         ContainerType sessionType = ContainerType.SLSB;

         // Set as SFSB if stateful
         if (smd.isStateful())
         {
            sessionType = ContainerType.SFSB;
         }
         else if (beanMetaData.isService())
            sessionType = ContainerType.SERVICE;

         // Ensure jndi.properties is accessible
         log.info("Found: " + cl.getResource("jndi.properties"));

         // Obtain properties required of container construction
         String beanClassname = smd.getEjbClass();
         Domain domain = getDomain(sessionType.equals(ContainerType.SLSB)
               ? AbstractEJB3TestCase.DOMAIN_NAME_SLSB
               : AbstractEJB3TestCase.DOMAIN_NAME_SFSB);
         Hashtable<?, ?> ctxProperties = null;
        
         // Is SFSB, manually set a PM Factory Registry and Cache Factory
         //TODO C'mon, here?  Much better elsewhere.
         if (sessionType.equals(ContainerType.SFSB))
         {
            // Lookup Factory Registries in MC
            PersistenceManagerFactoryRegistry registry = Ejb3RegistrarLocator.locateRegistrar().lookup(
                  AbstractEJB3TestCase.OBJECT_STORE_NAME_PM_FACTORY_REGISTRY, PersistenceManagerFactoryRegistry.class);
            CacheFactoryRegistry cacheFactoryRegistry = Ejb3RegistrarLocator.locateRegistrar().lookup(
                  AbstractEJB3TestCase.OBJECT_STORE_NAME_CACHE_FACTORY_REGISTRY, CacheFactoryRegistry.class);

            // Set on the deployment
            deployment.setPersistenceManagerFactoryRegistry(registry);
            deployment.setCacheFactoryRegistry(cacheFactoryRegistry);
         }

         // Create a Session Container
         SessionContainer container = instanciateContainer(sessionType, cl, beanClassname, smd.getEjbName(), domain,
               ctxProperties, deployment, smd);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.