MonitoringFactories.java revision 672:2bb058ce572e
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 */
25package com.sun.corba.se.spi.monitoring;
26
27import com.sun.corba.se.impl.monitoring.MonitoredObjectFactoryImpl;
28import com.sun.corba.se.impl.monitoring.MonitoredAttributeInfoFactoryImpl;
29import com.sun.corba.se.impl.monitoring.MonitoringManagerFactoryImpl;
30
31/**
32 * @author Hemanth Puttaswamy
33 *
34 *  This is used for getting the default factories for
35 *  MonitoredObject, MonitoredAttributeInfo and MonitoringManager. We do not
36 *  expect users to use the MonitoredAttributeInfo factory most of the time
37 *  because the Info is automatically built by StringMonitoredAttributeBase
38 *  and LongMonitoredAttributeBase.
39 */
40public class MonitoringFactories {
41    ///////////////////////////////////////
42    // attributes
43    private static final MonitoredObjectFactoryImpl monitoredObjectFactory =
44        new MonitoredObjectFactoryImpl( );
45    private static final MonitoredAttributeInfoFactoryImpl
46        monitoredAttributeInfoFactory =
47        new MonitoredAttributeInfoFactoryImpl( );
48    private static final MonitoringManagerFactoryImpl monitoringManagerFactory =
49        new MonitoringManagerFactoryImpl( );
50
51
52    ///////////////////////////////////////
53    // operations
54
55/**
56 * Gets the MonitoredObjectFactory
57 *
58 * @return a MonitoredObjectFactory
59 */
60    public static MonitoredObjectFactory getMonitoredObjectFactory( ) {
61        return monitoredObjectFactory;
62    }
63
64/**
65 * Gets the MonitoredAttributeInfoFactory. The user is not expected to use this
66 * Factory, since the MonitoredAttributeInfo is internally created by
67 * StringMonitoredAttributeBase, LongMonitoredAttributeBase and
68 * StatisticMonitoredAttribute. If User wants to create a MonitoredAttribute
69 * of some other special type like a DoubleMonitoredAttribute, they can
70 * build a DoubleMonitoredAttributeBase like LongMonitoredAttributeBase
71 * and build a MonitoredAttributeInfo required by MonitoredAttributeBase
72 * internally by using this Factory.
73 *
74 * @return a MonitoredAttributeInfoFactory
75 */
76    public static MonitoredAttributeInfoFactory
77        getMonitoredAttributeInfoFactory( )
78    {
79        return monitoredAttributeInfoFactory;
80    }
81
82/**
83 * Gets the MonitoredManagerFactory. The user is not expected to use this
84 * Factory, since the ORB will be automatically initialized with the
85 * MonitoringManager.
86 *
87 * User can get hold of MonitoringManager associated with ORB by calling
88 * orb.getMonitoringManager( )
89 *
90 * @return a MonitoredManagerFactory
91 */
92    public static MonitoringManagerFactory getMonitoringManagerFactory( ) {
93        return monitoringManagerFactory;
94    }
95}
96