KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > console > util > ManagementHelper


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.geronimo.console.util;
18
19 import java.util.Map JavaDoc;
20 import javax.security.auth.Subject JavaDoc;
21 import javax.security.auth.login.LoginException JavaDoc;
22 import javax.security.auth.spi.LoginModule JavaDoc;
23
24 import org.apache.geronimo.gbean.AbstractName;
25 import org.apache.geronimo.gbean.GBeanData;
26 import org.apache.geronimo.kernel.Naming;
27 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
28 import org.apache.geronimo.kernel.repository.Artifact;
29 import org.apache.geronimo.management.AppClientModule;
30 import org.apache.geronimo.management.EJB;
31 import org.apache.geronimo.management.EJBModule;
32 import org.apache.geronimo.management.J2EEDeployedObject;
33 import org.apache.geronimo.management.J2EEModule;
34 import org.apache.geronimo.management.JDBCDataSource;
35 import org.apache.geronimo.management.JDBCDriver;
36 import org.apache.geronimo.management.JDBCResource;
37 import org.apache.geronimo.management.JMSResource;
38 import org.apache.geronimo.management.Servlet;
39 import org.apache.geronimo.management.geronimo.J2EEApplication;
40 import org.apache.geronimo.management.geronimo.J2EEDomain;
41 import org.apache.geronimo.management.geronimo.J2EEServer;
42 import org.apache.geronimo.management.geronimo.JCAAdminObject;
43 import org.apache.geronimo.management.geronimo.JCAConnectionFactory;
44 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
45 import org.apache.geronimo.management.geronimo.JCAResource;
46 import org.apache.geronimo.management.geronimo.JVM;
47 import org.apache.geronimo.management.geronimo.ResourceAdapter;
48 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
49 import org.apache.geronimo.management.geronimo.WebModule;
50 import org.apache.geronimo.system.logging.SystemLog;
51
52 /**
53  * A helper interface to navigate between management objects. This is not
54  * complete; it will be expanded as necessary.
55  *
56  * @version $Rev: 476229 $ $Date: 2006-11-17 12:48:02 -0500 (Fri, 17 Nov 2006) $
57  */

58 public interface ManagementHelper {
59     // root properties
60
J2EEDomain[] getDomains();
61
62     // server properties
63
J2EEApplication[] getApplications(J2EEServer server);
64     AppClientModule[] getAppClients(J2EEServer server);
65     WebModule[] getWebModules(J2EEServer server);
66     EJBModule[] getEJBModules(J2EEServer server);
67     ResourceAdapterModule[] getRAModules(J2EEServer server);
68     ResourceAdapterModule[] getOutboundRAModules(J2EEServer server, String JavaDoc connectionFactoryInterface);
69     ResourceAdapterModule[] getOutboundRAModules(J2EEServer server, String JavaDoc[] connectionFactoryInterfaces);
70     ResourceAdapterModule[] getAdminObjectModules(J2EEServer server, String JavaDoc[] adminObjectInterfaces);
71     JCAManagedConnectionFactory[] getOutboundFactories(J2EEServer server, String JavaDoc connectionFactoryInterface);
72     JCAResource[] getJCAResources(J2EEServer server);
73     JDBCResource[] getJDBCResources(J2EEServer server);
74     JMSResource[] getJMSResources(J2EEServer server);
75     JVM[] getJavaVMs(J2EEServer server);
76
77     // JVM properties
78
SystemLog getSystemLog(JVM jvm);
79
80     // application properties
81
J2EEModule[] getModules(J2EEApplication application);
82     AppClientModule[] getAppClients(J2EEApplication application);
83     WebModule[] getWebModules(J2EEApplication application);
84     EJBModule[] getEJBModules(J2EEApplication application);
85     ResourceAdapterModule[] getRAModules(J2EEApplication application);
86     JCAResource[] getJCAResources(J2EEApplication application);
87     JDBCResource[] getJDBCResources(J2EEApplication application);
88     JMSResource[] getJMSResources(J2EEApplication application);
89
90     // module properties
91
EJB[] getEJBs(EJBModule module);
92     Servlet[] getServlets(WebModule module);
93     ResourceAdapter[] getResourceAdapters(ResourceAdapterModule module);
94     JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module);
95     JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module, String JavaDoc connectionFactoryInterface);
96     JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module, String JavaDoc[] connectionFactoryInterfaces);
97     //todo: create an interface for admin objects
98
JCAAdminObject[] getAdminObjects(ResourceAdapterModule module, String JavaDoc[] adminObjectInterfaces);
99
100     // resource adapter properties
101
JCAResource[] getRAResources(ResourceAdapter adapter);
102
103     // resource properties
104
JDBCDataSource[] getDataSource(JDBCResource resource);
105     JDBCDriver[] getDriver(JDBCDataSource dataSource);
106     JCAConnectionFactory[] getConnectionFactories(JCAResource resource);
107     JCAManagedConnectionFactory getManagedConnectionFactory(JCAConnectionFactory factory);
108
109     // Generic utility methods
110
Object JavaDoc getObject(AbstractName abstractName);
111     Artifact getConfigurationNameFor(AbstractName abstractName);
112     String JavaDoc getGBeanDescription(AbstractName abstractName);
113
114     // Misc
115
void testLoginModule(J2EEServer server, LoginModule JavaDoc module, Map JavaDoc options);
116     Subject JavaDoc testLoginModule(J2EEServer server, LoginModule JavaDoc module, Map JavaDoc options, String JavaDoc username, String JavaDoc password) throws LoginException JavaDoc;
117     Object JavaDoc[] findByInterface(Class JavaDoc iface);
118     AbstractName getNameFor(Object JavaDoc component);
119     ConfigurationData[] getConfigurations(ConfigurationModuleType type, boolean includeChildModules);
120     /**
121      * Gets a JSR-77 Module (WebModule, EJBModule, etc.) for the specified configuration.
122      * Note: this only works if the configuration is running at the time you ask.
123      *
124      * @return The Module, or null if the configuration is not running.
125      */

126     J2EEDeployedObject getModuleForConfiguration(Artifact configuration);
127
128     /**
129      * Adds a new GBean to an existing Configuration.
130      * @param configID The configuration to add the GBean to.
131      * @param gbean The data representing the GBean to add.
132      * @param start If true, the GBean should be started as part of this call.
133      */

134     public void addGBeanToConfiguration(Artifact configID, GBeanData gbean, boolean start);
135
136     /**
137      * This method returns the Naming object of the kernel.
138      */

139     public Naming getNaming();
140
141     Object JavaDoc[] getGBeansImplementing(Class JavaDoc iface);
142 }
143
Popular Tags