Examples of Ejb3Deployment


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

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

Examples of org.jboss.ejb3.Ejb3Deployment

/* 254 */     this.mbeanServer = server;
/*     */   }
/*     */
/*     */   public void undeploy(VFSDeploymentUnit unit)
/*     */   {
/* 260 */     Ejb3Deployment deployment = (Ejb3Deployment)unit.getAttachment(Ejb3Deployment.class);
/* 261 */     if (deployment == null) return;
/*     */
/*     */     try
/*     */     {
/* 265 */       deployment.destroy();
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 269 */       this.log.warn("Failed to destroy deployment " + deployment, e);
/*     */     }
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

/*     */       {
/*  82 */         log.warn("Message destination link '" + link + "' is relative, but no deployment scope found");
/*  83 */         return null;
/*     */       }
/*  85 */       String relativePath = link.substring(0, hashIndex);
/*  86 */       Ejb3Deployment dep = this.deploymentScope.findRelativeDeployment(relativePath);
/*  87 */       if (dep == null)
/*     */       {
/*  89 */         log.warn("Can't find a deployment for path '" + relativePath + "' of message destination link '" + link + "'");
/*  90 */         return null;
/*     */       }
/*  92 */       String name = link.substring(hashIndex + 1);
/*  93 */       return dep.resolveMessageDestination(name);
/*     */     }
/*  95 */     String jndiName = getMessageDestinationJNDIName(link);
/*  96 */     if (jndiName != null)
/*  97 */       return jndiName;
/*  98 */     for (Ejb3Deployment dep : this.deploymentScope.getEjbDeployments())
/*     */     {
/* 100 */       jndiName = dep.getMessageDestinationResolver().getMessageDestinationJNDIName(link);
/* 101 */       if (jndiName != null)
/* 102 */         return jndiName;
/*     */     }
/* 104 */     log.warn("Can't find a message destination for link '" + link + "' anywhere");
/* 105 */     return null;
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

/* 109 */             return pud;
/*     */           }
/*     */         }
/* 112 */         return null;
/*     */       }
/* 114 */       Ejb3Deployment dep = this.deploymentScope.findRelativeDeployment(relativePath);
/* 115 */       if (dep == null)
/*     */       {
/* 117 */         return null;
/*     */       }
/* 119 */       PersistenceUnitDeployment rtn = dep.getPersistenceUnitDeploymentInternal(name);
/* 120 */       return rtn;
/*     */     }
/* 122 */     PersistenceUnitDeployment rtn = getPersistenceUnitDeploymentInternal(unitName);
/* 123 */     if (rtn != null) return rtn;
/*     */
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

/*     */       {
/*  67 */         log.warn("ejb link '" + ejbLink + "' is relative, but no deployment scope found");
/*  68 */         return null;
/*     */       }
/*  70 */       String relativePath = ejbLink.substring(0, hashIndex);
/*  71 */       Ejb3Deployment dep = this.deploymentScope.findRelativeDeployment(relativePath);
/*  72 */       if (dep == null)
/*     */       {
/*  74 */         log.warn("can't find a deployment for path '" + relativePath + "' of ejb link '" + ejbLink + "'");
/*  75 */         return null;
/*     */       }
/*  77 */       String ejbName = ejbLink.substring(hashIndex + 1);
/*  78 */       return dep.getEjbContainer(ejbName, businessIntf);
/*     */     }
/*     */
/*  81 */     EJBContainer ejb = searchDeploymentInternally(ejbLink, businessIntf);
/*  82 */     if (ejb != null) return ejb;
/*  83 */     for (Object obj : Ejb3Registry.getContainers())
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

      Domain domain = new Domain(new AspectManager(), "Test", false);
      Map<String, Class<? extends PersistenceManagerFactory>> factories = new HashMap<String, Class<? extends PersistenceManagerFactory>>();
      factories.put("MyStatefulSessionFilePersistenceManager", MyStatefulSessionFilePersistenceManagerFactory.class);
      PersistenceManagerFactoryRegistry persistenceManagerFactoryRegistry = new PersistenceManagerFactoryRegistry();
      persistenceManagerFactoryRegistry.setFactories(factories);
      Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      deployment.setPersistenceManagerFactoryRegistry(persistenceManagerFactoryRegistry);
      MockStatefulContainer container = new MockStatefulContainer(cl, beanClassName, ejbName, domain, ctxProperties,
            deployment);
      container.instantiated();
      container.processMetadata();
      System.out.println("injectors = " + container.getInjectors());
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

      System.out.println(cl.getResource("jndi.properties"));
      String beanClassname = MyStatefulBean.class.getName();
      String ejbName = MyStatefulBean.class.getSimpleName();
      Domain domain = getDomain("Stateful Bean");
      Hashtable<?,?> ctxProperties = null;
      Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      deployment.setPersistenceManagerFactoryRegistry(getBootstrap().lookup("EJB3PersistenceManagerFactoryRegistry", PersistenceManagerFactoryRegistry.class));
      JBossSessionBeanMetaData beanMetaData = MetaDataHelper.getMetadataFromBeanImplClass(MyStatefulBean.class);
      StatefulContainer container = new StatefulContainer(cl, beanClassname, ejbName, domain, ctxProperties, deployment, beanMetaData);
     
      // TODO: wickedness
      container.instantiated();
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

      Class<?> beanClass = AnnotatedWebServiceContextInjectedBean.class;
      String beanClassname = beanClass.getName();
      String ejbName = beanClass.getSimpleName();
      Domain domain = getDomain("Stateless Bean");
      Hashtable<?,?> ctxProperties = null;
      Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      JBossSessionBeanMetaData beanMetaData = MetaDataHelper.getMetadataFromBeanImplClass(beanClass);
      StatelessContainer container = new StatelessContainer(cl, beanClassname, ejbName, domain, ctxProperties, deployment, beanMetaData);
     
      // TODO: wickedness
      container.instantiated();
View Full Code Here

Examples of org.jboss.ejb3.Ejb3Deployment

      Class<?> beanClass = OverrideWebServiceContextInjectedBean.class;
      String beanClassname = beanClass.getName();
      String ejbName = beanClass.getSimpleName();
      Domain domain = getDomain("Stateless Bean");
      Hashtable<?,?> ctxProperties = null;
      Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      JBossSessionBeanMetaData beanMetaData = MetaDataHelper.getMetadataFromBeanImplClass(beanClass);
     
      // add an override
     
      ResourceInjectionTargetMetaData injectionTarget = new ResourceInjectionTargetMetaData();
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.