1 /*
   2  * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.corba.se.spi.monitoring;
  26 
  27 import com.sun.corba.se.impl.monitoring.MonitoredObjectFactoryImpl;
  28 import com.sun.corba.se.impl.monitoring.MonitoredAttributeInfoFactoryImpl;
  29 import com.sun.corba.se.impl.monitoring.MonitoringManagerFactoryImpl;
  30 
  31 /**
  32  * <p>
  33  *
  34  * @author Hemanth Puttaswamy
  35  * </p>
  36  * <p>
  37  *  This is used for getting the default factories for
  38  *  MonitoredObject, MonitoredAttributeInfo and MonitoringManager. We do not
  39  *  expect users to use the MonitoredAttributeInfo factory most of the time
  40  *  because the Info is automatically built by StringMonitoredAttributeBase
  41  *  and LongMonitoredAttributeBase.
  42  *  </p>
  43  */
  44 public class MonitoringFactories {
  45     ///////////////////////////////////////
  46     // attributes
  47     private static final MonitoredObjectFactoryImpl monitoredObjectFactory =
  48         new MonitoredObjectFactoryImpl( );
  49     private static final MonitoredAttributeInfoFactoryImpl
  50         monitoredAttributeInfoFactory =
  51         new MonitoredAttributeInfoFactoryImpl( );
  52     private static final MonitoringManagerFactoryImpl monitoringManagerFactory =
  53         new MonitoringManagerFactoryImpl( );
  54 
  55 
  56     ///////////////////////////////////////
  57     // operations
  58 
  59 /**
  60  * <p>
  61  * Gets the MonitoredObjectFactory
  62  * </p>
  63  * <p>
  64  *
  65  * @return a MonitoredObjectFactory
  66  * </p>
  67  */
  68     public static MonitoredObjectFactory getMonitoredObjectFactory( ) {
  69         return monitoredObjectFactory;
  70     }
  71 
  72 /**
  73  * <p>
  74  * Gets the MonitoredAttributeInfoFactory. The user is not expected to use this
  75  * Factory, since the MonitoredAttributeInfo is internally created by
  76  * StringMonitoredAttributeBase, LongMonitoredAttributeBase and
  77  * StatisticMonitoredAttribute. If User wants to create a MonitoredAttribute
  78  * of some other special type like a DoubleMonitoredAttribute, they can
  79  * build a DoubleMonitoredAttributeBase like LongMonitoredAttributeBase
  80  * and build a MonitoredAttributeInfo required by MonitoredAttributeBase
  81  * internally by using this Factory.
  82  * </p>
  83  * <p>
  84  *
  85  * @return a MonitoredAttributeInfoFactory
  86  * </p>
  87  */
  88     public static MonitoredAttributeInfoFactory
  89         getMonitoredAttributeInfoFactory( )
  90     {
  91         return monitoredAttributeInfoFactory;
  92     }
  93 
  94 /**
  95  * <p>
  96  * Gets the MonitoredManagerFactory. The user is not expected to use this
  97  * Factory, since the ORB will be automatically initialized with the
  98  * MonitoringManager.
  99  *
 100  * User can get hold of MonitoringManager associated with ORB by calling
 101  * orb.getMonitoringManager( )
 102  * </p>
 103  * <p>
 104  *
 105  * @return a MonitoredManagerFactory
 106  * </p>
 107  */
 108     public static MonitoringManagerFactory getMonitoringManagerFactory( ) {
 109         return monitoringManagerFactory;
 110     }
 111 }