geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r371785 [1/3] - in /geronimo/branches/1.0/applications: console-core/src/java/org/apache/geronimo/console/util/ console-framework/ console-framework/src/webapp/WEB-INF/data/ console-standard/ console-standard/src/conf/ console-standard/src/...
Date Tue, 24 Jan 2006 03:01:49 GMT
Author: ammulder
Date: Mon Jan 23 19:01:27 2006
New Revision: 371785

URL: http://svn.apache.org/viewcvs?rev=371785&view=rev
Log:
First stab at revising JMS portlet (can create destinations and connection
  factories but not view or edit anything yet)

Added:
    geronimo/branches/1.0/applications/console-standard/src/conf/
    geronimo/branches/1.0/applications/console-standard/src/conf/jms-resource-providers.properties   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ConfigureRAInstanceHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateConnectionFactoryHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateDestinationHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/DeployHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSResourcePortlet.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectConnectionFactoryTypeHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectDestinationTypeHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ShowPlanHandler.java   (with props)
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/jmswizard/
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/jmswizard/destination.jsp   (with props)
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/jmswizard/destinationType.jsp   (with props)
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/jmswizard/factory.jsp   (with props)
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/jmswizard/factoryType.jsp   (with props)
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/jmswizard/list.jsp   (with props)
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/jmswizard/plan.jsp   (with props)
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/jmswizard/provider.jsp   (with props)
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/jmswizard/raInstance.jsp   (with props)
Modified:
    geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
    geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
    geronimo/branches/1.0/applications/console-framework/maven.xml
    geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/pageregistry.xml
    geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.xml
    geronimo/branches/1.0/applications/console-standard/maven.xml
    geronimo/branches/1.0/applications/console-standard/project.xml
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/MasterLoginModuleInfo.java
    geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/portlet.xml
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/basicParams.jsp
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/confirmURL.jsp
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDatabase.jsp
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/showPlan.jsp
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp
    geronimo/branches/1.0/applications/console-standard/src/webapp/WEB-INF/web.xml

Modified: geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java?rev=371785&r1=371784&r2=371785&view=diff
==============================================================================
--- geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java (original)
+++ geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java Mon Jan 23 19:01:27 2006
@@ -16,6 +16,24 @@
  */
 package org.apache.geronimo.console.util;
 
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanQuery;
@@ -23,6 +41,7 @@
 import org.apache.geronimo.j2ee.management.impl.Util;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.management.AppClientModule;
@@ -33,7 +52,6 @@
 import org.apache.geronimo.management.J2EEModule;
 import org.apache.geronimo.management.J2EEResource;
 import org.apache.geronimo.management.JCAConnectionFactory;
-import org.apache.geronimo.management.JCAResource;
 import org.apache.geronimo.management.JDBCDataSource;
 import org.apache.geronimo.management.JDBCDriver;
 import org.apache.geronimo.management.JDBCResource;
@@ -45,7 +63,9 @@
 import org.apache.geronimo.management.geronimo.EJBManager;
 import org.apache.geronimo.management.geronimo.J2EEApplication;
 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.JCAResource;
 import org.apache.geronimo.management.geronimo.JMSBroker;
 import org.apache.geronimo.management.geronimo.JMSConnector;
 import org.apache.geronimo.management.geronimo.JMSManager;
@@ -62,24 +82,6 @@
 import org.apache.geronimo.system.logging.SystemLog;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.auth.login.LoginException;
-import javax.security.auth.spi.LoginModule;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * An implementation of the ManagementHelper interface that uses a Geronimo
  * kernel. That may be an in-VM kernel or a remote kernel, we don't really
@@ -304,6 +306,44 @@
         return (ResourceAdapterModule[]) list.toArray(new ResourceAdapterModule[list.size()]);
     }
 
