Examples of StatefulContainer


Examples of org.jboss.ejb3.stateful.StatefulContainer

      StatefulBeanContext ctx = (StatefulBeanContext) ejbInv.getBeanContext();
      StatefulBeanContext root = ctx.getUltimateContainedIn();
     
      // Find out if the ultimate parent is clustered
      boolean clustered = false;
      StatefulContainer container = (StatefulContainer) root.getContainer();
      ClusteredStatefulCache clusteredCache = null;
      if (container.getCache() instanceof ClusteredStatefulCache)
      {
         clustered = true;
         clusteredCache = (ClusteredStatefulCache) container.getCache();
      }
     
      // Track nested calls to this tree so we know when the outer call
      // returns -- that's when we replicate
      if (clustered)        
         pushCallStack(root);
     
      boolean stackUnwound = false;
      Object rtn = null;
      try
      {
         rtn = invocation.invokeNext();
      }
      finally
      {
         stackUnwound = (clustered && isCallStackUnwound(root));
      }


      // We only replicate if the ultimate parent is clustered
      // TODO should we fail somehow during bean creation otherwise??
      boolean mustReplicate = clustered;
     
      // If the bean implements Optimized, we call isModified() even
      // if we know we won't replicate, as the bean might be expecting
      // us to call the method
      Object obj = invocation.getTargetObject();
      if (obj instanceof Optimized)
      {
         if (((Optimized) obj).isModified() == false)
         {
            mustReplicate = false;
         }
      }
     
      if (mustReplicate)
      {
         // Mark the bean for replication. If the call stack is not
         // unwound yet this will tell the outer caller the tree is
         // dirty even if the outer bean's isModified() returns false
         root.markedForReplication = true;
      }
     
      if (stackUnwound && root.markedForReplication)
      {
         clusteredCache.replicate(root);
      }
     
      if (ctx != root && ctx.markedForReplication)
      {
         // ctx is a ProxiedStatefulBeanContext that may have failed over
         // and needs to invalidate any remote nodes that hold stale refs
         // to their delegate. So we replicate it.
         container = (StatefulContainer) ctx.getContainer();
         StatefulCache cache = container.getCache();
         if (cache instanceof ClusteredStatefulCache)
         {
            clusteredCache = (ClusteredStatefulCache) cache;
            clusteredCache.replicate(ctx);
         }
View Full Code Here

Examples of org.jboss.ejb3.stateful.StatefulContainer

            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         else if (ejbType == EJB_TYPE.STATEFUL)
         {
            StatefulContainer container = getStatefulContainer(ejbIndex, getEnterpriseBeanMetaData(deployment, ejbName, JBossSessionBeanMetaData.class));
            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         else if (ejbType == EJB_TYPE.MESSAGE_DRIVEN)
         {
            MDB container = getMDB(ejbIndex, getEnterpriseBeanMetaData(deployment, ejbName, JBossMessageDrivenBeanMetaData.class));
            validateMDBTransactionAttribute(container);
            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         else if (ejbType == EJB_TYPE.SERVICE)
         {
            ServiceContainer container = getServiceContainer(ejbIndex, getEnterpriseBeanMetaData(deployment, ejbName, JBossServiceBeanMetaData.class));
            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         else if (ejbType == EJB_TYPE.CONSUMER)
         {
            ConsumerContainer container = getConsumerContainer(ejbIndex, getEnterpriseBeanMetaData(deployment, ejbName, JBossConsumerBeanMetaData.class));
            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         log.debug("found EJB3: ejbName=" + ejbName + ", class=" + className + ", type=" + ejbType);
      }
View Full Code Here

Examples of org.jboss.ejb3.stateful.StatefulContainer

      if (domain == null)
         throw new RuntimeException("No container configured with name '"
                 + containerName + "''");

      return new StatefulContainer(di.getClassLoader(), className,
              ejbNames.get(ejbIndex), (Domain) domain.getManager(), ctxProperties,
              deployment, beanMetaData);

   }
View Full Code Here

Examples of org.jboss.ejb3.stateful.StatefulContainer

            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         else if (ejbType == EJB_TYPE.STATEFUL)
         {
            StatefulContainer container = getStatefulContainer(ejbIndex, getEnterpriseBeanMetaData(deployment, ejbName, JBossSessionBeanMetaData.class));
            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         else if (ejbType == EJB_TYPE.MESSAGE_DRIVEN)
         {
            MDB container = getMDB(ejbIndex, getEnterpriseBeanMetaData(deployment, ejbName, JBossMessageDrivenBeanMetaData.class));
            validateMDBTransactionAttribute(container);
            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         else if (ejbType == EJB_TYPE.SERVICE)
         {
            ServiceContainer container = getServiceContainer(ejbIndex, getEnterpriseBeanMetaData(deployment, ejbName, JBossServiceBeanMetaData.class));
            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         else if (ejbType == EJB_TYPE.CONSUMER)
         {
            ConsumerContainer container = getConsumerContainer(ejbIndex, getEnterpriseBeanMetaData(deployment, ejbName, JBossConsumerBeanMetaData.class));
            container.setJaccContextId(getJaccContextId());
            containers.add(container);
         }
         log.debug("found EJB3: ejbName=" + ejbName + ", class=" + className + ", type=" + ejbType);
      }
View Full Code Here

Examples of org.jboss.ejb3.stateful.StatefulContainer

         throw new RuntimeException("Could not get container for bean class " + beanMetaData.getEjbClass()
               + " with bean name " + beanMetaData.getEjbName() + " because no container configured with name '"
               + containerName + "'");
      }

      return new StatefulContainer(di.getClassLoader(), className, ejbNames.get(ejbIndex),
            (Domain) domain.getManager(), ctxProperties, deployment, beanMetaData, deployment
                  .getAsynchronousProcessor());

   }
View Full Code Here

Examples of org.jboss.ejb3.stateful.StatefulContainer

            }
            break;
         case SFSB :
            try
            {
               container = new StatefulContainer(loader, beanClassName, ejbName, domain, ctxProperties, deployment, md);
            }
            catch (ClassNotFoundException cnfe)
            {
               throw new RuntimeException("Could not create SLSB Container for " + beanClassName, cnfe);
            }
View Full Code Here

Examples of org.jboss.ejb3.stateful.StatefulContainer

               // SFSB
               else if (sessionContainer instanceof StatefulContainer)
               {
                  // Cast
                  final StatefulContainer sfsb = (StatefulContainer) sessionContainer;

                  // Make new metrics
                  final BasicStatefulSessionMetrics metrics = new BasicStatefulSessionMetrics(stats, sfsb);

                  // Add to beanFactories
View Full Code Here

Examples of org.jboss.ejb3.stateful.StatefulContainer

            }
            break;
         case SFSB :
            try
            {
               container = new StatefulContainer(loader, beanClassName, ejbName, domain, ctxProperties, deployment, md);
            }
            catch (ClassNotFoundException cnfe)
            {
               throw new RuntimeException("Could not create SLSB Container for " + beanClassName, cnfe);
            }
View Full Code Here

Examples of org.jboss.ejb3.test.proxy.impl.common.container.StatefulContainer

      // Deploy Beans
      SfsbProxyEqualityTestCase.getBootstrap().deploy(SfsbProxyEqualityTestCase.class);

      // Create a SFSB Container
      StatefulContainer container = Utils.createSfsb(MyStatefulBean.class);
      log.info("Created SFSB Container: " + container.getName());
      SfsbProxyEqualityTestCase.setContainerName(container.getName());

      // Register Container w/ Remoting
      Dispatcher.singleton.registerTarget(container.getName(), container);

      // Install SFSB into MC
      SfsbProxyEqualityTestCase.getBootstrap().installInstance(container.getName(), container);
   }
View Full Code Here

Examples of org.jboss.ejb3.test.proxy.impl.common.container.StatefulContainer

    */
   @Override
   protected StatefulSessionLocalProxyFactory createSessionLocalProxyFactory() throws Throwable
   {
      // Get the SFSB Container
      StatefulContainer sfsb = this.getContainer();

      // Make a Local Proxy Factory
      StatefulSessionLocalProxyFactory factory = new StatefulSessionLocalProxyFactory(
            StatefulSessionLocalProxyFactory.class.getName(), sfsb.getName(), sfsb.getName(), sfsb.getMetaData(), sfsb
                  .getClassLoader(), null);

      // Start
      factory.start();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.