Package org.jboss.ejb3

Examples of org.jboss.ejb3.Ejb3Deployment


            final String ejbName = ejbMD.determineContainerName();

            if (ejbMD.getEjbClass() != null)
            {
               this.log.debug("Creating webservice EJB adapter for: " + ejbName);
               final EJBContainer ejbContainer = this.getContainer(ejb3Deployment, ejbMD);
               endpoints.add(new WebServiceDeclarationAdapter(ejbMD, ejbContainer, unit.getClassLoader()));
            }
            else
            {
               this.log.warn("Ingoring EJB deployment with null classname: " + ejbName);
View Full Code Here


      EJBContainer container = null;
      EndpointInfo endpoint = endpointResolver.getEndpointInfo(businessIntf, EndpointType.EJB, vfsContext);
      if(endpoint != null)
      {
         log.debug("Found endpoint for interface: "+businessIntf+", endpoint: "+endpoint);
         Ejb3Deployment deployment = deployments.get(endpoint.getPathName());
         String ejbObjectName = JavaEEComponentHelper.createObjectName(deployment, endpoint.getName());
         ObjectName ejbON;
         try
         {
            ejbON = new ObjectName(ejbObjectName);
         }
         catch (Exception e)
         {
            throw new IllegalStateException("Failed to build ejb container ObjectName", e);
         }
         container = (EJBContainer) deployment.getContainer(ejbON);
         // TODO: container = deployment.getEjbContainerForEjbName(endpoint.getName());
      }
      else
      {
         log.debug("Failed to find endpoint for interface: "+businessIntf);
View Full Code Here

      // First try the ejbLink
      EndpointInfo endpoint = endpointResolver.getEndpointInfo(ejbLink, EndpointType.EJB, vfsContext);
      if(endpoint != null)
      {
         log.debug("Found endpoint for ejbLink: "+ejbLink+", endpoint: "+endpoint);
         Ejb3Deployment deployment = deployments.get(endpoint.getPathName());
         String ejbObjectName = JavaEEComponentHelper.createObjectName(deployment, endpoint.getName());
         ObjectName ejbON;
         try
         {
            ejbON = new ObjectName(ejbObjectName);
         }
         catch (Exception e)
         {
            throw new IllegalStateException("Failed to build ejb container ObjectName", e);
         }
         container = (EJBContainer) deployment.getContainer(ejbON);
         // TODO: container = deployment.getEjbContainerForEjbName(endpoint.getName());         container = deployment.getEjbContainerForEjbName(endpoint.getName());
      }
      else
      {
         log.debug("Failed to find endpoint for ejbLink: "+ejbLink);
View Full Code Here

   }

   @Override
   protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
   {
      Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
     
      try
      {
         // start the deployment
         ejb3Deployment.start();
      }
      catch (Exception e)
      {
         throw new DeploymentException("Error starting Ejb3Deployment: " + ejb3Deployment.getName(), e);
      }
   }
View Full Code Here

   }
  
   @Override
   public void undeploy(VFSDeploymentUnit unit, JBossMetaData metadata)
   {
      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

      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

   @Override
   protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
   {
      final JBossMetaData mergedMD = (JBossMetaData) unit
            .getAttachment(MergedJBossMetaDataDeployer.EJB_MERGED_ATTACHMENT_NAME);
      final Ejb3Deployment ejb3Deployment = ASHelper.getOptionalAttachment(unit, Ejb3Deployment.class);

      if (mergedMD != null)
      {
         final WebServiceDeploymentAdapter wsDeploymentAdapter = new WebServiceDeploymentAdapter();
         final List<WebServiceDeclaration> endpoints = wsDeploymentAdapter.getServiceEndpoints();
View Full Code Here

     
      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

         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

      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

TOP

Related Classes of org.jboss.ejb3.Ejb3Deployment

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.