0 Replies Latest reply on Jul 4, 2006 10:58 AM by thierry baudouin

    ServletStatsImpl in an MBEAN

    thierry baudouin Newbie


      Hello, i want to use ServletStatsImpl in an mbean but i have already 0 in these variable
      when i read attributes mbean with jmx-console :

      public void setServlet(boolean servlet)
      {
      System.out.println("J2EEManagedObject servlet : " + servlet + "\n");
      if(servlet && !isServletStarted)
      {
      System.out.println("J2EEManagedObject debut collecte stats servlet \n");
      ServletStats = new ServletStatsImpl();
      }
      if(!servlet && isServletStarted)
      {
      System.out.println("J2EEManagedObject fin collecte stats servlet \n");
      ServletStats = null;
      ServletTimeServiceCount = 0;
      ServletTimeServiceMax = 0;
      ServletTimeServiceMin = 0;
      ServletTimeServiceTotal = 0;
      }
      this.isServletStarted = servlet;
      }

      private void refreshServlet()
      {
      ServletTimeServiceCount = ServletStats.getServiceTime().getCount();
      ServletTimeServiceMax = ServletStats.getServiceTime().getMaxTime();
      ServletTimeServiceMin = ServletStats.getServiceTime().getMinTime();
      ServletTimeServiceTotal = ServletStats.getServiceTime().getTotalTime();
      System.out.println("J2EEManagedObject servlet Count: " + ServletTimeServiceCount + "\n");
      System.out.println("J2EEManagedObject servlet Max: " + ServletTimeServiceMax + "\n");
      System.out.println("J2EEManagedObject servlet Min: " + ServletTimeServiceMin + "\n");
      System.out.println("J2EEManagedObject servlet Total: " + ServletTimeServiceTotal + "\n");
      }

      i make request to my jboss but attributes are always 0 value.

      why ?