Package org.jboss.ejb3

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


         {
            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

  
   @Override
   protected void registerEJBContainer(Container container) throws Exception
   {
      // Add the jndi supplies
      MCDependencyPolicy dependsPolicy = (MCDependencyPolicy) container.getDependencyPolicy();
      EJBContainer ejbContainer = (EJBContainer) container;
      JBossEnterpriseBeanMetaData beanMD = ejbContainer.getXml();

      ContainerDependencyMetaData cdmd = null;
      if(endpoints != null)
      {
         String ejbKey = "ejb/" + jbossUnit.getRelativePath() + "#" + container.getEjbName();
         cdmd = endpoints.get(ejbKey);
      }
      else
      {
         log.warn(jbossUnit+" has no ContainerDependencyMetaData attachment");
      }

      if(cdmd != null)
      {
         for(String jndiName : cdmd.getJndiNames())
         {
         String supplyName = JNDIKernelRegistryPlugin.JNDI_DEPENDENCY_PREFIX + jndiName;
         AbstractSupplyMetaData supply = new AbstractSupplyMetaData(supplyName);
         dependsPolicy.getSupplies().add(supply);
         }
      }

      // EJBTHREE-1335: container name in meta data
      generateContainerName(container, beanMD);
     
      // setup switchboard
      Barrier switchBoard = this.getSwitchBoardBarrier(container);
      // the container cannot function without an SwitchBoard Barrier
      if (switchBoard == null)
      {
         throw new RuntimeException("No SwitchBoard Barrier found for bean: " + container.getEjbName() + " in unit: "
               + this.jbossUnit + " (or its component deployment unit)");
      }
      // add dependency on START (and not INSTALLED) state of Switchboard, since the container only requires a fully populated ENC context,
      // but doesn't require a invokable context. An invokable context is only needed by Injector.
      dependsPolicy.addDependency(this.createSwitchBoardDependency(ejbContainer, switchBoard));
      log.debug("Added dependency on Switchboard " + switchBoard.getId() + " for EJB container " + ejbContainer.getName());
     
     
      // create and setup Injector(s) for InjectionManager 
      InjectionManager injectionManager = this.getInjectionManager(container);
View Full Code Here

      }

      // Create the metadata for the bean to install
      AbstractBeanMetaData bean = new AbstractBeanMetaData(name, service.getClass().getName());
      bean.setConstructor(new AlreadyInstantiated(service));
      MCDependencyPolicy policy = (MCDependencyPolicy) dependencies;
      bean.setDepends(policy.getDependencies());
      bean.setDemands(policy.getDemands());
      bean.setSupplies(policy.getSupplies());
      log.info("installing bean: " + name);
      log.info("  with dependencies:");
      for (Object obj : policy.getDependencies())
      {
         Object msgObject = obj;
         if (obj instanceof AbstractDemandMetaData)
         {
            msgObject = ((AbstractDemandMetaData)obj).getDemand();
         }
         log.info("\t" + msgObject);
      }
      log.info("  and demands:");
      for(DemandMetaData dmd : policy.getDemands())
      {
         log.info("\t" + dmd.getDemand() + "; Required: " + dmd.getWhenRequired().getStateString());
      }
      log.info("  and supplies:");
      for(SupplyMetaData smd : policy.getSupplies())
      {
         log.info("\t" + smd.getSupply());
      }

      if(service instanceof EJBContainer)
View Full Code Here

   }

   private static String getLocalJndiName(JBossEnterpriseBeanMetaData ejb, Class<?> ejbClass)
   {
      // See if local binding is explicitly-defined
      LocalBinding localBinding = ejbClass.getAnnotation(LocalBinding.class);

      // If none specified
      if (localBinding == null || (localBinding.jndiBinding() != null && localBinding.jndiBinding().trim().length() == 0))
      {
         String name = ejb.getLocalJndiName();
         return name;
      }
      // Local Binding was explicitly-specified, use it
      else
      {
         return localBinding.jndiBinding();
      }
   }
View Full Code Here

      final Iterator<WebServiceDeclaration> ejbContainers = wsDeployment.getServiceEndpoints().iterator();

      while (ejbContainers.hasNext())
      {
         final WebServiceDeclaration ejbContainer = ejbContainers.next();
         final SecurityDomain nextSecurityDomain = ejbContainer.getAnnotation(SecurityDomain.class);

         securityDomain = this.getDomain(securityDomain, nextSecurityDomain);
      }

      return super.appendJaasPrefix(securityDomain);
View Full Code Here

      // must match JNDI name in jboss-client.xml or display-name in application-client.xml
      String name = new Date().toString();
      String applicationClientName = "ee5client_test";
      String args[] = { name };
     
      ClientLauncher launcher = new ClientLauncher();
      Properties env = getENCProps(applicationClientName);
      launcher.launch(mainClassName, applicationClientName, args, env);
     
      Class<?> clientClass = ClientLauncher.getTheMainClass();
      Class<?> empty[] = {};
      {
         Method getResult = clientClass.getDeclaredMethod("getResult", empty);
View Full Code Here

   {
      String mainClassName = SimpleResourceClient.class.getName();
      String applicationClientName = "ee5client-simpleresource-client"; // must match JNDI name in jboss-client.xml or display-name in application-client.xml
      String args[] = { };

      ClientLauncher launcher = new ClientLauncher();
      launcher.launch(mainClassName, applicationClientName, args);
   }
View Full Code Here

   {
      String mainClassName = SimpleResourceClient.class.getName();
      String applicationClientName = "ee5client-simpleresource-client"; // must match JNDI name in jboss-client.xml or display-name in application-client.xml
      String args[] = { };
     
      ClientLauncher launcher = new ClientLauncher();
      launcher.launch(mainClassName, applicationClientName, args);
   }
View Full Code Here

      // JNDI name in jboss-client.xml or display-name in application-client.xml, or client jar simple name
      String applicationClientName = "refs-client";
      String name = new Date().toString();
      String args[] = { name };
     
      ClientLauncher launcher = new ClientLauncher();
      Properties env = getENCProps(applicationClientName);
      launcher.launch(mainClassName, applicationClientName, args, env);

      // Need to use the client class obtained from the launcher
      Class<?> clientClass = ClientLauncher.getTheMainClass();
      Class<?> empty[] = {};
      {
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.