1 /* 2 * @(#)MonitoringFactories.java 1.3 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 package com.sun.corba.se.spi.monitoring; 8 9 import com.sun.corba.se.impl.monitoring.MonitoredObjectFactoryImpl; 10 import com.sun.corba.se.impl.monitoring.MonitoredAttributeInfoFactoryImpl; 11 import com.sun.corba.se.impl.monitoring.MonitoringManagerFactoryImpl; 12 13 /** 14 * <p> 15 * 16 * @author Hemanth Puttaswamy 17 * </p> 18 * <p> 19 * This is used for getting the default factories for 20 * MonitoredObject, MonitoredAttributeInfo and MonitoringManager. We do not 21 * expect users to use the MonitoredAttributeInfo factory most of the time 22 * because the Info is automatically built by StringMonitoredAttributeBase 23 * and LongMonitoredAttributeBase. 24 * </p> 25 */ 26 public class MonitoringFactories { 27 /////////////////////////////////////// 28 // attributes 29 private static final MonitoredObjectFactoryImpl monitoredObjectFactory = 30 new MonitoredObjectFactoryImpl( ); 31 private static final MonitoredAttributeInfoFactoryImpl 32 monitoredAttributeInfoFactory = 33 new MonitoredAttributeInfoFactoryImpl( ); 34 private static final MonitoringManagerFactoryImpl monitoringManagerFactory = 35 new MonitoringManagerFactoryImpl( ); 36 37 38 /////////////////////////////////////// 39 // operations 40 41 /** 42 * <p> 43 * Gets the MonitoredObjectFactory 44 * </p> 45 * <p> 46 * 47 * @return a MonitoredObjectFactory 48 * </p> 49 */ 50 public static MonitoredObjectFactory getMonitoredObjectFactory( ) { 51 return monitoredObjectFactory; 52 } 53 54 /** 55 * <p> 56 * Gets the MonitoredAttributeInfoFactory. The user is not expected to use this 57 * Factory, since the MonitoredAttributeInfo is internally created by 58 * StringMonitoredAttributeBase, LongMonitoredAttributeBase and 59 * StatisticMonitoredAttribute. If User wants to create a MonitoredAttribute 60 * of some other special type like a DoubleMonitoredAttribute, they can 61 * build a DoubleMonitoredAttributeBase like LongMonitoredAttributeBase 62 * and build a MonitoredAttributeInfo required by MonitoredAttributeBase 63 * internally by using this Factory. 64 * </p> 65 * <p> 66 * 67 * @return a MonitoredAttributeInfoFactory 68 * </p> 69 */ 70 public static MonitoredAttributeInfoFactory 71 getMonitoredAttributeInfoFactory( ) 72 { 73 return monitoredAttributeInfoFactory; 74 } 75 76 /** 77 * <p> 78 * Gets the MonitoredManagerFactory. The user is not expected to use this 79 * Factory, since the ORB will be automatically initialized with the 80 * MonitoringManager. 81 * 82 * User can get hold of MonitoringManager associated with ORB by calling 83 * orb.getMonitoringManager( ) 84 * </p> 85 * <p> 86 * 87 * @return a MonitoredManagerFactory 88 * </p> 89 */ 90 public static MonitoringManagerFactory getMonitoringManagerFactory( ) { 91 return monitoringManagerFactory; 92 } 93 } 94