geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r332881 [2/2] - in /geronimo/trunk: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/ applications/console-standard/src/java/org/a...
Date Sun, 13 Nov 2005 03:56:28 GMT
Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp?rev=332881&r1=332880&r2=332881&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
(original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
Sat Nov 12 19:56:12 2005
@@ -7,6 +7,11 @@
 <p>This page lets you automatically download a driver for a database where the
 driver JARs are available online without login or registration.</p>
 
+<p><i>If this page took a very long time to load and there are no drivers listed
in the box below,
+it probably means your Geronimo installation can't connect to apache.org to retrieve the
driver
+download configuration file.  Sorry for the inconvenience, you'll have to try again later
or
+install the driver by hand (copy it to a directory under geronimo/repository/)</i></p>
+
 <!--   FORM TO COLLECT DATA FOR THIS PAGE   -->
 <form name="<portlet:namespace/>DatabaseForm" action="<portlet:actionURL/>">
     <input type="hidden" name="mode" value="process-download" />
@@ -24,7 +29,13 @@
     <input type="hidden" name="maxSize" value="${pool.maxSize}" />
     <input type="hidden" name="idleTimeout" value="${pool.idleTimeout}" />
     <input type="hidden" name="blockingTimeout" value="${pool.blockingTimeout}" />
+    <input type="hidden" name="adapterDisplayName" value="${pool.adapterDisplayName}"
/>
+    <input type="hidden" name="adapterDescription" value="${pool.adapterDescription}"
/>
+    <input type="hidden" name="rarPath" value="${pool.rarPath}" />
   <c:forEach var="prop" items="${pool.properties}">
+    <input type="hidden" name="${prop.key}" value="${prop.value}" />
+  </c:forEach>
+  <c:forEach var="prop" items="${pool.urlProperties}">
     <input type="hidden" name="${prop.key}" value="${prop.value}" />
   </c:forEach>
     <table border="0">

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp?rev=332881&r1=332880&r2=332881&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp
(original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/testConnection.jsp
Sat Nov 12 19:56:12 2005
@@ -21,7 +21,13 @@
     <input type="hidden" name="maxSize" value="${pool.maxSize}" />
     <input type="hidden" name="idleTimeout" value="${pool.idleTimeout}" />
     <input type="hidden" name="blockingTimeout" value="${pool.blockingTimeout}" />
+    <input type="hidden" name="adapterDisplayName" value="${pool.adapterDisplayName}"
/>
+    <input type="hidden" name="adapterDescription" value="${pool.adapterDescription}"
/>
+    <input type="hidden" name="rarPath" value="${pool.rarPath}" />
   <c:forEach var="prop" items="${pool.properties}">
+    <input type="hidden" name="${prop.key}" value="${prop.value}" />
+  </c:forEach>
+  <c:forEach var="prop" items="${pool.urlProperties}">
     <input type="hidden" name="${prop.key}" value="${prop.value}" />
   </c:forEach>
     <table border="0">

Modified: geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=332881&r1=332880&r2=332881&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Sat Nov 12 19:56:12 2005
@@ -34,6 +34,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.Date;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 import javax.management.MalformedObjectNameException;
@@ -292,7 +293,7 @@
         J2eeContext earJ2eeContext = earContext.getJ2eeContext();
         J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext,
NameFactory.RESOURCE_ADAPTER_MODULE, module.getName());
         J2eeContext resourceJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext,
NameFactory.JCA_RESOURCE, module.getName());
-        XmlObject specDD = module.getSpecDD();
+        final ConnectorType connector = (ConnectorType) module.getSpecDD();
 
         //set up the metadata for the ResourceAdapterModule
         ObjectName resourceAdapterModuleName = null;
@@ -310,8 +311,13 @@
         }
 
         resourceAdapterModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
