geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r990869 - in /geronimo/server/trunk: framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/ plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ plugins/co...
Date Mon, 30 Aug 2010 17:17:09 GMT
Author: djencks
Date: Mon Aug 30 17:17:08 2010
New Revision: 990869

URL: http://svn.apache.org/viewvc?rev=990869&view=rev
Log:
GERONIMO-434 for ee jndi go back to getting the connection factory each time from the connection
manager since osgi jndi caches the connection factory for us

Removed:
    geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/ResourceReferenceFactory.java
Modified:
    geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/ResourceReference.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/resource/mail/MailGBean.java
    geronimo/server/trunk/plugins/javamail/geronimo-mail/src/test/java/org/apache/geronimo/resource/mail/MailGBeanTest.java
    geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java

Modified: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/ResourceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/ResourceReference.java?rev=990869&r1=990868&r2=990869&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/ResourceReference.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/ResourceReference.java
Mon Aug 30 17:17:08 2010
@@ -20,28 +20,46 @@
 
 package org.apache.geronimo.naming.reference;
 
+import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
 
 import org.apache.geronimo.naming.ResourceSource;
 import org.apache.xbean.naming.reference.SimpleReference;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ResourceReference<E extends Throwable> extends SimpleReference {
-    private final ResourceSource<E> source;
+public class ResourceReference<E extends Throwable> extends SimpleReference implements
BundleAwareReference {
     private final String type;
+    private final String query;
+    private transient BundleContext bundleContext;
 
-    public ResourceReference(ResourceSource<E> source, String type) {
-        this.source = source;
+    public ResourceReference(String query, String type) {
+        this.query = query;
         this.type = type;
     }
 
+    @Override
     public Object getContent() throws NamingException {
+        ServiceReference ref = null;
         try {
+            ServiceReference[] refs = bundleContext.getServiceReferences(ResourceSource.class.getName(),
query);
+            if (refs == null || refs.length == 0) {
+                throw new NameNotFoundException("could not locate osgi service matching "
+ query);
+            }
+            ref = refs[0];
+            @SuppressWarnings("Unchecked")
+            ResourceSource<E> source = (ResourceSource<E>) bundleContext.getService(ref);
             return source.$getResource();
         } catch (Throwable e) {
-            throw (NamingException)new NamingException("Could not create resource").initCause(e);
+            throw (NamingException) new NamingException("Could not create resource").initCause(e);
+        } finally {
+            if (ref != null) {
+                bundleContext.ungetService(ref);
+            }
         }
     }
 
@@ -49,4 +67,9 @@ public class ResourceReference<E extends
     public String getClassName() {
         return type;
     }
+
+    @Override
+    public void setBundle(Bundle bundle) {
+        this.bundleContext = bundle.getBundleContext();
+    }
 }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java?rev=990869&r1=990868&r2=990869&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java
Mon Aug 30 17:17:08 2010
@@ -24,6 +24,7 @@ import java.io.ObjectOutput;
 import java.io.ObjectStreamException;
 import java.io.Serializable;
 
+import javax.resource.ResourceException;
 import javax.resource.spi.ConnectionManager;
 import javax.security.auth.Subject;
 
@@ -35,6 +36,7 @@ import org.apache.geronimo.connector.out
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.OsgiService;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.gbean.annotation.ParamReference;
 import org.apache.geronimo.gbean.annotation.ParamSpecial;
@@ -44,6 +46,7 @@ import org.apache.geronimo.kernel.GBeanN
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.security.ContextManager;
 import org.apache.geronimo.transaction.manager.RecoverableTransactionManager;
 import org.osgi.framework.BundleContext;
@@ -53,7 +56,8 @@ import org.osgi.framework.ServiceRegistr
  * @version $Revision$
  */
 @GBean(j2eeType = NameFactory.JCA_CONNECTION_MANAGER)
-public class GenericConnectionManagerGBean extends GenericConnectionManager implements GBeanLifecycle,
Serializable, Externalizable {
+@OsgiService
+public class GenericConnectionManagerGBean extends GenericConnectionManager implements ResourceSource<ResourceException>,
GBeanLifecycle, Serializable, Externalizable {
     private Kernel kernel;
     private AbstractName abstractName;
     //externalizable format version
@@ -134,4 +138,9 @@ public class GenericConnectionManagerGBe
         abstractName = (AbstractName) in.readObject();
     }
 
+    @Override
+    public Object $getResource() throws ResourceException {
+        return createConnectionFactory();
+    }
+    
 }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java?rev=990869&r1=990868&r2=990869&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java
Mon Aug 30 17:17:08 2010
@@ -41,7 +41,7 @@ import org.osgi.framework.ServiceRegistr
  */
 @GBean(j2eeType = NameFactory.JCA_CONNECTION_FACTORY)
 @OsgiService
-public class JCAConnectionFactoryImpl implements JCAConnectionFactory, ResourceSource<ResourceException>,
ServiceFactory {
+public class JCAConnectionFactoryImpl implements JCAConnectionFactory, ServiceFactory {
     private final String objectName;
     private final GenericConnectionManagerGBean connectionManager;
 
@@ -94,16 +94,16 @@ public class JCAConnectionFactoryImpl im
         return connectionManager.createConnectionFactory();
     }
 
-    @Override
-    public Object $getResource() throws ResourceException {
-        try {
-            return createConnectionFactory();
-        } catch (ResourceException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new ResourceException("Should not happen", e);
-        }
-    }
+//    @Override
+//    public Object $getResource() throws ResourceException {
+//        try {
+//            return createConnectionFactory();
+//        } catch (ResourceException e) {
+//            throw e;
+//        } catch (Exception e) {
+//            throw new ResourceException("Should not happen", e);
+//        }
+//    }
 
     @Override
     public Object getService(Bundle bundle, ServiceRegistration serviceRegistration) {

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=990869&r1=990868&r2=990869&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Mon Aug 30 17:17:08 2010
@@ -1218,6 +1218,8 @@ public class ConnectorModuleBuilder impl
             throw new DeploymentException("Unexpected pooling support element in connector
named " + connectionfactoryInstance.getName().trim());
         }
         try {
+            String jndiName = naming.toOsgiJndiName(connectionManagerAbstractName);
+            connectionManagerGBean.getServiceProperties().put(OSGI_JNDI_SERVICE_NAME, jndiName);
             connectionManagerGBean.setAttribute("transactionSupport", transactionSupport);
             connectionManagerGBean.setAttribute("pooling", pooling);
             connectionManagerGBean.setReferencePattern("ConnectionTracker", connectionTrackerName);
@@ -1240,14 +1242,6 @@ public class ConnectorModuleBuilder impl
         // ManagedConnectionFactory
         setDynamicGBeanDataAttributes(managedConnectionFactoryInstanceGBeanData, connectiondefinitionInstance.getConfigPropertySettingArray(),
bundle);
 
-        String jndiName = connectiondefinitionInstance.getJndiName();
-        if (jndiName == null) {
-            jndiName = naming.toOsgiJndiName(connectionFactoryAbstractName);
-        } else {
-            jndiName = jndiName.trim();
-        }
-//        managedConnectionFactoryInstanceGBeanData.setAttribute("jndiName", jndiName.trim());
-        
         //Check if Driver class is available here. This should be available in cl. If not
log a warning as
         //the plan gets deployed and while starting GBean an error is thrown
 
@@ -1287,6 +1281,12 @@ public class ConnectorModuleBuilder impl
         GBeanData connectionFactoryGBeanData = new GBeanData(connectionFactoryAbstractName,
JCAConnectionFactoryImpl.class);
         connectionFactoryGBeanData.setReferencePattern("ConnectionManager", connectionManagerName);
         connectionFactoryGBeanData.setServiceInterfaces(implementedInterfaces.toArray(new
String[implementedInterfaces.size()]));
+        String jndiName = connectiondefinitionInstance.getJndiName();
+        if (jndiName == null) {
+            jndiName = naming.toOsgiJndiName(connectionFactoryAbstractName);
+        } else {
+            jndiName = jndiName.trim();
+        }
         connectionFactoryGBeanData.getServiceProperties().put(OSGI_JNDI_SERVICE_NAME, jndiName);
 
         raBeans.add(connectionFactoryGBeanData);

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?rev=990869&r1=990868&r2=990869&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
Mon Aug 30 17:17:08 2010
@@ -57,6 +57,7 @@ import org.apache.geronimo.naming.deploy
 import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 import org.apache.geronimo.naming.reference.JndiReference;
 import org.apache.geronimo.naming.reference.ORBReference;
+import org.apache.geronimo.naming.reference.ResourceReference;
 import org.apache.geronimo.naming.reference.URLReference;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefDocument;
@@ -70,6 +71,7 @@ import org.apache.openejb.jee.Text;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -215,15 +217,17 @@ public class ResourceRefBuilder extends 
             } else if (JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
                 j2eeType = NameFactory.JAXR_CONNECTION_FACTORY;
             } else {
-                j2eeType = NameFactory.JCA_CONNECTION_FACTORY;
+//                j2eeType = NameFactory.JCA_CONNECTION_FACTORY;
+                j2eeType = NameFactory.JCA_CONNECTION_MANAGER;
             }
             try {
                 AbstractNameQuery containerId = getResourceContainerId(name, j2eeType, null,
gerResourceRef);
 
                 AbstractName abstractName = module.getEarContext().findGBean(containerId);
-                String osgiJndiName = "aries:services/" + module.getEarContext().getNaming().toOsgiJndiName(abstractName);
+                String osgiJndiName = module.getEarContext().getNaming().toOsgiJndiName(abstractName);
+                String filter = "(osgi.jndi.service.name=" + osgiJndiName + ')';
 
-                return new JndiReference(osgiJndiName);
+                return new ResourceReference(filter, type);
                         //ResourceReferenceFactory<ResourceException>(module.getConfigId(),
containerId, iface);
             } catch (GBeanNotFoundException e) {
                 StringBuffer errorMessage = new StringBuffer("Unable to resolve resource
reference '");

Modified: geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml?rev=990869&r1=990868&r2=990869&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml
Mon Aug 30 17:17:08 2010
@@ -23,6 +23,16 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-cli</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-main</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>j2ee-security</artifactId>
         <type>car</type>
     </dependency>
@@ -38,15 +48,50 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-ejb_3.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-j2ee-connector_1.6_spec</artifactId>
         <type>jar</type>
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-jaxrpc_1.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-jpa_2.0_spec</artifactId>
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-osgi-registry</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.xpp3</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-bundleutils</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-finder</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.tranql</groupId>
         <artifactId>tranql-connector</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/resource/mail/MailGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/resource/mail/MailGBean.java?rev=990869&r1=990868&r2=990869&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/resource/mail/MailGBean.java
(original)
+++ geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/resource/mail/MailGBean.java
Mon Aug 30 17:17:08 2010
@@ -26,15 +26,19 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.Name;
 import javax.naming.NamingException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.naming.ResourceSource;
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.OsgiService;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.JavaMailResource;
+import org.apache.geronimo.naming.ResourceSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -50,12 +54,15 @@ import org.apache.geronimo.management.Ja
  * @see POP3StoreGBean
  * @see IMAPStoreGBean
  */
+
+@GBean(j2eeType = NameFactory.JAVA_MAIL_RESOURCE)
+@OsgiService
 public class MailGBean implements GBeanLifecycle, JavaMailResource, ResourceSource {
 
     private static final Logger log = LoggerFactory.getLogger(MailGBean.class);
 
     private final String objectName;
-    private final Collection protocols;
+    private final Collection<ProtocolGBean> protocols;
     private Boolean useDefault;
     private Properties properties;
     private Authenticator authenticator;
@@ -84,8 +91,17 @@ public class MailGBean implements GBeanL
      * @param debug             the debug setting for Sessions created from this GBean
      * @param jndiName          the JNDI name to which the mail Session should be bound
      */
-    public MailGBean(String objectName, Collection protocols, Boolean useDefault, Properties
properties, Authenticator authenticator,
-                     String storeProtocol, String transportProtocol, String host, String
user, Boolean debug, String jndiName) {
+    public MailGBean(@ParamSpecial(type = SpecialAttributeType.objectName) String objectName,
+                     @ParamReference(name = "Protocols", namingType = GBeanInfoBuilder.DEFAULT_J2EE_TYPE)
Collection<ProtocolGBean> protocols,
+                     @ParamAttribute(name="useDefault") Boolean useDefault,
+                     @ParamAttribute(name="properties") Properties properties,
+                     @ParamReference(name = "Authenticator", namingType = GBeanInfoBuilder.DEFAULT_J2EE_TYPE)
Authenticator authenticator,
+                     @ParamAttribute(name="storeProtocol") String storeProtocol,
+                     @ParamAttribute(name="transportProtocol") String transportProtocol,
+                     @ParamAttribute(name="host") String host,
+                     @ParamAttribute(name="user") String user,
+                     @ParamAttribute(name="debug") Boolean debug,
+                     @ParamAttribute(name="jndiName") String jndiName) {
         this.objectName = objectName;
         this.protocols = protocols;
         setUseDefault(useDefault);
@@ -313,12 +329,12 @@ public class MailGBean implements GBeanL
         this.jndiName = jndiName;
     }
 
+    @Override
     public Object $getResource() {
         Properties props = new Properties(properties);
 
         if (protocols != null) {
-            for (Iterator iter = protocols.iterator(); iter.hasNext();) {
-                ProtocolGBean protocol = (ProtocolGBean) iter.next();
+            for (ProtocolGBean protocol : protocols) {
                 protocol.addOverrides(props);
             }
         }
@@ -427,42 +443,4 @@ public class MailGBean implements GBeanL
         return false;
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(MailGBean.class, NameFactory.JAVA_MAIL_RESOURCE);
-
-        infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addReference("Protocols", ProtocolGBean.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
-        infoFactory.addAttribute("useDefault", Boolean.class, true);
-        infoFactory.addAttribute("properties", Properties.class, true);
-        infoFactory.addReference("Authenticator", Authenticator.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
-        infoFactory.addAttribute("storeProtocol", String.class, true);
-        infoFactory.addAttribute("transportProtocol", String.class, true);
-        infoFactory.addAttribute("host", String.class, true);
-        infoFactory.addAttribute("user", String.class, true);
-        infoFactory.addAttribute("debug", Boolean.class, true);
-        infoFactory.addAttribute("jndiName", String.class, true);
-        infoFactory.addOperation("$getResource");
-        infoFactory.addOperation("getProtocols");
-        infoFactory.addInterface(JavaMailResource.class);
-
-        infoFactory.setConstructor(new String[]{"objectName",
-                                                "Protocols",
-                                                "useDefault",
-                                                "properties",
-                                                "Authenticator",
-                                                "storeProtocol",
-                                                "transportProtocol",
-                                                "host",
-                                                "user",
-                                                "debug",
-                                                "jndiName"});
-
-        GBEAN_INFO = infoFactory.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
 }

Modified: geronimo/server/trunk/plugins/javamail/geronimo-mail/src/test/java/org/apache/geronimo/resource/mail/MailGBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/javamail/geronimo-mail/src/test/java/org/apache/geronimo/resource/mail/MailGBeanTest.java?rev=990869&r1=990868&r2=990869&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/javamail/geronimo-mail/src/test/java/org/apache/geronimo/resource/mail/MailGBeanTest.java
(original)
+++ geronimo/server/trunk/plugins/javamail/geronimo-mail/src/test/java/org/apache/geronimo/resource/mail/MailGBeanTest.java
Mon Aug 30 17:17:08 2010
@@ -91,7 +91,7 @@ public class MailGBeanTest extends TestC
         SMTPTransportGBean protocol = new SMTPTransportGBean("test:name=smtp", null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null);
         protocol.doStart();
 
-        MailGBean mail = new MailGBean("test:name=mail", Collections.singleton(protocol),
Boolean.TRUE, properties, null, "test", "test", null, null, null, null);
+        MailGBean mail = new MailGBean("test:name=mail", Collections.<ProtocolGBean>singleton(protocol),
Boolean.TRUE, properties, null, "test", "test", null, null, null, null);
         mail.doStart();
         Object proxy = mail.$getResource();
 
@@ -120,7 +120,7 @@ public class MailGBeanTest extends TestC
         POP3StoreGBean protocol = new POP3StoreGBean("test:name=pop3", null, null, null,
null, null, null, null, null, null, null, null, null, null, null);
         protocol.doStart();
 
-        MailGBean mail = new MailGBean("test:name=mail", Collections.singleton(protocol),
Boolean.TRUE, properties, null, "test", "test", null, null, null, null);
+        MailGBean mail = new MailGBean("test:name=mail", Collections.<ProtocolGBean>singleton(protocol),
Boolean.TRUE, properties, null, "test", "test", null, null, null, null);
         mail.doStart();
         Object proxy = mail.$getResource();
 
@@ -146,7 +146,7 @@ public class MailGBeanTest extends TestC
         IMAPStoreGBean protocol = new IMAPStoreGBean("test:name=imap", null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null);
         protocol.doStart();
 
-        MailGBean mail = new MailGBean("test:name=mail", Collections.singleton(protocol),
Boolean.TRUE, properties, null, "test", "test", null, null, null, null);
+        MailGBean mail = new MailGBean("test:name=mail", Collections.<ProtocolGBean>singleton(protocol),
Boolean.TRUE, properties, null, "test", "test", null, null, null, null);
         mail.doStart();
         Object proxy = mail.$getResource();
 

Modified: geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java?rev=990869&r1=990868&r2=990869&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
(original)
+++ geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
Mon Aug 30 17:17:08 2010
@@ -74,8 +74,8 @@ public class PersistenceUnitGBean implem
     public PersistenceUnitGBean(@ParamAttribute(name = "persistenceUnitName") String persistenceUnitName,
                                 @ParamAttribute(name = "persistenceProviderClassName") String
persistenceProviderClassName,
                                 @ParamAttribute(name = "persistenceUnitTransactionType")
String persistenceUnitTransactionTypeString,
-                                @ParamReference(name = "JtaDataSourceWrapper", namingType
= NameFactory.JCA_CONNECTION_FACTORY) ResourceSource<ResourceException> jtaDataSourceWrapper,
-                                @ParamReference(name = "NonJtaDataSourceWrapper", namingType
= NameFactory.JCA_CONNECTION_FACTORY) ResourceSource<ResourceException> nonJtaDataSourceWrapper,
+                                @ParamReference(name = "JtaDataSourceWrapper", namingType
= NameFactory.JCA_CONNECTION_MANAGER) ResourceSource<ResourceException> jtaDataSourceWrapper,
+                                @ParamReference(name = "NonJtaDataSourceWrapper", namingType
= NameFactory.JCA_CONNECTION_MANAGER) ResourceSource<ResourceException> nonJtaDataSourceWrapper,
                                 @ParamAttribute(name = "mappingFileNames") List<String>
mappingFileNamesUntyped,
                                 @ParamAttribute(name = "jarFileUrls") List<String>
jarFileUrlsUntyped,
                                 @ParamAttribute(name = "persistenceUnitRoot") String persistenceUnitRoot,



Mime
View raw message