KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > poa > POAManagerMonitorLightImpl


1 package org.jacorb.poa;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1997-2004 Gerald Brose.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23 import org.apache.avalon.framework.logger.Logger;
24 import org.apache.avalon.framework.configuration.*;
25
26 import org.jacorb.poa.gui.*;
27 import org.jacorb.util.ObjectUtil;
28
29
30 /**
31  * A lightweight implementation of a POAManager monitor
32  *
33  * @author Reimo Tiedemann, FU Berlin
34  * @version 1.03, 12/08/99, RT
35  */

36
37 public class POAManagerMonitorLightImpl
38     implements POAManagerMonitor, Configurable
39 {
40     private POAManager model = null;
41
42     private org.jacorb.config.Configuration configuration = null;
43     private Logger logger;
44     private boolean doMonitor;
45
46     public void addPOA(String JavaDoc name)
47     {
48     }
49
50     public void closeMonitor() {
51     }
52
53     public void init(POAManager poaManager)
54     {
55         model = poaManager;
56     }
57        
58     public void configure(Configuration myConfiguration)
59         throws ConfigurationException
60     {
61         this.configuration = (org.jacorb.config.Configuration)myConfiguration;
62         logger = configuration.getNamedLogger("jacorb.poa.manager_monitor");
63         doMonitor =
64             configuration.getAttributeAsBoolean("jacorb.poa.monitoring",false);
65     }
66
67     public void openMonitor()
68     {
69         if ( doMonitor )
70         {
71             try
72             {
73                 POAManagerMonitor newMonitor =
74                     (POAManagerMonitor)ObjectUtil.classForName("org.jacorb.poa.POAManagerMonitorImpl").newInstance();
75                 newMonitor.init(model);
76                 newMonitor.configure(configuration);
77                 model.setMonitor(newMonitor);
78                 newMonitor.openMonitor();
79             }
80             catch (Throwable JavaDoc exception)
81             {
82                 if (logger.isErrorEnabled())
83                     logger.error( "Exception in closeMonitor(): " + exception.getMessage());
84             }
85         }
86     }
87     public void printMessage(String JavaDoc str) {
88     }
89     public void removePOA(String JavaDoc name) {
90     }
91     public void setToActive() {
92     }
93     public void setToDiscarding(boolean wait) {
94     }
95     public void setToHolding(boolean wait) {
96     }
97     public void setToInactive(boolean wait, boolean etherialize) {
98     }
99 }
100
101
102
103
104
105
106
107
Popular Tags