/*
 * JBoss, Home of Professional Open Source
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.management.j2ee.statistics;


import javax.management.j2ee.statistics.JMSConnectionStats;
import javax.management.j2ee.statistics.JMSStats;

/**
 * Represents the statistics provided by a JMS resource.
 * This class is immutable to avoid changes by the client
 * which could have side effects on the server when done
 * locally.
 *
 * @author <a href="mailto:marc@jboss.org">Marc Fleury</a>
 * @author Andreas Schaefer
 * @version $Revision: 1.4.6.3 $
 */
public final class JMSStatsImpl extends StatsBase
        implements JMSStats
{
   // Constants -----------------------------------------------------

   /** @since 4.0.2 */
   private static final long serialVersionUID = -1117058923390916234L;
   
   // Attributes ----------------------------------------------------

   private JMSConnectionStats[] mConnetions;

   // Constructors --------------------------------------------------

   public JMSStatsImpl(JMSConnectionStats[] pConnetions)
   {
      if (pConnetions == null)
      {
         pConnetions = new JMSConnectionStats[0];
      }
      mConnetions = pConnetions;
   }

   // Public --------------------------------------------------------

   // javax.management.j2ee.JMSStats implementation -----------------

   public JMSConnectionStats[] getConnections()
   {
      return mConnetions;
   }

}
