Package org.jboss.ejb3.statistics

Examples of org.jboss.ejb3.statistics.InvocationStatistics


      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
      // Ensure that an @Clustered annotation is visible to AOP if the XML says the bean is  clustered.
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new ClusteredMetaDataBridge());
   }
View Full Code Here


      }
      // Real inflow invocation (ie. from MessageListener.onMessage())
      else
      {
         // Tell invoke stats we're starting
         final InvocationStatistics invokeStats = container.getInvokeStats();
         invokeStats.callIn();
         try
         {
            final long start = System.currentTimeMillis();
            returnValue = delivery(proxy, container, method, args);
            final long elapsed = System.currentTimeMillis() - start;
            invokeStats.updateStats(method, elapsed);
            if(log.isTraceEnabled())
            {
               log.trace("Invocation took " + elapsed + "ms: " + method);
            }
         }
         finally
         {
            // Tell invoke stats we're done
            invokeStats.callOut();
         }

      }

      // Return
View Full Code Here

   @Test
   public void testStats() throws Exception
   {
      AuroraLocal bean = lookup("AuroraBean/local", AuroraLocal.class);

      InvocationStatistics stats = container.getInvokeStats();

      // Since we don't have a prince at hand, lets not sleep forever
      bean.sleep(100, MILLISECONDS);
     
      InvocationStatistics.TimeStatistic methodStat = stats.getStats().get("sleep");
      assertNotNull(methodStat);
      long count = methodStat.getCount();
      assertEquals(1, count);
      long maxTime = methodStat.getMaxTime();
      long minTime = methodStat.getMinTime();
View Full Code Here

      }
      // Real inflow invocation (ie. from MessageListener.onMessage())
      else
      {
         // Tell invoke stats we're starting
         final InvocationStatistics invokeStats = container.getInvokeStats();
         invokeStats.callIn();
         try
         {
            final long start = System.currentTimeMillis();
            returnValue = delivery(proxy, container, method, args);
            final long elapsed = System.currentTimeMillis() - start;
            invokeStats.updateStats(method, elapsed);
            if(log.isTraceEnabled())
            {
               log.trace("Invocation took " + elapsed + "ms: " + method);
            }
         }
         finally
         {
            // Tell invoke stats we're done
            invokeStats.callOut();
         }

      }

      // Return
View Full Code Here

            {
               // Cast
               final SessionContainer sessionContainer = (SessionContainer) container;

               // Get the invocation stats
               final InvocationStatistics stats = sessionContainer.getInvokeStats();
               if (stats == null)
               {
                  throw new IllegalStateException("Invocation statistics was null");
               }
View Full Code Here

            {
               // Cast
               final SessionContainer sessionContainer = (SessionContainer) container;

               // Get the invocation stats
               final InvocationStatistics stats = sessionContainer.getInvokeStats();
               if (stats == null)
               {
                  throw new IllegalStateException("Invocation statistics was null");
               }
View Full Code Here

    * @return
    */
   private TimerService createTimerService()
   {
      // get the TimedObjectInvoker
      TimedObjectInvoker timedObjectInvoker = this.getTimedObjectInvoker();
      // if there's no TimedObjectInvoker, we can't do anything, so just
      // throw an exception
      if (timedObjectInvoker == null)
      {
         throw new IllegalStateException("Cannot create timerservice for EJB " + this.getEjbName()
View Full Code Here

      try
      {
         Thread.currentThread().setContextClassLoader(classloader);
         try
         {
            Util.rebind(getEnc(), "UserTransaction", new UserTransactionImpl());
         }
         catch (NamingException e)
         {
            NamingException namingException = new NamingException("Could not bind user transaction for ejb name " + ejbName + " into JNDI under jndiName: " + getEnc().getNameInNamespace() + "/" + "UserTransaction");
            namingException.setRootCause(e);
View Full Code Here

      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new AdditiveBeanInterceptorMetaDataBridge(this.beanClass, this.classloader, this.xml));
     
      List<MetaDataBridge<ApplicationExceptionMetaData>> appExceptionBridges = new ArrayList<MetaDataBridge<ApplicationExceptionMetaData>>();
      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
      // Ensure that an @Clustered annotation is visible to AOP if the XML says the bean is  clustered.
View Full Code Here

      interceptorBridges.add(new InterceptorMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new AdditiveBeanInterceptorMetaDataBridge(this.beanClass, this.classloader, this.xml));
     
      List<MetaDataBridge<ApplicationExceptionMetaData>> appExceptionBridges = new ArrayList<MetaDataBridge<ApplicationExceptionMetaData>>();
      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.statistics.InvocationStatistics

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.