geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiv...@apache.org
Subject svn commit: r677509 - in /geronimo/server/trunk/plugins: console/console-core/src/main/java/org/apache/geronimo/console/util/ plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/ plancreator/plancreator-portlets/src...
Date Thu, 17 Jul 2008 06:22:35 GMT
Author: shivahr
Date: Wed Jul 16 23:22:34 2008
New Revision: 677509

URL: http://svn.apache.org/viewvc?rev=677509&view=rev
Log:
Reverting changes made in "Revision: 675220 GERONIMO-4189 Enable Geronimo Eclipse Plug-in
(GEP) to get dynamic information from server". Geronimo Eclipse Plug-in should instead use
JMX (please see GERONIMODEVTOOLS-434).

Removed:
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/ServerInfoServlet.java
Modified:
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml

Modified: geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java?rev=677509&r1=677508&r2=677509&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java
(original)
+++ geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java
Wed Jul 16 23:22:34 2008
@@ -40,9 +40,7 @@
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.management.EJBModule;
 import org.apache.geronimo.management.J2EEDeployedObject;
-import org.apache.geronimo.management.J2EEResource;
 import org.apache.geronimo.management.geronimo.J2EEDomain;
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.JCAAdminObject;
@@ -123,15 +121,7 @@
             request.getPortletSession().setAttribute(DOMAIN_KEY, domain, PortletSession.APPLICATION_SCOPE);
         }
         return domain;
-    }
 
-    public static J2EEDomain getCurrentDomain(HttpSession session) {
-        J2EEDomain domain = (J2EEDomain) session.getAttribute(DOMAIN_KEY);
-        if (domain == null) {
-            domain = getManagementHelper(session).getDomains()[0]; //todo: some day, select
a domain
-            session.setAttribute(DOMAIN_KEY, domain);
-        }
-        return domain;
     }
 
     public static J2EEServer getCurrentServer(PortletRequest request) {
@@ -145,17 +135,6 @@
         return server;
     }
 
