KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > server > resin > ResinAdmin


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Sam
28  */

29
30 package com.caucho.server.resin;
31
32 import com.caucho.Version;
33 import com.caucho.management.server.AbstractManagedObject;
34 import com.caucho.management.server.ClusterMXBean;
35 import com.caucho.management.server.ResinMXBean;
36 import com.caucho.management.server.ServerMXBean;
37 import com.caucho.server.util.CauchoSystem;
38 import com.caucho.util.L10N;
39
40 public class ResinAdmin extends AbstractManagedObject
41   implements ResinMXBean
42 {
43   private static final L10N L = new L10N(ResinAdmin.class);
44
45   private static final String JavaDoc THREAD_POOL_OBJECT_NAME = "resin:type=ThreadPool";
46
47   private final Resin _resin;
48
49   /**
50    * Creates the admin object and registers with JMX.
51    */

52   public ResinAdmin(Resin resin)
53   {
54     _resin = resin;
55
56     registerSelf();
57   }
58
59   public String JavaDoc getName()
60   {
61     return null;
62   }
63
64   //
65
// Hierarchy attributes
66
//
67

68   /**
69    * Returns the Clusters known to Resin.
70    */

71   public ClusterMXBean []getClusters()
72   {
73     return _resin.getClusters();
74   }
75
76   //
77
// Configuration attributes
78
//
79

80   public String JavaDoc getConfigFile()
81   {
82     return _resin.getResinConf().getNativePath();
83   }
84
85   public String JavaDoc getResinHome()
86   {
87     return _resin.getResinHome().getNativePath();
88   }
89
90   public String JavaDoc getRootDirectory()
91   {
92     return _resin.getRootDirectory().getNativePath();
93   }
94
95   public ServerMXBean getServer()
96   {
97     return _resin.getServer().getAdmin();
98   }
99
100   public String JavaDoc getVersion()
101   {
102     return Version.FULL_VERSION;
103   }
104   
105   public boolean isProfessional()
106   {
107     return _resin.isProfessional();
108   }
109
110   public String JavaDoc getLocalHost()
111   {
112     return CauchoSystem.getLocalHost();
113   }
114
115   public String JavaDoc toString()
116   {
117     return "ResinAdmin[" + getObjectName() + "]";
118   }
119 }
120
Popular Tags