Package org.jboss.ejb3

Examples of org.jboss.ejb3.EJBContainer$SemaphoreLock


   {
      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


         }
         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())
      {
         EJBContainer container = (EJBContainer) obj;
         if (container.getEjbName().equals(ejbLink))
         {
            return container;
         }
      }
      return null;
View Full Code Here

      return null;
   }

   public String getEjbJndiName(String ejbLink, Class businessIntf)
   {
      EJBContainer container = getEjbContainer(ejbLink, businessIntf);
      if (container == null)
      {
         return null;
      }
      return ProxyFactoryHelper.getJndiName(container, businessIntf);
View Full Code Here

      return ProxyFactoryHelper.getJndiName(container, businessIntf);
   }

   public EJBContainer getEjbContainer(Ejb3Deployment deployment, Class businessIntf) throws NameNotFoundException
   {
      EJBContainer container = null;
      // search in myself
      for (Object obj : deployment.getEjbContainers().values())
      {
         EJBContainer newContainer = (EJBContainer) obj;
         if (container == newContainer) continue;
         if (ProxyFactoryHelper.publishesInterface(newContainer, businessIntf))
         {
            if (container != null) throw new NameNotFoundException("duplicated in " + errorName);
            container = newContainer;
View Full Code Here

      {
         log.warn("TIMER SERVICE IS NOT INSTALLED");
         return;
      }
      TimerServiceFacade timerService = (TimerServiceFacade) aTimerService;
      EJBContainer container = timerService.getContainer();
      // FIXME: do not assume that a TimedObjectInvoker is an EJBContainer
      ClassLoader loader = container.getClassloader();
     
      getEJBTimerService().restoreTimers(timerService.getContainerId(), loader);
   }
View Full Code Here

   {
      assert invocation instanceof EJBContainerInvocation : "Unexpected invocation type " + invocation.getClass()
            + " - expected " + EJBContainerInvocation.class;

      // get hold of the EJBContainer from the invocation
      EJBContainer ejbContainer = EJBContainer.getEJBContainer(invocation.getAdvisor());
     
      ClassLoader ejbContainerClassloader = ejbContainer.getClassloader();
      ClassLoader previousClassLoader = Thread.currentThread().getContextClassLoader();
      // TODO: Review for security manager privileged blocks
      try
      {
         // Set the TCCL to the EJBContainer's classloader
View Full Code Here

   }

   public Object invoke(Invocation invocation) throws Throwable
   {
      EJBContainerInvocation<StatelessContainer, StatelessBeanContext> ejb = (EJBContainerInvocation<StatelessContainer, StatelessBeanContext>) invocation;
      EJBContainer container = getEJBContainer(invocation);
      Pool pool = container.getPool();
      BeanContext<?> ctx = pool.get();
      assert ctx != null : "pool returned null instance";
      //ejb.setTargetObject(ctx.getInstance());
      ejb.setBeanContext(ctx);
      container.pushContext(ctx);

      boolean discard = false;

      try
      {
         return ejb.invokeNext();
      }
      catch (Exception ex)
      {
         discard = (ex instanceof EJBException) ||
                 ((ex instanceof RuntimeException || ex instanceof RemoteException) && !StatefulRemoveInterceptor.isApplicationException(ex, (MethodInvocation)invocation));
         throw ex;
      }
      finally
      {
         container.popContext();
         //ejb.setTargetObject(null);
         ejb.setBeanContext(null);
         if (discard) pool.discard(ctx);
         else pool.release(ctx);
      }
View Full Code Here

   }
  
   public Object invoke(Invocation invocation) throws Throwable
   {
      EJBContainerInvocation<EJBContainer, BeanContext<?>> containerInvocation = (EJBContainerInvocation<EJBContainer, BeanContext<?>>) invocation;
      EJBContainer container = getEJBContainer(invocation);
      ComponentStack ccm = container.getCachedConnectionManager();
      if(ccm == null)
      {
         log.warn("EJBTHREE-1028: No ejb3 CachedConnectionManager installed");
         return containerInvocation.invokeNext();
      }
View Full Code Here

public class CachedConnectionInterceptorFactory extends AbstractInterceptorFactory
{
   @Override
   public Object createPerClass(Advisor advisor)
   {
      EJBContainer container = EJBContainer.getEJBContainer(advisor);
      Set<String> unsharableResources = new HashSet<String>();
      JBossEnterpriseBeanMetaData metaData = container.getXml();
      ResourceReferencesMetaData resRefs = metaData.getResourceReferences();
      if(resRefs != null)
      {
         for(ResourceReferenceMetaData resRef : resRefs)
         {
View Full Code Here

   @Deprecated
   protected void addDependency(InjectionContainer container, Class<?> businessIntf)
   {
      log.warn("EJBTHREE-1828: calling deprecated addDependency");
     
      EJBContainer refCon = null;
      try
      {
         refCon = (EJBContainer) container.resolveEjbContainer(businessIntf);
      }
      catch(NameNotFoundException e)
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.