Package org.jboss.ejb3

Examples of org.jboss.ejb3.EJBContainer$SemaphoreLock


   @Deprecated
   protected void addDependency(InjectionContainer container, String link, Class<?> businessIntf)
   {
      log.warn("EJBTHREE-1828: calling deprecated addDependency");
     
      EJBContainer refCon = (EJBContainer) container.resolveEjbContainer(link, businessIntf);
     
      // Do not depend on myself
      if(container.equals(refCon))
         return;
     
View Full Code Here


   {
      this.container = (StatefulContainer) container;
      Advisor advisor = container.getAdvisor();
      cacheMap = new CacheMap();
      PersistenceManager pmConfig = (PersistenceManager) advisor.resolveAnnotation(PersistenceManager.class);
      EJBContainer ejbContainer = (EJBContainer)container;
      String pmConfigValue = pmConfig.value();
      PersistenceManagerFactoryRegistry pmFactoryRegistry = ejbContainer.getDeployment()
            .getPersistenceManagerFactoryRegistry();
      PersistenceManagerFactory pmFactory = pmFactoryRegistry.getPersistenceManagerFactory(pmConfigValue);
      this.pm = pmFactory.createPersistenceManager();
      pm.initialize(container);
      CacheConfig config = (CacheConfig) advisor.resolveAnnotation(CacheConfig.class);
View Full Code Here

      return container;
   }

   public EJBContainer getEjbContainer(Class businessIntf) throws NameNotFoundException
   {
      EJBContainer rtnContainer = null;
      // search in deployment first
      rtnContainer = searchForEjbContainerInternally(businessIntf);
      if (rtnContainer != null) return rtnContainer;
      // search in EAR
      String jarName = null;
      if (deploymentScope != null)
      {
         for (Ejb3Deployment deployment : deploymentScope.getEjbDeployments())
         {
            EJBContainer newContainer = getEjbContainer(deployment, businessIntf);
            if (rtnContainer == newContainer) continue; // don't check self
            if (rtnContainer != null && newContainer != null)
            {
               throw new NameNotFoundException("duplicated in .ear within " + jarName +
                       " and " + deployment.getDeploymentUnit().getShortName());
            }
            if (newContainer != null)
            {
               rtnContainer = newContainer;
               jarName = deployment.getDeploymentUnit().getShortName();
            }
         }
      }
      if (rtnContainer != null)
      {
         return rtnContainer;
      }
      // search everywhere
      Iterator containers = Ejb3Registry.getContainers().iterator();
      while (containers.hasNext())
      {
         Container container = (Container)containers.next();
         EJBContainer ejbContainer = (EJBContainer) container;
         if (ejbContainer == rtnContainer) continue;
         if (ProxyFactoryHelper.publishesInterface(container, businessIntf))
         {
            if (rtnContainer != null)
            {
               throw new NameNotFoundException("duplicated in " + ejbContainer.getDeployment().getDeploymentUnit().getShortName()
                       + " and " + jarName);
            }
            rtnContainer = ejbContainer;
            jarName = ejbContainer.getDeployment().getDeploymentUnit().getShortName();
         }
      }
      if (rtnContainer != null) return rtnContainer;
      throw new NameNotFoundException("not used by any EJBs");
   }
View Full Code Here

   protected abstract EJBContainer searchForEjbContainerInternally(Class businessIntf) throws NameNotFoundException;

   public String getEjbJndiName(Class businessIntf) throws NameNotFoundException
   {
      EJBContainer container = getEjbContainer(businessIntf);
      String jndiName = ProxyFactoryHelper.getJndiName(container, businessIntf);
      if (jndiName == null) throw new NameNotFoundException("not used by any EJBs");
      return jndiName;
   }
View Full Code Here

{

   public Object createPerClass(Advisor advisor)
   {
      // Must be a separate line (EJBContainer cannot be dereferenced)
      EJBContainer container = EJBContainer.getEJBContainer(advisor);
      SecurityDomain securityAnnotation = (SecurityDomain) advisor.resolveAnnotation(SecurityDomain.class);
        
      //If there is no annotation, return a null action interceptor
      if(securityAnnotation == null)
         return new NullInterceptor();
      CodeSource ejbCS = advisor.getClazz().getProtectionDomain().getCodeSource();
      String ejbName = container.getEjbName();
      return new RoleBasedAuthorizationInterceptorv2(container, ejbCS, ejbName);
   }
View Full Code Here

   }

  
   protected void validateEjb21Views(){
     
      EJBContainer container = this.getContainer();
     
      LocalHome localHome = container.getAnnotation(LocalHome.class);
     
      // Ensure that if EJB 2.1 Components are defined, they're complete
      this.validateEjb21Views(localHome == null ? null : localHome.value(), ProxyFactoryHelper
            .getLocalInterfaces(container));
   }
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

//         container.getDependencyPolicy().addDependency(refcon.getObjectName().getCanonicalName());
//   }
  
   protected void addDependency(InjectionContainer container, Class<?> businessIntf)
   {
      EJBContainer refCon = null;
      try
      {
         refCon = (EJBContainer) container.resolveEjbContainer(businessIntf);
      }
      catch(NameNotFoundException e)
View Full Code Here

      ((JBoss5DependencyPolicy) container.getDependencyPolicy()).addDependency(businessIntf);
   }
  
   protected void addDependency(InjectionContainer container, String link, Class<?> businessIntf)
   {
      EJBContainer refCon = (EJBContainer) container.resolveEjbContainer(link, businessIntf);
     
      // Do not depend on myself
      if(container.equals(refCon))
         return;
     
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

TOP

Related Classes of org.jboss.ejb3.EJBContainer$SemaphoreLock

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.