+        resourceAdapterModuleData.setAttribute("displayName", connector.getDisplayNameArray().length
== 0 ? null : connector.getDisplayNameArray(0).getStringValue());
+        resourceAdapterModuleData.setAttribute("description", connector.getDescriptionArray().length
== 0 ? null : connector.getDescriptionArray(0).getStringValue());
+        resourceAdapterModuleData.setAttribute("vendorName", connector.getVendorName().getStringValue());
+        resourceAdapterModuleData.setAttribute("EISType", connector.getEisType().getStringValue());
+        resourceAdapterModuleData.setAttribute("resourceAdapterVersion", connector.getResourceadapterVersion().getStringValue());
 
-        ResourceadapterType resourceadapter = ((ConnectorType) specDD).getResourceadapter();
+        ResourceadapterType resourceadapter = connector.getResourceadapter();
         // Create the resource adapter gbean
         if (resourceadapter.isSetResourceadapterClass()) {
             GBeanInfoBuilder resourceAdapterInfoBuilder = new GBeanInfoBuilder(ResourceAdapterWrapperGBean.class,
ResourceAdapterWrapperGBean.GBEAN_INFO);
@@ -674,6 +680,13 @@
             clazz = cl.loadClass(type);
         } catch (ClassNotFoundException e) {
             throw new DeploymentException("Could not load attribute class:  type: " + type,
e);
+        }
+
+        // Handle numeric fields with no value set
+        if(value.equals("")) {
+            if(Number.class.isAssignableFrom(clazz) || Date.class.isAssignableFrom(clazz))
{
+                return null;
+            }
         }
 
         PropertyEditor editor = PropertyEditors.getEditor(clazz);

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java?rev=332881&r1=332880&r2=332881&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
Sat Nov 12 19:56:12 2005
@@ -24,7 +24,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
-import org.apache.geronimo.management.ResourceAdapterModule;
+import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 
@@ -42,6 +42,11 @@
     private final Map adminObjectInfoMap;
     private final Map managedConnectionFactoryInfoMap;
     private final String objectName;