+    public ResourceAdapterModule[] getAdminObjectModules(J2EEServer server, String[] adminObjectInterfaces) {
+        List list = new ArrayList();
+        try {
+            String[] names = server.getDeployedObjects();
+            for (int i = 0; i < names.length; i++) {
+                ObjectName name = ObjectName.getInstance(names[i]);
+                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
+                if(type.equals(NameFactory.RESOURCE_ADAPTER_MODULE)) {
+                    ResourceAdapterModule module = (ResourceAdapterModule) pm.createProxy(name, KernelManagementHelper.class.getClassLoader());
+                    ResourceAdapter[] adapters = getResourceAdapters(module);
+                    outer:
+                    for (int j = 0; j < adapters.length; j++) {
+                        ResourceAdapter adapter = adapters[j];
+                        JCAResource[] resources = getRAResources(adapter);
+                        for (int k = 0; k < resources.length; k++) {
+                            JCAResource resource = resources[k];
+                            JCAAdminObject[] admins = getAdminObjects(resource);
+                            for (int l = 0; l < admins.length; l++) {
+                                JCAAdminObject admin = admins[l];
+                                String adminIface = admin.getAdminObjectInterface();
+                                for (int m = 0; m < adminObjectInterfaces.length; m++) {
+                                    if(adminIface.equals(adminObjectInterfaces[m])) {
+                                        list.add(module);
+                                        break outer;
+                                    }
+
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return (ResourceAdapterModule[]) list.toArray(new ResourceAdapterModule[list.size()]);
+    }
+
     public JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module) {
         List list = new ArrayList();
         try {
@@ -360,6 +400,34 @@
         return (JCAManagedConnectionFactory[]) list.toArray(new JCAManagedConnectionFactory[list.size()]);
     }
 
+    public JCAAdminObject[] getAdminObjects(ResourceAdapterModule module, String[] adminObjectInterfaces) {
+        List list = new ArrayList();
+        try {
+            ResourceAdapter[] adapters = getResourceAdapters(module);
+            for (int j = 0; j < adapters.length; j++) {
+                ResourceAdapter adapter = adapters[j];
+                JCAResource[] resources = getRAResources(adapter);
+                for (int k = 0; k < resources.length; k++) {
+                    JCAResource resource = resources[k];
+                    JCAAdminObject[] admins = getAdminObjects(resource);
+                    for (int l = 0; l < admins.length; l++) {
+                        JCAAdminObject admin = admins[l];
+                        String adminIface = admin.getAdminObjectInterface();
+                        for (int m = 0; m < adminObjectInterfaces.length; m++) {
+                            if(adminIface.equals(adminObjectInterfaces[m])) {
+                                list.add(admin);
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return (JCAAdminObject[]) list.toArray(new JCAAdminObject[list.size()]);
+    }
+
     public J2EEResource[] getResources(J2EEServer server) {
         J2EEResource[] result = new J2EEResource[0];
         try {
@@ -886,6 +954,28 @@
         return result;
     }
 
+    public JCAAdminObject[] getAdminObjects(JCAResource resource) {
+        JCAAdminObject[] result = new JCAAdminObject[0];
+        String objectName = resource.getObjectName();
+        try {
+            String name = ObjectName.getInstance(objectName).getKeyProperty(NameFactory.J2EE_NAME);
+            String query = "*:JCAResource="+name+",j2eeType=JCAAdminObject,*";
+            Set results = kernel.listGBeans(ObjectName.getInstance(query));
+            String[] names = new String[results.size()];
+            int i = 0;
+            for (Iterator it = results.iterator(); it.hasNext();) {
+                ObjectName next = (ObjectName) it.next();
+                names[i++] = next.getCanonicalName();
+            }
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new JCAAdminObject[temp.length];
+            System.arraycopy(temp, 0, result, 0, temp.length);
+        } catch (MalformedObjectNameException e) {
+            log.error("Unable to look up admin objects for resource adapter", e);
+        }
+        return result;
+    }
+
     public JCAManagedConnectionFactory getManagedConnectionFactory(JCAConnectionFactory factory) {
         try {
             String name = factory.getManagedConnectionFactory();
@@ -903,6 +993,24 @@
             log.error("Unable to look up related GBean", e);
             return null;
         }
+    }
+
+    public URI getConfigurationNameFor(String objectName) {
+        try {
+            Set parents = kernel.getDependencyManager().getParents(ObjectName.getInstance(objectName));
+            if(parents.size() == 0) {
+                throw new IllegalStateException("No parents for GBean '"+objectName+"'");
+            }
+            for (Iterator it = parents.iterator(); it.hasNext();) {
+                ObjectName name = (ObjectName) it.next();
+                if(Configuration.isConfigurationObjectName(name)) {
+                    return Configuration.getConfigurationID(name);
+                }
+            }
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return null;
     }
 
     public String getGBeanDescription(String objectName) {

Modified: geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java?rev=371785&r1=371784&r2=371785&view=diff
==============================================================================
--- geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java (original)
+++ geronimo/branches/1.0/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java Mon Jan 23 19:01:27 2006
@@ -16,6 +16,11 @@
  */
 package org.apache.geronimo.console.util;
 
+import java.net.URI;
+import java.util.Map;
+import javax.security.auth.Subject;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.management.AppClientModule;
 import org.apache.geronimo.management.EJB;
@@ -25,7 +30,6 @@
 import org.apache.geronimo.management.J2EEModule;
 import org.apache.geronimo.management.J2EEResource;
 import org.apache.geronimo.management.JCAConnectionFactory;
-import org.apache.geronimo.management.JCAResource;
 import org.apache.geronimo.management.JDBCDataSource;
 import org.apache.geronimo.management.JDBCDriver;
 import org.apache.geronimo.management.JDBCResource;
@@ -37,7 +41,9 @@
 import org.apache.geronimo.management.geronimo.EJBManager;
 import org.apache.geronimo.management.geronimo.J2EEApplication;
 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.JCAResource;
 import org.apache.geronimo.management.geronimo.JMSBroker;
 import org.apache.geronimo.management.geronimo.JMSConnector;
 import org.apache.geronimo.management.geronimo.JMSManager;
@@ -53,11 +59,6 @@
 import org.apache.geronimo.system.logging.SystemLog;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 
-import javax.security.auth.Subject;
-import javax.security.auth.login.LoginException;
-import javax.security.auth.spi.LoginModule;
-import java.util.Map;
-
 /**
  * A helper interface to navigate between management objects.  This is not
  * complete; it will be expanded as necessary.
@@ -80,6 +81,7 @@
     EJBModule[] getEJBModules(J2EEServer server);
     ResourceAdapterModule[] getRAModules(J2EEServer server);
     ResourceAdapterModule[] getOutboundRAModules(J2EEServer server, String connectionFactoryInterface);
+    ResourceAdapterModule[] getAdminObjectModules(J2EEServer server, String[] adminObjectInterfaces);
     JCAManagedConnectionFactory[] getOutboundFactories(J2EEServer server, String connectionFactoryInterface);
     J2EEResource[] getResources(J2EEServer server);
     JCAResource[] getJCAResources(J2EEServer server);
@@ -137,6 +139,8 @@
     ResourceAdapter[] getResourceAdapters(ResourceAdapterModule module);
     JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module);
     JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module, String connectionFactoryInterface);
+    //todo: create an interface for admin objects
+    JCAAdminObject[] getAdminObjects(ResourceAdapterModule module, String[] adminObjectInterfaces);
 
     // resource adapter properties
     JCAResource[] getRAResources(ResourceAdapter adapter);
@@ -149,6 +153,7 @@
 
     // Generic utility methods
     Object getObject(String objectName);
+    URI getConfigurationNameFor(String objectName);
     String getGBeanDescription(String objectName);
 
     // Misc

Modified: geronimo/branches/1.0/applications/console-framework/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-framework/maven.xml?rev=371785&r1=371784&r2=371785&view=diff
==============================================================================
--- geronimo/branches/1.0/applications/console-framework/maven.xml (original)
+++ geronimo/branches/1.0/applications/console-framework/maven.xml Mon Jan 23 19:01:27 2006
@@ -6,7 +6,7 @@
     xmlns:velocity="jelly:velocity"
     xmlns:util="jelly:util">
 
-    <preGoal name="war:install">
+    <preGoal name="war:war">
         <attainGoal name="preCompile"/>
     </preGoal>
 

Modified: geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/pageregistry.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/pageregistry.xml?rev=371785&r1=371784&r2=371785&view=diff
==============================================================================
--- geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/pageregistry.xml (original)
+++ geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/pageregistry.xml Mon Jan 23 19:01:27 2006
@@ -263,17 +263,24 @@
 
         <fragment name="jms" type="page">
             <navigation>
-                <title>JMS</title>
+                <title>JMS Resources</title>
                 <description>ico_beanjar_16x16.gif Configure Java Message Service</description>
             </navigation>
             <fragment name="row1" type="row">
                 <fragment name="col1" type="column">
                     <fragment name="p1" type="portlet">
-                        <property name="portlet" value="5.31"/>
+                        <property name="portlet" value="5.67"/>
                     </fragment>
                 </fragment>
             </fragment>
             <fragment name="row2" type="row">
+                <fragment name="col1" type="column">
+                    <fragment name="p1" type="portlet">
+                        <property name="portlet" value="5.31"/>
+                    </fragment>
+                </fragment>
+            </fragment>
+            <fragment name="row3" type="row">
                 <fragment name="col1" type="column">
                     <fragment name="p1" type="portlet">
                         <property name="portlet" value="5.17"/>

Modified: geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.xml?rev=371785&r1=371784&r2=371785&view=diff
==============================================================================
--- geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.xml (original)
+++ geronimo/branches/1.0/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.xml Mon Jan 23 19:01:27 2006
@@ -136,5 +136,8 @@
         <portlet id="66">
             <definition-id>console-standard.RealmWizard</definition-id>
         </portlet>
+        <portlet id="67">
+            <definition-id>console-standard.JMSWizard</definition-id>
+        </portlet>
     </application>
 </portlet-entity-registry>

Modified: geronimo/branches/1.0/applications/console-standard/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/maven.xml?rev=371785&r1=371784&r2=371785&view=diff
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/maven.xml (original)
+++ geronimo/branches/1.0/applications/console-standard/maven.xml Mon Jan 23 19:01:27 2006
@@ -6,8 +6,9 @@
     xmlns:velocity="jelly:velocity"
     xmlns:util="jelly:util">
 
-    <preGoal name="war:install">
+    <preGoal name="war:war">
         <attainGoal name="preCompile"/>
+        <attainGoal name="substitute"/>
     </preGoal>
 
     <!-- Output folder for compiled jsps. -->
@@ -20,6 +21,12 @@
         <attainGoal name="war:install"/>
     </goal>
 
+    <goal name="substitute">
+        <velocity:merge basedir="${basedir}/src/conf"
+          template="jms-resource-providers.properties"
+          name="${basedir}/target/${pom.artifactId}/WEB-INF/classes/jms-resource-providers.properties"/>
+    </goal>
+
     <!-- ==================================================== -->
     <!-- Pre compile JSPs                                     -->
     <!-- ==================================================== -->

Modified: geronimo/branches/1.0/applications/console-standard/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/project.xml?rev=371785&r1=371784&r2=371785&view=diff
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/project.xml (original)
+++ geronimo/branches/1.0/applications/console-standard/project.xml Mon Jan 23 19:01:27 2006
@@ -107,6 +107,11 @@
         </dependency>
         <dependency>
             <groupId>geronimo</groupId>
+            <artifactId>geronimo-naming-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
             <artifactId>geronimo-connector-builder</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>

Added: geronimo/branches/1.0/applications/console-standard/src/conf/jms-resource-providers.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/src/conf/jms-resource-providers.properties?rev=371785&view=auto
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/src/conf/jms-resource-providers.properties (added)
+++ geronimo/branches/1.0/applications/console-standard/src/conf/jms-resource-providers.properties Mon Jan 23 19:01:27 2006
@@ -0,0 +1,3 @@
+provider.activemq.name=ActiveMQ
+provider.activemq.rar=activemq/activemq-ra/${activemq_version}/rar
+provider.activemq.dependency=geronimo/activemq-broker/${geronimo_version}/car

Propchange: geronimo/branches/1.0/applications/console-standard/src/conf/jms-resource-providers.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?rev=371785&r1=371784&r2=371785&view=diff
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java (original)
+++ geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java Mon Jan 23 19:01:27 2006
@@ -816,8 +816,7 @@
                 final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                 Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                 ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);
-                connector.setConfigID("user/database-pool-"+data.getName() + "/1/car");
-                connector.setParentID("geronimo/j2ee-server/" + GeronimoVersion.GERONIMO_VERSION + "/car");
+                connector.setConfigID("console-db-pool-"+data.getName());
                 // Use a parentId of null to pick up the default
                 if(data.jar1 != null && !data.jar1.equals("")) {
                     Dependency dep = new Dependency();

Added: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java?rev=371785&view=auto
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java (added)
+++ geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java Mon Jan 23 19:01:27 2006
@@ -0,0 +1,674 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.jmsmanager.wizard;
+
+import javax.portlet.*;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.DeploymentConfiguration;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.DConfigBean;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.enterprise.deploy.model.DDBeanRoot;
+import javax.enterprise.deploy.model.DDBean;
+import java.io.IOException;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.BufferedOutputStream;
+import java.io.FileOutputStream;
+import java.util.Properties;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.Iterator;
+import java.net.URL;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable;
+import org.apache.geronimo.connector.deployment.jsr88.Connector15DCBRoot;
+import org.apache.geronimo.connector.deployment.jsr88.ConnectorDCB;
+import org.apache.geronimo.connector.deployment.jsr88.ResourceAdapter;
+import org.apache.geronimo.connector.deployment.jsr88.ResourceAdapterInstance;
+import org.apache.geronimo.connector.deployment.jsr88.ConnectionDefinition;
+import org.apache.geronimo.connector.deployment.jsr88.ConnectionDefinitionInstance;
+import org.apache.geronimo.connector.deployment.jsr88.SinglePool;
+import org.apache.geronimo.connector.deployment.jsr88.AdminObjectDCB;
+import org.apache.geronimo.connector.deployment.jsr88.AdminObjectInstance;
+import org.apache.geronimo.naming.deployment.jsr88.GBeanLocator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Base class for portlet helpers
+ *
+ * @version $Rev: 368994 $ $Date: 2006-01-14 02:07:18 -0500 (Sat, 14 Jan 2006) $
+ */
+public abstract class AbstractHandler {
+    private final static Log log = LogFactory.getLog(AbstractHandler.class);
+    protected final static String BEFORE_ACTION="-before";
+    protected final static String AFTER_ACTION="-after";
+    protected PortletRequestDispatcher view;
+    private final String mode;
+    private final String viewName;
+
+    protected AbstractHandler(String mode, String viewName) {
+        this.mode = mode;
+        this.viewName = viewName;
+    }
+
+    public String getMode() {
+        return mode;
+    }
+
+    public void init(PortletConfig portletConfig) throws PortletException {
+        if(viewName != null) {
+            view = portletConfig.getPortletContext().getRequestDispatcher(viewName);
+        }
+    }
+
+    public void destroy() {
+        view = null;
+    }
+
+    public PortletRequestDispatcher getView() {
+        return view;
+    }
+
+    protected static boolean isEmpty(String s) {
+        return s == null || s.trim().equals("");
+    }
+
+    /**
+     * Returns the mode for the next screen to render (usually this one)
+     */
+    public abstract String actionBeforeView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException;
+
+    public abstract void renderView(RenderRequest request, RenderResponse response, JMSResourceData data) throws PortletException, IOException;
+
+    /**
+     * Returns the mode for the next screen to render (usually the one after this in the sequence)
+     */
+    public abstract String actionAfterView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException;
+
+
+    private static void waitForProgress(ProgressObject po) {
+        while(po.getDeploymentStatus().isRunning()) {
+            try {
+                Thread.sleep(100);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    // ********** This part specific to JMS portlets **********
+
+    protected final static String LIST_MODE="list";
+    protected final static String SELECT_PROVIDER_MODE="provider";
+    protected final static String CONFIGURE_RA_MODE="ra";
+    protected final static String ADD_FACTORY_MODE="factory";
+    protected final static String SELECT_FACTORY_TYPE_MODE="factoryType";
+    protected final static String ADD_DESTINATION_MODE="destination";
+    protected final static String SELECT_DESTINATION_TYPE_MODE="destinationType";
+    protected final static String REVIEW_MODE="review";
+    protected final static String SHOW_PLAN_MODE="plan";
+    protected final static String DEPLOY_MODE="deploy";
+
+    protected final static String PROVIDER_PARAMETER="provider";
+    protected final static String RAR_FILE_PARAMETER="rar";
+    protected final static String DEPENDENCY_PARAMETER="dependency";
+    protected final static String INSTANCE_NAME_PARAMETER="instanceName";
+    protected final static String NAME_PARAMETER="name";
+    protected final static String CURRENT_FACTORY_PARAMETER="currentFactoryID";
+    protected final static String CURRENT_DEST_PARAMETER="currentDestinationID";
+    protected final static String FACTORY_TYPE_PARAMETER="factoryType";
+    protected final static String DEST_TYPE_PARAMETER="destinationType";
+    protected final static String TRANSACTION_PARAMETER="transaction";
+    protected final static String XA_TRANSACTION_PARAMETER="xaTransaction";
+    protected final static String XA_THREAD_PARAMETER="xaThread";
+    protected final static String MIN_SIZE_PARAMETER="poolMinSize";
+    protected final static String MAX_SIZE_PARAMETER="poolMaxSize";
+    protected final static String IDLE_TIME_PARAMETER="poolIdleTimeout";
+    protected final static String BLOCK_TIME_PARAMETER="poolBlockingTimeout";
+
+    public static class JMSResourceData {
+        private String rarURI;
+        private String dependency;
+        private String instanceName;
+        private Properties instanceProps = new Properties();
+        private String workManager;
+        private int currentFactory = -1;
+        private int currentDestination = -1;
+        private int factoryType = -1;
+        private int destinationType = -1;
+        private List connectionFactories = new ArrayList();
+        private List adminObjects = new ArrayList();
+        // Used for editing an existing resource
+        private String objectName;
+
+        public JMSResourceData(PortletRequest request) {
+            Map map = request.getParameterMap();
+            rarURI = request.getParameter(RAR_FILE_PARAMETER);
+            dependency = request.getParameter(DEPENDENCY_PARAMETER);
+            instanceName = request.getParameter(INSTANCE_NAME_PARAMETER);
+            factoryType = isEmpty(request.getParameter(FACTORY_TYPE_PARAMETER)) ? -1 : Integer.parseInt(request.getParameter(FACTORY_TYPE_PARAMETER));
+            currentFactory = isEmpty(request.getParameter(CURRENT_FACTORY_PARAMETER)) ? -1 : Integer.parseInt(request.getParameter(CURRENT_FACTORY_PARAMETER));
+            destinationType = isEmpty(request.getParameter(DEST_TYPE_PARAMETER)) ? -1 : Integer.parseInt(request.getParameter(DEST_TYPE_PARAMETER));
+            currentDestination = isEmpty(request.getParameter(CURRENT_DEST_PARAMETER)) ? -1 : Integer.parseInt(request.getParameter(CURRENT_DEST_PARAMETER));
+            for(int i=0; i<20; i++) {
+                String key = "instance-config-" + i;
+                if(map.containsKey(key)) {
+                    instanceProps.setProperty(key, request.getParameter(key));
+                }
+            }
+            workManager = "DefaultWorkManager"; //todo
+            int index = 0;
+            while(true) {
+                String key = "factory."+(index++)+".";
+                if(!map.containsKey(key+FACTORY_TYPE_PARAMETER)) {
+                    break;
+                }
+                JMSConnectionFactoryData data = new JMSConnectionFactoryData();
+                data.load(request, key);
+                connectionFactories.add(data);
+            }
+            index = 0;
+            while(true) {
+                String key = "destination."+(index++)+".";
+                if(!map.containsKey(key+DEST_TYPE_PARAMETER)) {
+                    break;
+                }
+                JMSAdminObjectData data = new JMSAdminObjectData();
+                data.load(request, key);
+                adminObjects.add(data);
+            }
+            createIfNecessary();
+        }
+
+        public void createIfNecessary() {
+            while(currentFactory >= connectionFactories.size()) {
+                connectionFactories.add(new JMSConnectionFactoryData());
+            }
+            while(currentDestination >= adminObjects.size()) {
+                adminObjects.add(new JMSAdminObjectData());
+            }
+        }
+
+        public void save(ActionResponse response) {
+            if(!isEmpty(rarURI)) response.setRenderParameter(RAR_FILE_PARAMETER, rarURI);
+            if(!isEmpty(dependency)) response.setRenderParameter(DEPENDENCY_PARAMETER, dependency);
+            if(!isEmpty(instanceName)) response.setRenderParameter(INSTANCE_NAME_PARAMETER, instanceName);
+            for (Iterator it = instanceProps.entrySet().iterator(); it.hasNext();) {
+                Map.Entry entry = (Map.Entry) it.next();
+                if(!isEmpty((String)entry.getValue())) {
+                    response.setRenderParameter((String)entry.getKey(), (String)entry.getValue());
+                }
+            }
+            if(!isEmpty(workManager)) response.setRenderParameter("workManager", workManager);
+            response.setRenderParameter(FACTORY_TYPE_PARAMETER, Integer.toString(factoryType));
+            response.setRenderParameter(DEST_TYPE_PARAMETER, Integer.toString(destinationType));
+            response.setRenderParameter(CURRENT_DEST_PARAMETER, Integer.toString(currentDestination));
+            response.setRenderParameter(CURRENT_FACTORY_PARAMETER, Integer.toString(currentFactory));
+            for (int i = 0; i < connectionFactories.size(); i++) {
+                JMSConnectionFactoryData data = (JMSConnectionFactoryData) connectionFactories.get(i);
+                String key = "factory."+i+".";
+                data.save(response, key);
+            }
+            for (int i = 0; i < adminObjects.size(); i++) {
+                JMSAdminObjectData data = (JMSAdminObjectData) adminObjects.get(i);
+                String key = "destination."+i+".";
+                data.save(response, key);
+            }
+        }
+
+        public int getFactoryType() {
+            return factoryType;
+        }
+
+        public void setFactoryType(int factoryType) {
+            this.factoryType = factoryType;
+        }
+
+        public int getDestinationType() {
+            return destinationType;
+        }
+
+        public void setDestinationType(int destinationType) {
+            this.destinationType = destinationType;
+        }
+
+        public int getCurrentFactoryID() {
+            return currentFactory;
+        }
+
+        public void setCurrentFactoryID(int id) {
+            currentFactory = id;
+        }
+
+        public int getCurrentDestinationID() {
+            return currentDestination;
+        }
+
+        public void setCurrentDestinationID(int id) {
+            currentDestination = id;
+        }
+
+        public String getRarURI() {
+            return rarURI;
+        }
+
+        public void setRarURI(String rarURI) {
+            this.rarURI = rarURI;
+        }
+
+        public String getDependency() {
+            return dependency;
+        }
+
+        public void setDependency(String dependency) {
+            this.dependency = dependency;
+        }
+
+        public String getInstanceName() {
+            return instanceName;
+        }
+
+        public void setInstanceName(String instanceName) {
+            this.instanceName = instanceName;
+        }
+
+        public String getWorkManager() {
+            return workManager;
+        }
+
+        public void setWorkManager(String workManager) {
+            this.workManager = workManager;
+        }
+
+        public Properties getInstanceProps() {
+            return instanceProps;
+        }
+
+        public List getConnectionFactories() {
+            return connectionFactories;
+        }
+
+        public List getAdminObjects() {
+            return adminObjects;
+        }
+
+        public JMSConnectionFactoryData getCurrentFactory() {
+            return (JMSConnectionFactoryData) connectionFactories.get(currentFactory);
+        }
+
+        public JMSAdminObjectData getCurrentDestination() {
+            return (JMSAdminObjectData) adminObjects.get(currentDestination);
+        }
+
+        public int getConnectionFactoryCount() {
+            return connectionFactories.size();
+        }
+
+        public int getDestinationCount() {
+            return adminObjects.size();
+        }
+    }
+
+    public static class JMSConnectionFactoryData {
+        private int factoryType;
+        private String instanceName;
+        private String transaction; //none, local, xa
+        private boolean xaTransactionCaching;
+        private boolean xaThreadCaching;
+        private Integer poolMinSize;
+        private Integer poolMaxSize;
+        private Integer poolBlockingTimeout;
+        private Integer poolIdleTimeout;
+        private Properties instanceProps = new Properties();
+
+        public void load(PortletRequest request, String prefix) {
+            factoryType = isEmpty(request.getParameter(prefix+FACTORY_TYPE_PARAMETER)) ? -1 : Integer.parseInt(request.getParameter(prefix+FACTORY_TYPE_PARAMETER));
+            instanceName = request.getParameter(prefix+INSTANCE_NAME_PARAMETER);
+            transaction = request.getParameter(prefix+TRANSACTION_PARAMETER);
+            xaThreadCaching = !isEmpty(request.getParameter(prefix+XA_THREAD_PARAMETER)) && request.getParameter(prefix+XA_THREAD_PARAMETER).equals("true");
+            xaTransactionCaching = isEmpty(request.getParameter(prefix+XA_TRANSACTION_PARAMETER)) || request.getParameter(prefix+XA_TRANSACTION_PARAMETER).equals("true");
+            poolMinSize = isEmpty(request.getParameter(prefix+MIN_SIZE_PARAMETER)) ? null : new Integer(request.getParameter(prefix+MIN_SIZE_PARAMETER));
+            poolMaxSize = isEmpty(request.getParameter(prefix+MAX_SIZE_PARAMETER)) ? null : new Integer(request.getParameter(prefix+MAX_SIZE_PARAMETER));
+            poolIdleTimeout = isEmpty(request.getParameter(prefix+IDLE_TIME_PARAMETER)) ? null : new Integer(request.getParameter(prefix+IDLE_TIME_PARAMETER));
+            poolBlockingTimeout = isEmpty(request.getParameter(prefix+BLOCK_TIME_PARAMETER)) ? null : new Integer(request.getParameter(prefix+BLOCK_TIME_PARAMETER));
+            Map map = request.getParameterMap();
+            for(int i=0; i<20; i++) {
+                String key = prefix+"instance-config-" + i;
+                if(map.containsKey(key)) {
+                    instanceProps.setProperty(key.substring(prefix.length()), request.getParameter(key));
+                }
+            }
+        }
+
+        public void save(ActionResponse response, String prefix) {
+            if(factoryType > -1) response.setRenderParameter(prefix+FACTORY_TYPE_PARAMETER, Integer.toString(factoryType));
+            if(!isEmpty(instanceName)) response.setRenderParameter(prefix+INSTANCE_NAME_PARAMETER, instanceName);
+            if(!isEmpty(transaction)) response.setRenderParameter(prefix+TRANSACTION_PARAMETER, transaction);
+            response.setRenderParameter(prefix+XA_THREAD_PARAMETER, Boolean.toString(xaThreadCaching));
+            response.setRenderParameter(prefix+XA_TRANSACTION_PARAMETER, Boolean.toString(xaTransactionCaching));
+            if(poolMinSize != null) response.setRenderParameter(prefix+MIN_SIZE_PARAMETER, poolMinSize.toString());
+            if(poolMaxSize != null) response.setRenderParameter(prefix+MAX_SIZE_PARAMETER, poolMaxSize.toString());
+            if(poolBlockingTimeout != null) response.setRenderParameter(prefix+BLOCK_TIME_PARAMETER, poolBlockingTimeout.toString());
+            if(poolIdleTimeout != null) response.setRenderParameter(prefix+IDLE_TIME_PARAMETER, poolIdleTimeout.toString());
+            for (Iterator it = instanceProps.entrySet().iterator(); it.hasNext();) {
+                Map.Entry entry = (Map.Entry) it.next();
+                if(!isEmpty((String)entry.getValue())) {
+                    response.setRenderParameter(prefix+entry.getKey(), (String)entry.getValue());
+                }
+            }
+        }
+
+        public int getFactoryType() {
+            return factoryType;
+        }
+
+        public void setFactoryType(int factoryType) {
+            this.factoryType = factoryType;
+        }
+
+        public String getInstanceName() {
+            return instanceName;
+        }
+
+        public void setInstanceName(String instanceName) {
+            this.instanceName = instanceName;
+        }
+
+        public String getTransaction() {
+            return transaction;
+        }
+
+        public void setTransaction(String transaction) {
+            this.transaction = transaction;
+        }
+
+        public boolean isXaTransactionCaching() {
+            return xaTransactionCaching;
+        }
+
+        public void setXaTransactionCaching(boolean xaTransactionCaching) {
+            this.xaTransactionCaching = xaTransactionCaching;
+        }
+
+        public boolean isXaThreadCaching() {
+            return xaThreadCaching;
+        }
+
+        public void setXaThreadCaching(boolean xaThreadCaching) {
+            this.xaThreadCaching = xaThreadCaching;
+        }
+
+        public Integer getPoolMinSize() {
+            return poolMinSize;
+        }
+
+        public void setPoolMinSize(Integer poolMinSize) {
+            this.poolMinSize = poolMinSize;
+        }
+
+        public Integer getPoolMaxSize() {
+            return poolMaxSize;
+        }
+
+        public void setPoolMaxSize(Integer poolMaxSize) {
+            this.poolMaxSize = poolMaxSize;
+        }
+
+        public Integer getPoolBlockingTimeout() {
+            return poolBlockingTimeout;
+        }
+
+        public void setPoolBlockingTimeout(Integer poolBlockingTimeout) {
+            this.poolBlockingTimeout = poolBlockingTimeout;
+        }
+
+        public Integer getPoolIdleTimeout() {
+            return poolIdleTimeout;
+        }
+
+        public void setPoolIdleTimeout(Integer poolIdleTimeout) {
+            this.poolIdleTimeout = poolIdleTimeout;
+        }
+
+        public Properties getInstanceProps() {
+            return instanceProps;
+        }
+    }
+
+    public static class JMSAdminObjectData {
+        private int destinationType;
+        private String name;
+        private Properties instanceProps = new Properties();
+
+        public void load(PortletRequest request, String prefix) {
+            destinationType = isEmpty(request.getParameter(prefix+DEST_TYPE_PARAMETER)) ? -1 : Integer.parseInt(request.getParameter(prefix+DEST_TYPE_PARAMETER));
+            name = request.getParameter(prefix+NAME_PARAMETER);
+            Map map = request.getParameterMap();
+            for(int i=0; i<20; i++) {
+                String key = prefix+"instance-config-" + i;
+                if(map.containsKey(key)) {
+                    instanceProps.setProperty(key.substring(prefix.length()), request.getParameter(key));
+                }
+            }
+        }
+
+        public void save(ActionResponse response, String prefix) {
+            if(destinationType > -1) response.setRenderParameter(prefix+DEST_TYPE_PARAMETER, Integer.toString(destinationType));
+            if(!isEmpty(name)) response.setRenderParameter(prefix+NAME_PARAMETER, name);
+            for (Iterator it = instanceProps.entrySet().iterator(); it.hasNext();) {
+                Map.Entry entry = (Map.Entry) it.next();
+                if(!isEmpty((String)entry.getValue())) {
+                    response.setRenderParameter(prefix+entry.getKey(), (String)entry.getValue());
+                }
+            }
+        }
+
+        public int getDestinationType() {
+            return destinationType;
+        }
+
+        public void setDestinationType(int destinationType) {
+            this.destinationType = destinationType;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public Properties getInstanceProps() {
+            return instanceProps;
+        }
+    }
+
+    private static String getPropertyName(String propertyKey, JMSProviderData.ConfigPropertyData[] configs) {
+        int pos = propertyKey.lastIndexOf('-');
+        String num = propertyKey.substring(pos+1);
+        return configs[Integer.parseInt(num)].getName();
+    }
+
+    protected static String save(PortletRequest request, ActionResponse response, JMSResourceData data, boolean planOnly) throws IOException {
+        JMSProviderData provider = JMSProviderData.getProviderData(data.rarURI, request);
+        if(data.objectName == null || data.objectName.equals("")) { // we're creating a new pool
+            //data.instanceName = data.instanceName.replaceAll("\\s", "");
+            DeploymentManager mgr = PortletManager.getDeploymentManager(request);
+            try {
+                URL url = PortletManager.getRepositoryEntry(request, data.getRarURI());
+                ConnectorDeployable deployable = new ConnectorDeployable(url);
+                DeploymentConfiguration config = mgr.createConfiguration(deployable);
+                final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
+                Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
+                ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);
+                connector.setConfigID("console-jms-"+data.instanceName);
+                if(!isEmpty(data.dependency)) {
+                    connector.setParentID(data.dependency);
+                }
+
+                // Basic settings on RA plan and RA instance
+                ResourceAdapter ra;
+                if(connector.getResourceAdapter().length > 0) {
+                    ra = connector.getResourceAdapter(0);
+                } else {
+                    ra = new ResourceAdapter();
+                    connector.setResourceAdapter(new ResourceAdapter[]{ra});
+                }
+                ResourceAdapterInstance raInstance = new ResourceAdapterInstance();
+                ra.setResourceAdapterInstance(raInstance);
+                raInstance.setResourceAdapterName(data.instanceName);
+                for (Iterator it = data.instanceProps.entrySet().iterator(); it.hasNext();) {
+                    Map.Entry entry = (Map.Entry) it.next();
+                    String name = getPropertyName((String)entry.getKey(), provider.getInstanceConfigProperties());
+                    for(int i=0; i<raInstance.getConfigPropertySetting().length; i++) {
+                        if(raInstance.getConfigPropertySetting(i).getName().equals(name)) {
+                            raInstance.getConfigPropertySetting(i).setValue((String)entry.getValue());
+                            break;
+                        }
+                    }
+                }
+                GBeanLocator workManager = new GBeanLocator();
+                raInstance.setWorkManager(workManager);
+                workManager.setGBeanLink(data.workManager); //todo
+                // Connection Factories
+                if(data.getConnectionFactoryCount() > 0) {
+                    ConnectionDefinition[] defs = new ConnectionDefinition[data.getConnectionFactoryCount()];
+                    for (int i = 0; i < defs.length; i++) {
+                        defs[i] = new ConnectionDefinition();
+                    }
+                    ra.setConnectionDefinition(defs);
+                    for (int i = 0; i < data.getConnectionFactories().size(); i++) {
+                        JMSConnectionFactoryData factoryData = (JMSConnectionFactoryData) data.getConnectionFactories().get(i);
+                        JMSProviderData.ConnectionDefinition providerData = provider.getConnectionDefinitions()[factoryData.getFactoryType()];
+                        ConnectionDefinition def = defs[i];
+                        def.setConnectionFactoryInterface(providerData.getConnectionFactoryInterface());
+                        ConnectionDefinitionInstance instance = new ConnectionDefinitionInstance();
+                        def.setConnectionInstance(new ConnectionDefinitionInstance[]{instance});
+                        if(providerData.getConnectionFactoryInterface().equals("javax.jms.ConnectionFactory")) {
+                            instance.setImplementedInterface(new String[]{"javax.jms.QueueConnectionFactory","javax.jms.TopicConnectionFactory"});
+                        }
+                        instance.setName(factoryData.getInstanceName());
+                        SinglePool pool = new SinglePool();
+                        instance.getConnectionManager().setPoolSingle(pool);
+                        pool.setMatchOne(true);
+                        pool.setMaxSize(factoryData.getPoolMaxSize());
+                        pool.setMinSize(factoryData.getPoolMinSize());
+                        pool.setBlockingTimeoutMillis(factoryData.getPoolBlockingTimeout());
+                        pool.setIdleTimeoutMinutes(factoryData.getPoolIdleTimeout());
+                        if(factoryData.getTransaction().equals("none")) {
+                            instance.getConnectionManager().setTransactionNone(true);
+                        } else if(factoryData.getTransaction().equals("local")) {
+                            instance.getConnectionManager().setTransactionLocal(true);
+                        } else if(factoryData.getTransaction().equals("xa")) {
+                            instance.getConnectionManager().setTransactionXA(true);
+                            instance.getConnectionManager().setTransactionXACachingThread(factoryData.isXaThreadCaching());
+                            instance.getConnectionManager().setTransactionXACachingTransaction(factoryData.isXaTransactionCaching());
+                        }
+                        for (Iterator it = factoryData.instanceProps.entrySet().iterator(); it.hasNext();) {
+                            Map.Entry entry = (Map.Entry) it.next();
+                            String name = getPropertyName((String)entry.getKey(), providerData.getConfigProperties());
+                            for(int j=0; j<instance.getConfigPropertySetting().length; j++) {
+                                if(instance.getConfigPropertySetting(j).getName().equals(name)) {
+                                    instance.getConfigPropertySetting(j).setValue((String)entry.getValue());
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+
+                // Destinations
+                DDBean[] ddBeans = connector.getDDBean().getChildBean(connector.getXpaths()[0]);
+                AdminObjectDCB[] adminDCBs = new AdminObjectDCB[ddBeans.length];
+                for (int i = 0; i < adminDCBs.length; i++) {
+                    adminDCBs[i] = (AdminObjectDCB) connector.getDConfigBean(ddBeans[i]);
+                }
+                for (int i = 0; i < data.getAdminObjects().size(); i++) {
+                    JMSAdminObjectData admin = (JMSAdminObjectData) data.getAdminObjects().get(i);
+                    JMSProviderData.AdminObjectDefinition providerData = provider.getAdminObjectDefinitions()[admin.getDestinationType()];
+                    for (int j = 0; j < adminDCBs.length; j++) {
+                        AdminObjectDCB adminDCB = adminDCBs[j];
+                        if(adminDCB.getAdminObjectInterface().equals(providerData.getAdminObjectInterface())) {
+                            AdminObjectInstance[] before = adminDCB.getAdminObjectInstance();
+                            AdminObjectInstance[] after = new AdminObjectInstance[before.length+1];
+                            System.arraycopy(before, 0, after, 0, before.length);
+                            AdminObjectInstance instance = new AdminObjectInstance();
+                            after[before.length] = instance;
+                            adminDCB.setAdminObjectInstance(after);
+                            instance.setMessageDestinationName(admin.getName());
+                            for (Iterator it = admin.instanceProps.entrySet().iterator(); it.hasNext();) {
+                                Map.Entry entry = (Map.Entry) it.next();
+                                String name = getPropertyName((String)entry.getKey(), providerData.getConfigProperties());
+                                for(int k=0; k<instance.getConfigPropertySetting().length; k++) {
+                                    if(instance.getConfigPropertySetting(k).getName().equals(name)) {
+                                        instance.getConfigPropertySetting(k).setValue((String)entry.getValue());
+                                        break;
+                                    }
+                                }
+                            }
+                            break;
+                        }
+                    }
+                }
+
+                // Save
+                if(planOnly) {
+                    ByteArrayOutputStream out = new ByteArrayOutputStream();
+                    config.save(out);
+                    out.close();
+                    return new String(out.toByteArray(), "US-ASCII");
+                } else {
+                    File tempFile = File.createTempFile("console-deployment",".xml");
+                    tempFile.deleteOnExit();
+                    log.debug("Writing JMS Resource deployment plan to "+tempFile.getAbsolutePath());
+                    BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(tempFile));
+                    config.save(out);
+                    out.flush();
+                    out.close();
+                    Target[] targets = mgr.getTargets();
+                    ProgressObject po = mgr.distribute(targets, new File(url.getPath()), tempFile);
+                    waitForProgress(po);
+                    if(po.getDeploymentStatus().isCompleted()) {
+                        TargetModuleID[] ids = po.getResultTargetModuleIDs();
+                        po = mgr.start(ids);
+                        waitForProgress(po);
+                        if(po.getDeploymentStatus().isCompleted()) {
+                            ids = po.getResultTargetModuleIDs();
+                            System.out.println("Deployment completed successfully!");
+                        }
+                    }
+                }
+            } catch (Exception e) {
+                log.error("Unable to save connection pool", e);
+            } finally {
+                if(mgr != null) mgr.release();
+            }
+        } else { // We're saving updates to an existing pool
+            if(planOnly) {
+                throw new UnsupportedOperationException("Can't update a plan for an existing deployment");
+            }
+            throw new UnsupportedOperationException("Can't edit existing configurations yet");
+        }
+        return null;
+    }
+}
+

Propchange: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ConfigureRAInstanceHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ConfigureRAInstanceHandler.java?rev=371785&view=auto
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ConfigureRAInstanceHandler.java (added)
+++ geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ConfigureRAInstanceHandler.java Mon Jan 23 19:01:27 2006
@@ -0,0 +1,57 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.jmsmanager.wizard;
+
+import java.io.IOException;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * Handler for the screen that configures a resource adapter instance.
+ *
+ * @version $Rev: 368994 $ $Date: 2006-01-14 02:07:18 -0500 (Sat, 14 Jan 2006) $
+ */
+public class ConfigureRAInstanceHandler extends AbstractHandler {
+    public ConfigureRAInstanceHandler() {
+        super(CONFIGURE_RA_MODE, "/WEB-INF/view/jmswizard/raInstance.jsp");
+    }
+
+    public String actionBeforeView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException {
+        return getMode();
+    }
+
+    public void renderView(RenderRequest request, RenderResponse response, JMSResourceData data) throws PortletException, IOException {
+        JMSProviderData provider = JMSProviderData.getProviderData(data.getRarURI(), request);
+        request.setAttribute("provider", provider);
+    }
+
+    public String actionAfterView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException {
+        if(isEmpty(data.getInstanceName())) {
+            return getMode()+BEFORE_ACTION;
+        }
+        String next = request.getParameter("nextAction");
+        if(next.equals(SELECT_DESTINATION_TYPE_MODE)) {
+            data.setCurrentDestinationID(data.getAdminObjects().size());
+        } else if(next.equals(SELECT_FACTORY_TYPE_MODE)) {
+            data.setCurrentFactoryID(data.getConnectionFactories().size());
+        }
+        return next+BEFORE_ACTION;
+    }
+}

Propchange: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ConfigureRAInstanceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateConnectionFactoryHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateConnectionFactoryHandler.java?rev=371785&view=auto
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateConnectionFactoryHandler.java (added)
+++ geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateConnectionFactoryHandler.java Mon Jan 23 19:01:27 2006
@@ -0,0 +1,66 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.jmsmanager.wizard;
+
+import java.io.IOException;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * Handler for the screen that creates a new connection factory
+ *
+ * @version $Rev: 368994 $ $Date: 2006-01-14 02:07:18 -0500 (Sat, 14 Jan 2006) $
+ */
+public class CreateConnectionFactoryHandler extends AbstractHandler {
+    public CreateConnectionFactoryHandler() {
+        super(ADD_FACTORY_MODE, "/WEB-INF/view/jmswizard/factory.jsp");
+    }
+
+    public String actionBeforeView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException {
+        data.getCurrentFactory().setFactoryType(data.getFactoryType());
+        return getMode();
+    }
+
+    public void renderView(RenderRequest request, RenderResponse response, JMSResourceData data) throws PortletException, IOException {
+        JMSProviderData provider = JMSProviderData.getProviderData(data.getRarURI(), request);
+        request.setAttribute("provider", provider);
+    }
+
+    public String actionAfterView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException {
+        if(isEmpty(data.getCurrentFactory().getInstanceName())) {
+            return getMode();
+        }
+        if(data.getCurrentFactory().getTransaction().equals("xa")) {
+            data.getCurrentFactory().setXaThreadCaching(false);
+            data.getCurrentFactory().setXaTransactionCaching(true);
+        } else {
+            data.getCurrentFactory().setXaThreadCaching(false);
+            data.getCurrentFactory().setXaTransactionCaching(false);
+        }
+        // todo: process interface parameters
+        String next = request.getParameter("nextAction");
+        if(next.equals(SELECT_DESTINATION_TYPE_MODE)) {
+            data.setCurrentDestinationID(data.getAdminObjects().size());
+        } else if(next.equals(SELECT_FACTORY_TYPE_MODE)) {
+            data.setCurrentFactoryID(data.getConnectionFactories().size());
+        }
+        return next+BEFORE_ACTION;
+    }
+}

Propchange: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateConnectionFactoryHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateDestinationHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateDestinationHandler.java?rev=371785&view=auto
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateDestinationHandler.java (added)
+++ geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateDestinationHandler.java Mon Jan 23 19:01:27 2006
@@ -0,0 +1,58 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.jmsmanager.wizard;
+
+import java.io.IOException;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * Handler for the screen that creates a new connection factory
+ *
+ * @version $Rev: 368994 $ $Date: 2006-01-14 02:07:18 -0500 (Sat, 14 Jan 2006) $
+ */
+public class CreateDestinationHandler extends AbstractHandler {
+    public CreateDestinationHandler() {
+        super(ADD_DESTINATION_MODE, "/WEB-INF/view/jmswizard/destination.jsp");
+    }
+
+    public String actionBeforeView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException {
+        data.getCurrentDestination().setDestinationType(data.getDestinationType());
+        return getMode();
+    }
+
+    public void renderView(RenderRequest request, RenderResponse response, JMSResourceData data) throws PortletException, IOException {
+        JMSProviderData provider = JMSProviderData.getProviderData(data.getRarURI(), request);
+        request.setAttribute("provider", provider);
+    }
+
+    public String actionAfterView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException {
+        if(isEmpty(data.getCurrentDestination().getName())) {
+            return getMode();
+        }
+        String next = request.getParameter("nextAction");
+        if(next.equals(SELECT_DESTINATION_TYPE_MODE)) {
+            data.setCurrentDestinationID(data.getAdminObjects().size());
+        } else if(next.equals(SELECT_FACTORY_TYPE_MODE)) {
+            data.setCurrentFactoryID(data.getConnectionFactories().size());
+        }
+        return next+BEFORE_ACTION;
+    }
+}

Propchange: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/CreateDestinationHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/DeployHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/DeployHandler.java?rev=371785&view=auto
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/DeployHandler.java (added)
+++ geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/DeployHandler.java Mon Jan 23 19:01:27 2006
@@ -0,0 +1,48 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.jmsmanager.wizard;
+
+import java.io.IOException;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import org.apache.geronimo.console.util.PortletManager;
+
+/**
+ * Can deploy a JMS resource into the server.  There currently no UI associated with this.
+ *
+ * @version $Rev: 368994 $ $Date: 2006-01-14 02:07:18 -0500 (Sat, 14 Jan 2006) $
+ */
+public class DeployHandler extends AbstractHandler {
+    public DeployHandler() {
+        super(DEPLOY_MODE, null);
+    }
+
+    public String actionBeforeView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException {
+        save(request, response, data, false);
+        return LIST_MODE;
+    }
+
+    public void renderView(RenderRequest request, RenderResponse response, JMSResourceData data) throws PortletException, IOException {
+    }
+
+    public String actionAfterView(ActionRequest request, ActionResponse response, JMSResourceData data) throws PortletException, IOException {
+        return LIST_MODE;
+    }
+}

Propchange: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/DeployHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java?rev=371785&view=auto
==============================================================================
--- geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java (added)
+++ geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java Mon Jan 23 19:01:27 2006
@@ -0,0 +1,373 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.jmsmanager.wizard;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.console.util.PortletManager;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+import java.io.Serializable;
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.*;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipEntry;
+import java.net.URL;
+import javax.portlet.PortletRequest;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.ParserConfigurationException;
+
+/**
+ * Loads data on JMS providers known to the console.  Reads from a properties
+ * file on the class path.
+ *
+ * @version $Rev: 368994 $ $Date: 2006-01-14 02:07:18 -0500 (Sat, 14 Jan 2006) $
+ */
+public class JMSProviderData implements Serializable {
+    private final static Log log = LogFactory.getLog(JMSProviderData.class);
+    private String name;
+    private final String raURI;
+    private final String dependency;
+    private String defaultTransaction;
+    private ConfigPropertyData[] instanceConfigProperties;
+    private ConnectionDefinition[] connectionDefinitions;
+    private AdminObjectDefinition[] adminObjectDefinitions;
+
+    public JMSProviderData(String name, String raURI, String dependency) {
+        this.name = name;
+        this.raURI = raURI;
+        this.dependency = dependency;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getRaURI() {
+        return raURI;
+    }
+
+    public String getDependency() {
+        return dependency;
+    }
+
+    public String getDefaultTransaction() {
+        return defaultTransaction;
+    }
+
+    public ConfigPropertyData[] getInstanceConfigProperties() {
+        return instanceConfigProperties;
+    }
+
+    public ConnectionDefinition[] getConnectionDefinitions() {
+        return connectionDefinitions;
+    }
+
+    public AdminObjectDefinition[] getAdminObjectDefinitions() {
+        return adminObjectDefinitions;
+    }
+
+    public static class ConfigPropertyData implements Serializable {
+        private final String name;
+        private final String type;
+        private final String defaultValue;
+        private final String description;
+
+        public ConfigPropertyData(String name, String type, String defaultValue, String description) {
+            this.name = name;
+            this.type = type;
+            this.defaultValue = defaultValue;
+            this.description = description;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public String getType() {
+            return type;
+        }
+
+        public String getDefaultValue() {
+            return defaultValue;
+        }
+
+        public String getDescription() {
+            return description;
+        }
+    }
+
+    public static class ConnectionDefinition implements Serializable {
+        private final String connectionFactoryInterface;
+        private final ConfigPropertyData[] configProperties;
+
+        public ConnectionDefinition(String connectionFactoryInterface, ConfigPropertyData[] configProperties) {
+            this.connectionFactoryInterface = connectionFactoryInterface;
+            this.configProperties = configProperties;
+        }
+
+        public String getConnectionFactoryInterface() {
+            return connectionFactoryInterface;
+        }
+
+        public ConfigPropertyData[] getConfigProperties() {
+            return configProperties;
+        }
+    }
+
+    public static class AdminObjectDefinition implements Serializable {
+        private final String adminObjectInterface;
+        private final String adminObjectClass;
+        private final ConfigPropertyData[] configProperties;
+
+        public AdminObjectDefinition(String adminObjectInterface, String adminObjectClass, ConfigPropertyData[] configProperties) {
+            this.adminObjectInterface = adminObjectInterface;
+            this.adminObjectClass = adminObjectClass;
+            this.configProperties = configProperties;
+        }
+
+        public String getAdminObjectInterface() {
+            return adminObjectInterface;
+        }
+
+        public String getAdminObjectClass() {
+            return adminObjectClass;
+        }
+
+        public ConfigPropertyData[] getConfigProperties() {
+            return configProperties;
+        }
+    }
+
+
+    // *************** Static methods to access the data ****************
+
+    private static List all = null;
+    public static JMSProviderData[] getAllProviders() {
+        if(all == null) {
+            loadProviders();
+        }
+        return (JMSProviderData[]) all.toArray(new JMSProviderData[all.size()]);
+    }
+
+    public static JMSProviderData getProviderByName(String name) {
+        if(all == null) {
+            loadProviders();
+        }
+        for (int i = 0; i < all.size(); i++) {
+            JMSProviderData data = (JMSProviderData) all.get(i);
+            if(data.getName().equals(name)) {
+                return data;
+            }
+        }
+        return null;
+    }
+
+    public static JMSProviderData getProviderData(String rar, PortletRequest request) throws IOException {
+        for (int i = 0; i < all.size(); i++) {
+            JMSProviderData data = (JMSProviderData) all.get(i);
+            if(data.getRaURI().equals(rar)) {
+                if(data.instanceConfigProperties == null) {
+                    loadRARData(data, request);
+                }
+                return data;
+            }
+        }
+        JMSProviderData data = new JMSProviderData(null, rar, null);
+        loadRARData(data, request);
+        all.add(data);
+        return data;
+    }
+
+    private static void loadRARData(JMSProviderData data, PortletRequest request) throws IOException {
+        URL url = PortletManager.getRepositoryEntry(request, data.getRaURI());
+        ZipInputStream in = new ZipInputStream(url.openStream());
+        ZipEntry entry;
+        Document doc = null;
+        try {
+            while((entry = in.getNextEntry()) != null) {
+                if(entry.getName().equals("META-INF/ra.xml")) {
+                    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                    factory.setValidating(false);
+                    DocumentBuilder builder = factory.newDocumentBuilder();
+                    doc = builder.parse(in);
+                    in.close();
+                    break;
+                } else in.closeEntry();
+            }
+        } catch (ParserConfigurationException e) {
+            log.error("Unable to read META-INF/ra.xml in RAR file '"+data.getRaURI()+"'", e);
+        } catch (SAXException e) {
+            log.error("Unable to read META-INF/ra.xml in RAR file '"+data.getRaURI()+"'", e);
+        }
+        if(doc == null) {
+            throw new IOException("Unable to locate META-INF/ra.xml in RAR file '"+data.getRaURI()+"'");
+        }
+        Element root = doc.getDocumentElement();
+        if(data.getName() == null) {
+            NodeList displays = getChildren(root, "display-name");
+            if(displays != null && displays.getLength() > 0) {
+                data.name = getText(displays.item(0));
+            }
+        }
+        Element ra = (Element) getChildren(root, "resourceadapter").item(0);
+        data.instanceConfigProperties = loadConfigs(ra);
+        Element outbound = (Element) getChildren(ra, "outbound-resourceadapter").item(0);
+        data.defaultTransaction = getTransactionSetting(getChildText(outbound, "transaction-support"));
+        data.connectionDefinitions = loadConnections(outbound);
+        data.adminObjectDefinitions = loadAdmins(ra);
+    }
+
+    private static String getTransactionSetting(String text) {
+        if(text == null) {
+            return null;
+        }
+        if(text.equals("XATransaction")) return "xa";
+        if(text.equals("LocalTransaction")) return "local";
+        if(text.equals("NoTransaction")) return "none";
+        return null;
+    }
+
+    private static ConfigPropertyData[] loadConfigs(Element parent) {
+        NodeList configs = getChildren(parent, "config-property");
+        if(configs == null || configs.getLength() == 0) {
+            return new ConfigPropertyData[0];
+        }
+        ConfigPropertyData[] results = new ConfigPropertyData[configs.getLength()];
+        for (int i = 0; i < results.length; i++) {
+            Element root = (Element) configs.item(i);
+            results[i] = new ConfigPropertyData(getChildText(root, "config-property-name"),
+                    getChildText(root, "config-property-type"), getChildText(root, "config-property-value"),
+                    getChildText(root, "description"));
+        }
+        return results;
+    }
+
+    private static NodeList getChildren(Element parent, String child) {
+        final List list = new ArrayList();
+        NodeList nodes = parent.getChildNodes();
+        for(int i=0; i<nodes.getLength(); i++) {
+            Node node = nodes.item(i);
+            if(node.getNodeType() == Node.ELEMENT_NODE && node.getNodeName().equals(child)) {
+                list.add(node);
+            }
+        }
+        return new NodeList() {
+            public Node item(int index) {
+                return (Node) list.get(index);
+            }
+
+            public int getLength() {
+                return list.size();
+            }
+        };
+    }
+
+    private static ConnectionDefinition[] loadConnections(Element outbound) {
+        NodeList defs = getChildren(outbound, "connection-definition");
+        if(defs == null || defs.getLength() == 0) {
+            return new ConnectionDefinition[0];
+        }
+        ConnectionDefinition[] results = new ConnectionDefinition[defs.getLength()];
+        for (int i = 0; i < results.length; i++) {
+            Element def = (Element) defs.item(i);
+            results[i] = new ConnectionDefinition(getChildText(def, "connectionfactory-interface"), loadConfigs(def));
+        }
+        return results;
+    }
+
+    private static AdminObjectDefinition[] loadAdmins(Element ra) {
+        NodeList defs = getChildren(ra, "adminobject");
+        if(defs == null || defs.getLength() == 0) {
+            return new AdminObjectDefinition[0];
+        }
+        AdminObjectDefinition[] results = new AdminObjectDefinition[defs.getLength()];
+        for (int i = 0; i < results.length; i++) {
+            Element def = (Element) defs.item(i);
+            results[i] = new AdminObjectDefinition(getChildText(def, "adminobject-interface"),
+                    getChildText(def, "adminobject-class"), loadConfigs(def));
+        }
+        return results;
+    }
+
+    private static String getChildText(Element root, String name) {
+        NodeList list = getChildren(root, name);
+        if(list == null || list.getLength() == 0) {
+            return null;
+        }
+        return getText(list.item(0));
+    }
+
+    private static String getText(Node node) {
+        StringBuffer buf = null;
+        NodeList list = node.getChildNodes();
+        if(list != null) {
+            for(int i=0; i<list.getLength(); i++) {
+                Node current = list.item(i);
+                if(current.getNodeType() == Node.TEXT_NODE) {
+                    if(buf == null) {
+                        buf = new StringBuffer();
+                    }
+                    buf.append(current.getNodeValue());
+                }
+            }
+        }
+        return buf == null ? null : buf.toString();
+    }
+
+
+    private static void loadProviders() {
+        InputStream in = JMSProviderData.class.getResourceAsStream("/jms-resource-providers.properties");
+        if(in == null) {
+            log.error("Unable to locate JMS provider properties file");
+            return;
+        }
+        Properties props = new Properties();
+        try {
+            props.load(in);
+            in.close();
+        } catch (IOException e) {
+            log.error("Unable to read JMS provider properties file", e);
+        }
+        Set set = new HashSet();
+        // Find the names of the provider entries
+        for (Iterator it = props.keySet().iterator(); it.hasNext();) {
+            String key = (String) it.next();
+            int start = key.indexOf('.');
+            int end = key.indexOf('.', start+1);
+            if(start < 0 || end < 0) {
+                continue;
+            }
+            set.add(key.substring(start+1, end));
+        }
+        List list = new ArrayList(set.size());
+        for (Iterator it = set.iterator(); it.hasNext();) {
+            String key = (String) it.next();
+            String name = props.getProperty("provider."+key+".name");
+            String rar = props.getProperty("provider."+key+".rar");
+            String dep = props.getProperty("provider."+key+".dependency");
+            list.add(new JMSProviderData(name, rar, dep));
+        }
+        all = list;
+    }
+}

Propchange: geronimo/branches/1.0/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/JMSProviderData.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message