-    public static J2EEServer getCurrentServer(HttpSession session) {
-        J2EEServer server = (J2EEServer) session.getAttribute(SERVER_KEY);
-        if (server == null) {
-            server = getCurrentDomain(session).getServerInstances()[0]; //todo: some day,
select a server from the domain
-            session.setAttribute(SERVER_KEY, server);
-        } else {
-            // to do     handle "should not occur" error   - message?
-        }
-        return server;
-    }
-
     public static JVM getCurrentJVM(PortletRequest request) {
         JVM jvm = (JVM) request.getPortletSession(true).getAttribute(JVM_KEY, PortletSession.APPLICATION_SCOPE);
         if (jvm == null) {
@@ -176,43 +155,15 @@
         return helper.testLoginModule(getCurrentServer(request), module, options, username,
password);
     }
 
-    public static EJBModule[] getEJBModules(PortletRequest request) {
-        ManagementHelper helper = getManagementHelper(request);
-        return helper.getEJBModules(PortletManager.getCurrentServer(request));
-    }
-
-    public static EJBModule[] getEJBModules(HttpSession session) {
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getEJBModules(PortletManager.getCurrentServer(session));
-    }
-
-    public static J2EEResource[] getJ2EEResources(PortletRequest request) {
-        ManagementHelper helper = getManagementHelper(request);
-        return helper.getResources(PortletManager.getCurrentServer(request));
-    }
-
-    public static J2EEResource[] getJ2EEResources(HttpSession session) {
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getResources(PortletManager.getCurrentServer(session));
-    }
-
     public static ResourceAdapterModule[] getOutboundRAModules(PortletRequest request, String
iface) {
         ManagementHelper helper = getManagementHelper(request);
         return helper.getOutboundRAModules(getCurrentServer(request), iface);
     }
-    public static ResourceAdapterModule[] getOutboundRAModules(HttpSession session, String
iface) {
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getOutboundRAModules(getCurrentServer(session), iface);
-    }
 
     public static ResourceAdapterModule[] getOutboundRAModules(PortletRequest request, String[]
iface) {
         ManagementHelper helper = getManagementHelper(request);
         return helper.getOutboundRAModules(getCurrentServer(request), iface);
     }
-    public static ResourceAdapterModule[] getOutboundRAModules(HttpSession session, String[]
iface) {
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getOutboundRAModules(getCurrentServer(session), iface);
-    }
 
     public static ResourceAdapterModule[] getAdminObjectModules(PortletRequest request, String[]
ifaces) {
         ManagementHelper helper = getManagementHelper(request);
@@ -243,29 +194,17 @@
         ManagementHelper helper = getManagementHelper(request);
         return helper.getOutboundFactories(module, iface);
     }
-    public static JCAManagedConnectionFactory[] getOutboundFactoriesForRA(HttpSession session,
ResourceAdapterModule module, String iface) {
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getOutboundFactories(module, iface);
-    }
 
     public static JCAManagedConnectionFactory[] getOutboundFactoriesForRA(PortletRequest
request, ResourceAdapterModule module, String[] iface) {
         ManagementHelper helper = getManagementHelper(request);
         return helper.getOutboundFactories(module, iface);
     }
-    public static JCAManagedConnectionFactory[] getOutboundFactoriesForRA(HttpSession session,
ResourceAdapterModule module, String[] iface) {
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getOutboundFactories(module, iface);
-    }
 
     //todo: Create an interface for admin objects
     public static JCAAdminObject[] getAdminObjectsForRA(PortletRequest request, ResourceAdapterModule
module, String[] ifaces) {
         ManagementHelper helper = getManagementHelper(request);
         return helper.getAdminObjects(module, ifaces);
     }
-    public static JCAAdminObject[] getAdminObjectsForRA(HttpSession session, ResourceAdapterModule
module, String[] ifaces) {
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getAdminObjects(module, ifaces);
-    }
 
     public static WebManager[] getWebManagers(PortletRequest request) {
         return getCurrentServer(request).getWebManagers();
@@ -397,19 +336,11 @@
         ManagementHelper helper = getManagementHelper(request);
         return helper.getConfigurationNameFor(objectName);
     }
-    public static Artifact getConfigurationFor(HttpSession session, AbstractName objectName)
{
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getConfigurationNameFor(objectName);
-    }
 
     public static AbstractName getNameFor(PortletRequest request, Object component) {
         ManagementHelper helper = getManagementHelper(request);
         return helper.getNameFor(component);
     }
-    public static AbstractName getNameFor(HttpSession session, Object component) {
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getNameFor(component);
-    }
 
     public static File getRepositoryEntry(PortletRequest request, String repositoryURI) {
         J2EEServer server = getCurrentServer(request);
@@ -446,10 +377,6 @@
         ManagementHelper helper = getManagementHelper(request);
         return helper.getGBeansImplementing(iface);
     }    
-    public static Object[] getGBeansImplementing(HttpSession session, Class iface) {
-        ManagementHelper helper = getManagementHelper(session);
-        return helper.getGBeansImplementing(iface);
-    }    
 
     /**
      * This methods adds a GBean to an existing configuration.

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java?rev=677509&r1=677508&r2=677509&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java
(original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java
Wed Jul 16 23:22:34 2008
@@ -23,7 +23,6 @@
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.portlet.PortletRequest;
-import javax.servlet.http.HttpSession;
 
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.gbean.AbstractName;
@@ -32,7 +31,6 @@
 import org.apache.geronimo.kernel.repository.ListableRepository;
 import org.apache.geronimo.management.EJBModule;
 import org.apache.geronimo.management.J2EEResource;
-import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.JCAAdminObject;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
@@ -73,13 +71,9 @@
     }
 
     protected static List<ReferredData> getDeployedEJBs(PortletRequest request) {
-        return getDeployedEJBs(PortletManager.getEJBModules(request));
-    }
-    protected static List<ReferredData> getDeployedEJBs(HttpSession session) {
-        return getDeployedEJBs(PortletManager.getEJBModules(session));
-    }
-    private static List<ReferredData> getDeployedEJBs(EJBModule[] ejbModules) {
         List<ReferredData> ejbList = new ArrayList<ReferredData>();
+        EJBModule[] ejbModules = PortletManager.getManagementHelper(request).getEJBModules(
+                PortletManager.getCurrentServer(request));
         for (int i = 0; ejbModules != null && i < ejbModules.length; i++) {
             String[] ejbObjectNames = ejbModules[i].getEjbs();
             for (int j = 0; j < ejbObjectNames.length; j++) {
@@ -122,44 +116,12 @@
             for (int i = 0; i < modules.length; i++) {
                 ResourceAdapterModule module = modules[i];
                 String configurationName = PortletManager.getConfigurationFor(request,
-                        PortletManager.getNameFor(request, module)).toString() + "/";
+                        PortletManager.getNameFor(request, module)).toString()
+                        + "/";
 
                 JCAManagedConnectionFactory[] factories = PortletManager.getOutboundFactoriesForRA(request,
-                        module, new String[] { "javax.jms.ConnectionFactory", 
-                        "javax.jms.QueueConnectionFactory", "javax.jms.TopicConnectionFactory",
});
-                for (int j = 0; j < factories.length; j++) {
-                    JCAManagedConnectionFactory factory = factories[j];
-                    String factoryName = ObjectName.getInstance(factory.getObjectName()).getKeyProperty(
-                            NameFactory.J2EE_NAME);
-                    ReferredData data = new ReferredData(factoryName + " (" + configurationName
+ ")",
-                            configurationName + "/" + factoryName);
-                    connectionFactories.add(data);
-                }
-            }
-        } catch (MalformedObjectNameException e) {
-            // log.error(e.getMessage(), e);
-        }
-        return connectionFactories;
-    }
-    protected static List<ReferredData> getJMSConnectionFactories(HttpSession session)
{
-        // TODO this is a duplicate of the code from
-        // org.apache.geronimo.console.jmsmanager.wizard.ListScreenHandler.populateExistingList()
-        // TODO need to eliminate this duplicate code probably by putting it in a common
place
-        List<ReferredData> connectionFactories = new ArrayList<ReferredData>();
-
-        // Get the list of connection factories
-        ResourceAdapterModule[] modules = PortletManager.getOutboundRAModules(session, new
String[] {
-                "javax.jms.ConnectionFactory", "javax.jms.QueueConnectionFactory",
-                "javax.jms.TopicConnectionFactory", });
-        try {
-            for (int i = 0; i < modules.length; i++) {
-                ResourceAdapterModule module = modules[i];
-                String configurationName = PortletManager.getConfigurationFor(session,
-                        PortletManager.getNameFor(session, module)).toString() + "/";
-
-                JCAManagedConnectionFactory[] factories = PortletManager.getOutboundFactoriesForRA(session,
-                        module, new String[] { "javax.jms.ConnectionFactory", 
-                        "javax.jms.QueueConnectionFactory", "javax.jms.TopicConnectionFactory",
});
+                        module, new String[] { "javax.jms.ConnectionFactory", "javax.jms.QueueConnectionFactory",
+                                "javax.jms.TopicConnectionFactory", });
                 for (int j = 0; j < factories.length; j++) {
                     JCAManagedConnectionFactory factory = factories[j];
                     String factoryName = ObjectName.getInstance(factory.getObjectName()).getKeyProperty(
@@ -208,38 +170,6 @@
         }
         return jmsDestinations;
     }
-    protected static List<ReferredData> getJMSDestinations(HttpSession session) {
-        // TODO this is a duplicate of the code from
-        // org.apache.geronimo.console.jmsmanager.wizard.ListScreenHandler.populateExistingList()
-        // TODO need to eliminate this duplicate code probably by putting it in a common
place
-        List<ReferredData> jmsDestinations = new ArrayList<ReferredData>();
-
-        // Get the list of connection factories
-        ResourceAdapterModule[] modules = PortletManager.getOutboundRAModules(session, new
String[] {
-                "javax.jms.ConnectionFactory", "javax.jms.QueueConnectionFactory",
-                "javax.jms.TopicConnectionFactory", });
-        try {
-            for (int i = 0; i < modules.length; i++) {
-                ResourceAdapterModule module = modules[i];
-                String configurationName = PortletManager.getConfigurationFor(session,
-                        PortletManager.getNameFor(session, module)).toString() + "/";
-
-                JCAAdminObject[] admins = PortletManager.getAdminObjectsForRA(session, module,
new String[] {
-                        "javax.jms.Queue", "javax.jms.Topic" });
-                for (int j = 0; j < admins.length; j++) {
-                    JCAAdminObject admin = admins[j];
-                    String destinationName = ObjectName.getInstance(admin.getObjectName()).getKeyProperty(
-                            NameFactory.J2EE_NAME);
-                    ReferredData data = new ReferredData(destinationName + " (" + configurationName
+ ")",
-                            configurationName + "/" + destinationName);
-                    jmsDestinations.add(data);
-                }
-            }
-        } catch (MalformedObjectNameException e) {
-            // log.error(e.getMessage(), e);
-        }
-        return jmsDestinations;
-    }
 
     protected static List<ReferredData> getJDBCConnectionPools(PortletRequest request)
{
         // TODO this is a duplicate of the code from
@@ -263,37 +193,11 @@
         }
         return list;
     }
-    protected static List<ReferredData> getJDBCConnectionPools(HttpSession session)
{
-        // TODO this is a duplicate of the code from
-        // org.apache.geronimo.console.databasemanager.wizard.DatabasePoolPortlet.populatePoolList()
-        // TODO need to eliminate this duplicate code probably by putting it in a common
place
-        List<ReferredData> list = new ArrayList<ReferredData>();
-        ResourceAdapterModule[] modules = PortletManager.getOutboundRAModules(session, "javax.sql.DataSource");
-        for (int i = 0; i < modules.length; i++) {
-            ResourceAdapterModule module = modules[i];
-            JCAManagedConnectionFactory[] databases = PortletManager.getOutboundFactoriesForRA(session,
module,
-                    "javax.sql.DataSource");
-            for (int j = 0; j < databases.length; j++) {
-                JCAManagedConnectionFactory db = databases[j];
-                AbstractName dbName = PortletManager.getManagementHelper(session).getNameFor(db);
-                String poolName = (String) dbName.getName().get(NameFactory.J2EE_NAME);
-                String configurationName = dbName.getArtifact().toString() + "/";
-                ReferredData data = new ReferredData(poolName + " (" + configurationName
+ ")", 
-                        configurationName + "/" + poolName);
-                list.add(data);
-            }
-        }
-        return list;
-    }
 
     protected static List<ReferredData> getJavaMailSessions(PortletRequest request)
{
-        return getJavaMailSessions(PortletManager.getJ2EEResources(request));
-    }
-    protected static List<ReferredData> getJavaMailSessions(HttpSession session) {
-        return getJavaMailSessions(PortletManager.getJ2EEResources(session));
-    }
-    private static List<ReferredData> getJavaMailSessions(J2EEResource[] j2eeResources)
{
         List<ReferredData> mailSessionList = new ArrayList<ReferredData>();
+        J2EEResource[] j2eeResources = PortletManager.getManagementHelper(request).getResources(
+                PortletManager.getCurrentServer(request));
         for (int i = 0; i < j2eeResources.length; i++) {
             try {
                 ObjectName objectName = ObjectName.getInstance(j2eeResources[i].getObjectName());
@@ -329,33 +233,13 @@
         }
         return credentialStoreList;
     }
-    protected static List<ReferredData> getDeployedCredentialStores(HttpSession session)
{
-        List<ReferredData> credentialStoreList = new ArrayList<ReferredData>();
-        Object[] objects = PortletManager.getGBeansImplementing(session,
-                org.apache.geronimo.security.credentialstore.CredentialStore.class);
-        for (int i = 0; i < objects.length; i++) {
-            ObjectName objectName = PortletManager.getNameFor(session, objects[i]).getObjectName();
-            String credentialStoreName = objectName.getKeyProperty(NameFactory.J2EE_NAME);
-            String configurationName = objectName.getKeyProperty(NameFactory.SERVICE_MODULE)
+ "/";
-            ReferredData data = new ReferredData(credentialStoreName + " (" + configurationName
+ ")",
-                    configurationName + "/" + credentialStoreName);
-            credentialStoreList.add(data);
-        }
-        return credentialStoreList;
-    }
 
     protected static List<String> getCommonLibs(PortletRequest request) {
-        return getCommonLibs(PortletManager.getCurrentServer(request));
-    }
-    protected static List<String> getCommonLibs(HttpSession session) {
-        return getCommonLibs(PortletManager.getCurrentServer(session));
-    }
-    private static List<String> getCommonLibs(J2EEServer server) {
         // TODO this is a duplicate of the code from
         // org.apache.geronimo.console.repository.RepositoryViewPortlet.doView()
         // TODO need to eliminate this duplicate code probably by putting it in a common
place
         List<String> list = new ArrayList<String>();
-        ListableRepository[] repos = server.getRepositories();
+        ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
         for (int i = 0; i < repos.length; i++) {
             ListableRepository repo = repos[i];
             for (Iterator<Artifact> iterator = repo.list().iterator(); iterator.hasNext();)
{
@@ -366,10 +250,7 @@
         return list;
     }
 
-    protected static SecurityRealm[] getDeployedSecurityRealms(HttpSession session) {
-        return PortletManager.getCurrentServer(session).getSecurityRealms();
-    }
-    protected static SecurityRealm[] getDeployedSecurityRealms(PortletRequest request) {
+    public static SecurityRealm[] getDeployedSecurityRealms(PortletRequest request) {
         return PortletManager.getCurrentServer(request).getSecurityRealms();
     }
 }

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml?rev=677509&r1=677508&r2=677509&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml
Wed Jul 16 23:22:34 2008
@@ -55,17 +55,6 @@
         </init-param>
     </servlet>
 
-    <servlet>
-        <display-name>ServerInfoServlet</display-name>
-        <servlet-name>ServerInfoServlet</servlet-name>
-        <servlet-class>org.apache.geronimo.console.configcreator.ServerInfoServlet</servlet-class>
-    </servlet>
-
-    <servlet-mapping>
-        <servlet-name>ServerInfoServlet</servlet-name>
-        <url-pattern>/ServerInfoServlet</url-pattern>
-    </servlet-mapping>
-
     <servlet-mapping>
         <servlet-name>PlanCreator</servlet-name>
         <url-pattern>/PlutoInvoker/PlanCreator</url-pattern>



Mime
View raw message