+    private final String displayName;
+    private final String description;
+    private final String vendorName;
+    private final String resourceAdapterVersion;
+    private final String eisType;
 
     public ResourceAdapterModuleImpl(String resourceAdapter,
                                      String objectName, 
@@ -51,7 +56,12 @@
                                      GBeanData resourceAdapterGBeanData,
                                      Map activationSpecInfoMap,
                                      Map adminObjectInfoMap,
-                                     Map managedConnectionFactoryInfoMap) {
+                                     Map managedConnectionFactoryInfoMap,
+                                     String displayName,
+                                     String description,
+                                     String vendorName,
+                                     String resourceAdapterVersion,
+                                     String eisType) {
         this.objectName = objectName;
         ObjectName myObjectName = JMXUtil.getObjectName(objectName);
         verifyObjectName(myObjectName);
@@ -66,6 +76,11 @@
         this.activationSpecInfoMap = activationSpecInfoMap;
         this.adminObjectInfoMap = adminObjectInfoMap;
         this.managedConnectionFactoryInfoMap = managedConnectionFactoryInfoMap;
+        this.description = description;
+        this.displayName = displayName;
+        this.vendorName = vendorName;
+        this.resourceAdapterVersion = resourceAdapterVersion;
+        this.eisType = eisType;
     }
 
     public String getObjectName() {
@@ -121,6 +136,26 @@
 
     public Map getManagedConnectionFactoryInfoMap() {
         return managedConnectionFactoryInfoMap;
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public String getVendorName() {
+        return vendorName;
+    }
+
+    public String getResourceAdapterVersion() {
+        return resourceAdapterVersion;
+    }
+
+    public String getEISType() {
+        return eisType;
     }
 
     /**

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImplGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImplGBean.java?rev=332881&r1=332880&r2=332881&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImplGBean.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImplGBean.java
Sat Nov 12 19:56:12 2005
@@ -25,7 +25,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
-import org.apache.geronimo.management.ResourceAdapterModule;
+import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 
 /**
  * 
@@ -53,6 +53,14 @@
         infoBuilder.addAttribute("activationSpecInfoMap", Map.class, true);
         infoBuilder.addAttribute("adminObjectInfoMap", Map.class, true);
         infoBuilder.addAttribute("managedConnectionFactoryInfoMap", Map.class, true);
+
+        infoBuilder.addAttribute("displayName", String.class, true, false);
+        infoBuilder.addAttribute("description", String.class, true, false);
+        infoBuilder.addAttribute("vendorName", String.class, true, false);
+        infoBuilder.addAttribute("EISType", String.class, true, false);
+        infoBuilder.addAttribute("resourceAdapterVersion", String.class, true, false);
+
+
         infoBuilder.addInterface(ResourceAdapterModule.class);
 
         infoBuilder.setConstructor(new String[]{
@@ -64,7 +72,12 @@
             "resourceAdapterGBeanData",
             "activationSpecInfoMap",
             "adminObjectInfoMap",
-            "managedConnectionFactoryInfoMap"
+            "managedConnectionFactoryInfoMap",
+            "displayName",
+            "description",
+            "vendorName",
+            "resourceAdapterVersion",
+            "EISType"
         });
 
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java?rev=332881&r1=332880&r2=332881&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
Sat Nov 12 19:56:12 2005
@@ -17,7 +17,12 @@
 
 package org.apache.geronimo.connector.outbound;
 
+import java.lang.reflect.Constructor;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Properties;
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 import javax.resource.ResourceException;
 import javax.resource.spi.ManagedConnectionFactory;
 import javax.resource.spi.ResourceAdapterAssociation;
@@ -36,6 +41,7 @@
 import org.apache.geronimo.transaction.manager.NamedXAResource;
 import org.apache.geronimo.transaction.manager.ResourceManager;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 
 /**
  * @version $Rev$ $Date$
@@ -168,6 +174,22 @@
         return connectionManagerContainer;
     }
 
+    public String getConnectionManager() {
+        try {
+            ObjectName mine = ObjectName.getInstance(objectName);
+            Properties other = new Properties();
+            other.setProperty(NameFactory.J2EE_APPLICATION, mine.getKeyProperty(NameFactory.J2EE_APPLICATION));
+            other.setProperty(NameFactory.J2EE_SERVER, mine.getKeyProperty(NameFactory.J2EE_SERVER));
+            other.setProperty(NameFactory.JCA_RESOURCE, mine.getKeyProperty(NameFactory.JCA_RESOURCE));
+            other.setProperty(NameFactory.J2EE_TYPE, NameFactory.JCA_CONNECTION_MANAGER);
+            other.setProperty(NameFactory.J2EE_NAME, mine.getKeyProperty(NameFactory.J2EE_NAME));
+            return new ObjectName(mine.getDomain(), other).getCanonicalName();
+        } catch (MalformedObjectNameException e) {
+            log.error("Unable to construct ObjectName", e);
+            return null;
+        }
+    }
+
     public void doStart() throws Exception {
         //register with resource adapter if not yet done
         if (!registered && (managedConnectionFactory instanceof ResourceAdapterAssociation))
{
@@ -250,6 +272,56 @@
 
     public ManagedConnectionFactory $getManagedConnectionFactory() {
         return managedConnectionFactory;
+    }
+
+    /**
+     * Gets the config properties in the form of a map where the key is the
+     * property name and the value is property type (as a String not a Class).
+     */
+    public Map getConfigProperties() {
+        String[] props = delegate.getProperties();
+        Map map = new HashMap();
+        for (int i = 0; i < props.length; i++) {
+            String prop = props[i];
+            if(prop.equals("logWriter")) {
+                continue;
+            }
+            map.put(prop, delegate.getPropertyType(prop));
+        }
+        return map;
+    }
+
+    public void setConfigProperty(String property, Object value) throws Exception {
+        Class cls = delegate.getPropertyType(property);
+        if(value != null && value instanceof String && !cls.getName().equals("java.lang.String"))
{
+            if(cls.isPrimitive()) {
+                if(cls.equals(int.class)) {
+                    cls = Integer.class;
+                } else if(cls.equals(boolean.class)) {
+                    cls = Boolean.class;
+                } else if(cls.equals(float.class)) {
+                    cls = Float.class;
+                } else if(cls.equals(double.class)) {
+                    cls = Double.class;
+                } else if(cls.equals(long.class)) {
+                    cls = Long.class;
+                } else if(cls.equals(short.class)) {
+                    cls = Short.class;
+                } else if(cls.equals(byte.class)) {
+                    cls = Byte.class;
+                } else if(cls.equals(char.class)) {
+                    cls = Character.class;
+                }
+            }
+            //todo: what about value is null but type is primitive?
+            Constructor con = cls.getConstructor(new Class[]{String.class});
+            value = con.newInstance(new Object[]{value});
+        }
+        delegate.setAttribute(property, value);
+    }
+
+    public Object getConfigProperty(String property) throws Exception {
+        return delegate.getAttribute(property);
     }
 
     //ResourceManager implementation

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandLogin.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandLogin.java?rev=332881&r1=332880&r2=332881&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandLogin.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandLogin.java
Sat Nov 12 19:56:12 2005
@@ -29,14 +29,7 @@
 import java.io.BufferedOutputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Properties;
-import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.DeploymentManager;
-import javax.enterprise.deploy.spi.Target;
-import javax.enterprise.deploy.spi.exceptions.TargetException;
-import javax.enterprise.deploy.spi.status.ProgressObject;
 
 /**
  * The CLI deployer logic to start.

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGBeanDelegate.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGBeanDelegate.java?rev=332881&r1=332880&r2=332881&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGBeanDelegate.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/DynamicGBeanDelegate.java
Sat Nov 12 19:56:12 2005
@@ -22,6 +22,10 @@
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
 
 import net.sf.cglib.reflect.FastClass;
 import net.sf.cglib.reflect.FastMethod;
@@ -137,6 +141,28 @@
             throw new IllegalArgumentException(targetClass.getName() + ": no operation "
+ signature);
         }
         return operation.invoke(arguments);
+    }
+
+    /**
+     * Gets all properties (with both a getter and setter), in the form of
+     * propertyName
+     */ 
+    public String[] getProperties() {
+        Set one = getters.keySet();
+        Set two = setters.keySet();
+        List out = new ArrayList();
+        for (Iterator it = one.iterator(); it.hasNext();) {
+            String name = (String) it.next();
+            if(Character.isLowerCase(name.charAt(0)) && two.contains(name)) {
+                out.add(name);
+            }
+        }
+        return (String[]) out.toArray(new String[out.size()]);
+    }
+
+    public Class getPropertyType(String name) {
+        Operation oper = (Operation) getters.get(name);
+        return oper.method.getReturnType();
     }
 
     protected static class Operation {

Modified: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java?rev=332881&r1=332880&r2=332881&view=diff
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java
(original)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java
Sat Nov 12 19:56:12 2005
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.management.geronimo;
 
+import java.util.Map;
+
 /**
  * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
  */
@@ -31,4 +33,23 @@
     public String getConnectionInterface();
 
     public String getConnectionImplClass();
+
+    /**
+     * Gets the config properties in the form of a map where the key is the
+     * property name and the value is property type (as a String not a Class).
+     */
+    public Map getConfigProperties();
+
+    public void setConfigProperty(String property, Object value) throws Exception;
+
+    public Object getConfigProperty(String property) throws Exception;
+
+    /**
+     * Gets the ObjectName of the ConnectionManager associated with this managed
+     * connection factory.  That object should implement
+     * javax.resource.spi.ConnectionManager and
+     * org.apache.geronimo.connector.outbound.PoolingAttributes
+     * @return
+     */
+    public String getConnectionManager();
 }

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java?rev=332881&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java
(added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java
Sat Nov 12 19:56:12 2005
@@ -0,0 +1,28 @@
+/**
+ *
+ * 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.management.geronimo;
+
+/**
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public interface ResourceAdapterModule extends org.apache.geronimo.management.ResourceAdapterModule
{
+    public String getDisplayName();
+    public String getDescription();
+    public String getVendorName();
+    public String getResourceAdapterVersion();
+    public String getEISType();
+}

Propchange: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapterModule.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message