Package org.jboss.ejb3

Examples of org.jboss.ejb3.EJBContainer


      {
         // TODO: EJBTHREE-1291
         return ejbRefResolver.getEjbContainer(businessIntf);
      }

      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());
View Full Code Here


      {
         // TODO: EJBTHREE-1291
         return ejbRefResolver.getEjbContainer(ejbLink, businessIntf);
      }

      EJBContainer container = null;
      // First try the ejbLink
      EndpointInfo endpoint = endpointResolver.getEndpointInfo(ejbLink, EndpointType.EJB, vfsContext);
      if(endpoint != null)
      {
         log.debug("Found endpoint for ejbLink: "+ejbLink+", endpoint: "+endpoint);
View Full Code Here

      container.getEncInjectors().put(encName, injector);
   }

   public static EJBContainer getEjbContainer(EJB ref, InjectionContainer container, Class<?> memberType)
   {
      EJBContainer rtn = null;

      if (ref.mappedName() != null && !"".equals(ref.mappedName()))
      {
         return null;
      }
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);
      // the container cannot function without an InjectionManager
      if (injectionManager == null)
      {
         throw new RuntimeException("No InjectionManager found for bean: " + container.getEjbName() + " in unit: "
               + this.jbossUnit + " (or its component deployment unit)");
      }
      // setup the injectors for the bean and any of its interceptors
      this.setupInjectors(ejbContainer, injectionManager, switchBoard);
      // set the InjectionManager on the EJBContainer
      ejbContainer.setInjectionManager(injectionManager);
     
      super.registerEJBContainer(container);
   }
View Full Code Here

         log.info("\t" + smd.getSupply());
      }

      if(service instanceof EJBContainer)
      {
         EJBContainer container = EJBContainer.class.cast(service);
         // TODO: use an informer
         JavaEEModule module = container.getModule();
         String moduleName = stripSuffix(module.getName());
         JavaEEApplication app = module.getApplication();
         String appName = app != null ? stripSuffix(app.getName()) : null;
         String scopedBeanName = "application=" + (appName != null ? appName : moduleName) + ",module=" + moduleName + ",component=" + container.getEjbName();
         String encFactoryBeanName = "jboss.ejb3:" + scopedBeanName + ",service=EjbEncFactory";
         // create an EjbEncFactory for this container
         {
            BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(encFactoryBeanName, NamingComponentEjbEncFactory.class.getName());
            String componentBeanName = "jboss.naming:" + scopedBeanName;
            builder.addConstructorParameter(JavaEEComponent.class.getName(), new AbstractInjectionValueMetaData(componentBeanName));
            // TODO: is deployment always available at this stage?
            deployment.getBeanFactories().add(builder.getBeanMetaDataFactory());
         }
         // modify the container bean meta data to inject the EjbEncFactory
         BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(bean);
         //builder.addPropertyMetaData("namingComponent", new AbstractInjectionValueMetaData("java:comp"));
         builder.addPropertyMetaData("ejbEncFactory", new AbstractInjectionValueMetaData(encFactoryBeanName));
        
         // Add the BeanInstantiator injection into EJBContainer
         // TODO: (Jaikiran) Terrible hack! Use JavaEEComponentInformer to get the app name.
         // But for now, due to lack of time for 6.0.0.CR1 release, let's just use this hack
         if (appName == null)
         {
            appName = moduleName;
         }
         String beanInstantiatorMcName = BeanInstantiatorRegistration.getInstantiatorRegistrationName(appName, moduleName, container.getEjbName());
         builder.addPropertyMetaData("beanInstantiator", new AbstractInjectionValueMetaData(beanInstantiatorMcName));

         // ahem
         if(service instanceof StatelessContainer)
         {
View Full Code Here

      container.getEncInjectors().put(encName, injector);
   }

   public static EJBContainer getEjbContainer(EJB ref, InjectionContainer container, Class<?> memberType)
   {
      EJBContainer rtn = null;

      if (ref.mappedName() != null && !"".equals(ref.mappedName()))
      {
         return null;
      }
View Full Code Here

      }
   }

   public Context getJNDIContext(final Endpoint ep) throws NamingException
   {
      final EJBContainer ejb3Container = (EJBContainer) getEjb3Container();
      return (Context) ejb3Container.getEnc().lookup(EJB3_JNDI_PREFIX);
   }
View Full Code Here

            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

  
   abstract protected Handle createHandle();
  
   protected HomeHandle getHomeHandle()
   {
      EJBContainer ejbContainer = (EJBContainer)container;
     
      HomeHandleImpl homeHandle = null;
     
      RemoteBinding remoteBindingAnnotation = ejbContainer.getAnnotation(RemoteBinding.class);
      if (remoteBindingAnnotation != null)
         homeHandle = new HomeHandleImpl(ProxyFactoryHelper.getHomeJndiName(container));
     
      return homeHandle;
   }
View Full Code Here

      Class<?> remote = null;
      Class<?> home = null;
      Class<?> pkClass = Object.class;
      HomeHandleImpl homeHandle = null;
     
      EJBContainer ejbContainer = (EJBContainer)container;
     
      Class<?>[] remotes = ProxyFactoryHelper.getRemoteInterfaces(this.getContainer());
      if (remotes != null && remotes.length > 0)
      {
         remote = remotes[0];
      }
      RemoteHome homeAnnotation = ejbContainer.getAnnotation(RemoteHome.class);
      if (homeAnnotation != null)
         home = homeAnnotation.value();
      RemoteBinding remoteBindingAnnotation = ejbContainer.getAnnotation(RemoteBinding.class);
      if (remoteBindingAnnotation != null)
         homeHandle = new HomeHandleImpl(remoteBindingAnnotation.jndiBinding());
     
      EJBMetaDataImpl metadata = new EJBMetaDataImpl(remote, home, pkClass, true, false, homeHandle);
     
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.EJBContainer

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.