001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.geronimo.console.util;
017:
018: import java.util.Map;
019: import javax.security.auth.Subject;
020: import javax.security.auth.login.LoginException;
021: import javax.security.auth.spi.LoginModule;
022:
023: import org.apache.geronimo.gbean.AbstractName;
024: import org.apache.geronimo.gbean.GBeanData;
025: import org.apache.geronimo.kernel.Naming;
026: import org.apache.geronimo.kernel.config.ConfigurationModuleType;
027: import org.apache.geronimo.kernel.repository.Artifact;
028: import org.apache.geronimo.management.AppClientModule;
029: import org.apache.geronimo.management.EJB;
030: import org.apache.geronimo.management.EJBModule;
031: import org.apache.geronimo.management.J2EEDeployedObject;
032: import org.apache.geronimo.management.J2EEModule;
033: import org.apache.geronimo.management.J2EEResource;
034: import org.apache.geronimo.management.JDBCDataSource;
035: import org.apache.geronimo.management.JDBCDriver;
036: import org.apache.geronimo.management.JDBCResource;
037: import org.apache.geronimo.management.JMSResource;
038: import org.apache.geronimo.management.Servlet;
039: import org.apache.geronimo.management.geronimo.J2EEApplication;
040: import org.apache.geronimo.management.geronimo.J2EEDomain;
041: import org.apache.geronimo.management.geronimo.J2EEServer;
042: import org.apache.geronimo.management.geronimo.JCAAdminObject;
043: import org.apache.geronimo.management.geronimo.JCAConnectionFactory;
044: import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
045: import org.apache.geronimo.management.geronimo.JCAResource;
046: import org.apache.geronimo.management.geronimo.JVM;
047: import org.apache.geronimo.management.geronimo.ResourceAdapter;
048: import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
049: import org.apache.geronimo.management.geronimo.WebModule;
050: import org.apache.geronimo.system.logging.SystemLog;
051:
052: /**
053: * A helper interface to navigate between management objects. This is not
054: * complete; it will be expanded as necessary.
055: *
056: * @version $Rev: 585954 $ $Date: 2007-10-18 06:09:12 -0700 (Thu, 18 Oct 2007) $
057: */
058: public interface ManagementHelper {
059: // root properties
060: J2EEDomain[] getDomains();
061:
062: // server properties
063: J2EEApplication[] getApplications(J2EEServer server);
064:
065: AppClientModule[] getAppClients(J2EEServer server);
066:
067: WebModule[] getWebModules(J2EEServer server);
068:
069: EJBModule[] getEJBModules(J2EEServer server);
070:
071: ResourceAdapterModule[] getRAModules(J2EEServer server);
072:
073: ResourceAdapterModule[] getOutboundRAModules(J2EEServer server,
074: String connectionFactoryInterface);
075:
076: ResourceAdapterModule[] getOutboundRAModules(J2EEServer server,
077: String[] connectionFactoryInterfaces);
078:
079: ResourceAdapterModule[] getAdminObjectModules(J2EEServer server,
080: String[] adminObjectInterfaces);
081:
082: JCAManagedConnectionFactory[] getOutboundFactories(
083: J2EEServer server, String connectionFactoryInterface);
084:
085: JCAResource[] getJCAResources(J2EEServer server);
086:
087: JDBCResource[] getJDBCResources(J2EEServer server);
088:
089: JMSResource[] getJMSResources(J2EEServer server);
090:
091: JVM[] getJavaVMs(J2EEServer server);
092:
093: J2EEResource[] getResources(J2EEServer server);
094:
095: // JVM properties
096: SystemLog getSystemLog(JVM jvm);
097:
098: // application properties
099: J2EEModule[] getModules(J2EEApplication application);
100:
101: AppClientModule[] getAppClients(J2EEApplication application);
102:
103: WebModule[] getWebModules(J2EEApplication application);
104:
105: EJBModule[] getEJBModules(J2EEApplication application);
106:
107: ResourceAdapterModule[] getRAModules(J2EEApplication application);
108:
109: JCAResource[] getJCAResources(J2EEApplication application);
110:
111: JDBCResource[] getJDBCResources(J2EEApplication application);
112:
113: JMSResource[] getJMSResources(J2EEApplication application);
114:
115: // module properties
116: EJB[] getEJBs(EJBModule module);
117:
118: Servlet[] getServlets(WebModule module);
119:
120: ResourceAdapter[] getResourceAdapters(ResourceAdapterModule module);
121:
122: JCAManagedConnectionFactory[] getOutboundFactories(
123: ResourceAdapterModule module);
124:
125: JCAManagedConnectionFactory[] getOutboundFactories(
126: ResourceAdapterModule module,
127: String connectionFactoryInterface);
128:
129: JCAManagedConnectionFactory[] getOutboundFactories(
130: ResourceAdapterModule module,
131: String[] connectionFactoryInterfaces);
132:
133: //todo: create an interface for admin objects
134: JCAAdminObject[] getAdminObjects(ResourceAdapterModule module,
135: String[] adminObjectInterfaces);
136:
137: // resource adapter properties
138: JCAResource[] getRAResources(ResourceAdapter adapter);
139:
140: // resource properties
141: JDBCDataSource[] getDataSource(JDBCResource resource);
142:
143: JDBCDriver[] getDriver(JDBCDataSource dataSource);
144:
145: JCAConnectionFactory[] getConnectionFactories(JCAResource resource);
146:
147: JCAManagedConnectionFactory getManagedConnectionFactory(
148: JCAConnectionFactory factory);
149:
150: // Generic utility methods
151: Object getObject(AbstractName abstractName);
152:
153: Artifact getConfigurationNameFor(AbstractName abstractName);
154:
155: String getGBeanDescription(AbstractName abstractName);
156:
157: // Misc
158: void testLoginModule(J2EEServer server, LoginModule module,
159: Map options);
160:
161: Subject testLoginModule(J2EEServer server, LoginModule module,
162: Map options, String username, String password)
163: throws LoginException;
164:
165: Object[] findByInterface(Class iface);
166:
167: AbstractName getNameFor(Object component);
168:
169: ConfigurationData[] getConfigurations(ConfigurationModuleType type,
170: boolean includeChildModules);
171:
172: /**
173: * Gets a JSR-77 Module (WebModule, EJBModule, etc.) for the specified configuration.
174: * Note: this only works if the configuration is running at the time you ask.
175: *
176: * @return The Module, or null if the configuration is not running.
177: */
178: J2EEDeployedObject getModuleForConfiguration(Artifact configuration);
179:
180: /**
181: * Adds a new GBean to an existing Configuration.
182: * @param configID The configuration to add the GBean to.
183: * @param gbean The data representing the GBean to add.
184: * @param start If true, the GBean should be started as part of this call.
185: */
186: public void addGBeanToConfiguration(Artifact configID,
187: GBeanData gbean, boolean start);
188:
189: /**
190: * This method returns the Naming object of the kernel.
191: */
192: public Naming getNaming();
193:
194: Object[] getGBeansImplementing(Class iface);
195: }
|