geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r607943 - in /geronimo/server/trunk: framework/configs/j2ee-system/src/main/plan/ framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming...
Date Tue, 01 Jan 2008 23:07:19 GMT
Author: djencks
Date: Tue Jan  1 15:07:17 2008
New Revision: 607943

URL: http://svn.apache.org/viewvc?rev=607943&view=rev
Log:
GERONIMO-3718 experimental patch to speed up resource-refs.

Added:
    geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/ResourceSource.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/AbstractEntryFactory.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntryFactory.java   (with props)
    geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/
    geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReference.java   (with props)
    geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReferenceFactory.java   (with props)
Removed:
    geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/ResourceReference.java
    geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/AdminObjectSource.java
Modified:
    geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
    geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/enc/EnterpriseNamingContext.java
    geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java
    geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
    geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/AdminObjectWrapper.java
    geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java
    geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
    geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLog.java
    geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLogGBean.java
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/core/jms/JMSConnectionFactoryBean.java
    geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/mail/MailGBean.java
    geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java
    geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
    geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java
    geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java
    geronimo/server/trunk/plugins/webservices/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java

Modified: geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml Tue Jan  1 15:07:17 2008
@@ -80,8 +80,8 @@
 
     <!--Configuration Manager service-->
     <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.EditableKernelConfigurationManager">
+        <!--<attribute name="defaultStoreNameQuery">?name=MasterConfigurationStore</attribute>-->
         <attribute name="defaultStoreNameQuery">?name=Local</attribute>
-        <reference name="Repositories"></reference>
         <reference name="Repositories"></reference>
         <reference name="Stores"></reference>
         <reference name="Watchers"></reference>

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java Tue Jan  1 15:07:17 2008
@@ -307,7 +307,7 @@
             Manifest manifest,
             ConfigurationStore store,
             DeploymentContext context) throws DeploymentException, IOException, Throwable {
-        List configurations = new ArrayList();
+        List<ConfigurationData> configurations = new ArrayList<ConfigurationData>();
         configurations.add(context.getConfigurationData());
         configurations.addAll(context.getAdditionalDeployment());
 

Added: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/ResourceSource.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/ResourceSource.java?rev=607943&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/ResourceSource.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/ResourceSource.java Tue Jan  1 15:07:17 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.naming;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface ResourceSource<E extends Throwable> {
+
+    Object $getResource() throws E;
+
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/ResourceSource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/ResourceSource.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/ResourceSource.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/enc/EnterpriseNamingContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/enc/EnterpriseNamingContext.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/enc/EnterpriseNamingContext.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/enc/EnterpriseNamingContext.java Tue Jan  1 15:07:17 2008
@@ -17,10 +17,10 @@
 
 package org.apache.geronimo.naming.enc;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Collections;
 
 import javax.naming.Context;
 import javax.naming.NamingException;
@@ -28,6 +28,7 @@
 
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.naming.reference.ClassLoaderAwareReference;
+import org.apache.geronimo.naming.reference.EntryFactory;
 import org.apache.geronimo.naming.reference.KernelAwareReference;
 import org.apache.xbean.naming.context.ImmutableContext;
 
@@ -36,20 +37,23 @@
  */
 public final class EnterpriseNamingContext {
 
-    public static Context createEnterpriseNamingContext(Map componentContext, UserTransaction userTransaction, Kernel kernel, ClassLoader classLoader) throws NamingException {
-        Map map = new HashMap();
+    public static Context createEnterpriseNamingContext(Map<String, Object> componentContext, UserTransaction userTransaction, Kernel kernel, ClassLoader classLoader) throws NamingException {
+        Map<String, Object> map = new HashMap<String, Object>();
         if (componentContext != null) {
             map.putAll(componentContext);
         }
 
         boolean containsEnv = false;
-        for (Iterator iterator = map.entrySet().iterator(); iterator.hasNext();) {
-            Map.Entry entry = (Map.Entry) iterator.next();
-            String name = (String) entry.getKey();
+        for (Map.Entry<String, Object> entry: map.entrySet()) {
+            String name = entry.getKey();
             Object value = entry.getValue();
 
             if (name.startsWith("env/")) {
                 containsEnv = true;
+            }
+            if (value instanceof EntryFactory) {
+                value = ((EntryFactory)value).buildEntry(kernel, classLoader);
+                entry.setValue(value);
             }
             if (value instanceof KernelAwareReference) {
                 ((KernelAwareReference) value).setKernel(kernel);

Added: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/AbstractEntryFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/AbstractEntryFactory.java?rev=607943&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/AbstractEntryFactory.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/AbstractEntryFactory.java Tue Jan  1 15:07:17 2008
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.naming.reference;
+
+import java.util.List;
+import java.util.Set;
+import java.util.Collections;
+
+import javax.naming.NamingException;
+import javax.naming.NameNotFoundException;
+
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public abstract class AbstractEntryFactory<T, S> implements EntryFactory<T> {
+    private static final long serialVersionUID = 7642216668523441421L;
+    private final Artifact[] configId;
+    private final Set<AbstractNameQuery> abstractNameQueries;
+    private final Class<S> gbeanClass;
+
+    protected AbstractEntryFactory(Artifact[] configId, AbstractNameQuery abstractNameQuery, Class<S> gbeanClass) {
+        this(configId, Collections.singleton(abstractNameQuery), gbeanClass);
+    }
+
+    protected AbstractEntryFactory(Artifact[] configId, Set<AbstractNameQuery> abstractNameQueries, Class<S> gbeanClass) {
+        if (configId == null || configId.length == 0) {
+            throw new NullPointerException("No configId");
+        }
+        this.configId = configId;
+        this.abstractNameQueries = abstractNameQueries;
+        this.gbeanClass = gbeanClass;
+    }
+
+    protected S getGBean(Kernel kernel) throws NamingException {
+        AbstractName target;
+        try {
+            target = resolveTargetName(kernel);
+        } catch (GBeanNotFoundException e) {
+            throw (NameNotFoundException) new NameNotFoundException("Could not resolve name query: " + abstractNameQueries).initCause(e);
+        }
+
+        Object proxy;
+        try {
+            proxy = kernel.getGBean(target);
+        } catch (Exception e) {
+            throw (IllegalStateException) new IllegalStateException("Could not get proxy").initCause(e);
+        }
+        if (proxy == null) {
+            throw new IllegalStateException("Proxy not returned. Target " + target + " not started");
+        }
+        checkClass(proxy, gbeanClass);
+        return (S)proxy;
+
+    }
+
+    protected void checkClass(Object proxy, Class clazz) {
+        if (!clazz.isAssignableFrom(proxy.getClass())) {
+            Class proxyClass = proxy.getClass();
+            Class[] interfaces = proxyClass.getInterfaces();
+            StringBuffer message = new StringBuffer();
+            boolean namesMatch = false;
+            for (Class anInterface : interfaces) {
+                if (clazz.getName().equals(anInterface.getName())) {
+                    namesMatch = true;
+                    message.append("Proxy implements correct interface: ").append(clazz.getName()).append(", but classloaders differ\n");
+                    message.append("lookup interface classloader: ").append(clazz.getClassLoader().toString()).append("\n");
+                    message.append("target interface classloader: ").append(anInterface.getClassLoader().toString()).append("\n");
+                    message.append("target proxy classloader: ").append(proxy.getClass().getClassLoader());
+                    break;
+                }
+            }
+            if (!namesMatch) {
+                message.append("Proxy does not implement an interface named: ").append(clazz.getName());
+            }
+            throw new ClassCastException(message.toString());
+        }
+    }
+
+    public Configuration getConfiguration(Kernel kernel) {
+         ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
+         Configuration configuration =  configurationManager.getConfiguration(configId[0]);
+         if (configuration == null) {
+             throw new IllegalStateException("No configuration found for id: " + configId[0]);
+         }
+         next: for (int i = 1; i < configId.length; i++) {
+             List<Configuration> children = configuration.getChildren();
+             for (Configuration child: children) {
+                 if (child.getId().equals(configId[i])) {
+                     configuration = child;
+                     break next;
+                 }
+             }
+             throw new IllegalStateException("No configuration found for id: " + configId[i]);
+         }
+         return configuration;
+     }
+
+     public AbstractName resolveTargetName(Kernel kernel) throws GBeanNotFoundException {
+         Configuration configuration = getConfiguration(kernel);
+         try {
+             return configuration.findGBean(abstractNameQueries);
+         } catch (GBeanNotFoundException e) {
+             Set results = kernel.listGBeans(abstractNameQueries);
+             if (results.size() == 1) {
+                 return (AbstractName) results.iterator().next();
+             }
+             throw new GBeanNotFoundException("Name query " + abstractNameQueries + " not satisfied in kernel, matches: " + results, e);
+         }
+     }
+
+
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/AbstractEntryFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/AbstractEntryFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/AbstractEntryFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntryFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntryFactory.java?rev=607943&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntryFactory.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntryFactory.java Tue Jan  1 15:07:17 2008
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.naming.reference;
+
+import java.io.Serializable;
+
+import javax.naming.NamingException;
+
+import org.apache.geronimo.kernel.Kernel;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface EntryFactory<T> extends Serializable {
+
+    T buildEntry(Kernel kernel, ClassLoader classLoader) throws NamingException;
+
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntryFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntryFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntryFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java (original)
+++ geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java Tue Jan  1 15:07:17 2008
@@ -19,21 +19,21 @@
 
 import java.net.URI;
 
-import javax.sql.DataSource;
 import javax.jms.JMSException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import javax.resource.ResourceException;
+import javax.sql.DataSource;
 
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.jmx.ManagementContext;
 import org.apache.activemq.store.DefaultPersistenceAdapterFactory;
 import org.apache.activemq.transport.TransportDisposedIOException;
-import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 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.management.geronimo.JMSManager;
 import org.apache.geronimo.management.geronimo.NetworkConnector;
 import org.apache.geronimo.system.jmx.MBeanServerReference;
@@ -53,7 +53,7 @@
     private BrokerService brokerService;
     private ServerInfo serverInfo;
     private String dataDirectory;
-    private ConnectionFactorySource dataSource;
+    private ResourceSource<ResourceException> dataSource;
     private ClassLoader classLoader;
     private String objectName;
     private JMSManager manager;
@@ -154,7 +154,7 @@
         infoBuilder.addAttribute("brokerUri", String.class, true);
         infoBuilder.addAttribute("useShutdownHook", Boolean.TYPE, true);
         infoBuilder.addAttribute("dataDirectory", String.class, true);
-        infoBuilder.addReference("dataSource", ConnectionFactorySource.class);
+        infoBuilder.addReference("dataSource", ResourceSource.class);
         infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addReference("manager", JMSManager.class);
         infoBuilder.addInterface(BrokerServiceGBean.class);
@@ -201,11 +201,11 @@
         this.dataDirectory = dataDir;
     }
 
-    public ConnectionFactorySource getDataSource() {
+    public ResourceSource<ResourceException> getDataSource() {
         return dataSource;
     }
 
-    public void setDataSource(ConnectionFactorySource dataSource) {
+    public void setDataSource(ResourceSource<ResourceException> dataSource) {
         this.dataSource = dataSource;
     }
 

Modified: geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java Tue Jan  1 15:07:17 2008
@@ -31,11 +31,12 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.common.UnresolvedReferenceException;
+import org.apache.geronimo.connector.naming.ResourceReferenceFactory;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
 import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -43,7 +44,6 @@
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
-import org.apache.geronimo.naming.reference.ResourceReference;
 import org.apache.geronimo.naming.reference.UserTransactionReference;
 import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationDocument;
 import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
@@ -150,7 +150,7 @@
                     getJndiContextMap(componentContext).put(ENV + name, ref);
                 } else {
                     AbstractNameQuery containerId = getAdminObjectContainerId(name, gerResourceEnvRef);
-                    Reference ref = buildAdminObjectReference(module, containerId, iface);
+                    ResourceReferenceFactory<RuntimeException> ref = buildAdminObjectReference(module, containerId, iface);
                     getJndiContextMap(componentContext).put(ENV + name, ref);
                 }
             } catch (UnresolvedReferenceException e) {
@@ -213,7 +213,7 @@
             //try to resolve ref based only matching resource-ref-name
             //throws exception if it can't locate ref.
             AbstractNameQuery containerId = buildAbstractNameQuery(null, moduleURI, linkName, NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE);
-            Reference ref = buildAdminObjectReference(module, containerId, iface);
+            ResourceReferenceFactory<RuntimeException> ref = buildAdminObjectReference(module, containerId, iface);
             getJndiContextMap(componentContext).put(ENV + name, ref);
 
         }
@@ -252,14 +252,14 @@
     }
 
 
-    private Reference buildAdminObjectReference(Module module, AbstractNameQuery containerId, Class iface) throws DeploymentException {
+    private ResourceReferenceFactory<RuntimeException> buildAdminObjectReference(Module module, AbstractNameQuery containerId, Class iface) throws DeploymentException {
         Configuration localConfiguration = module.getEarContext().getConfiguration();
         try {
             localConfiguration.findGBean(containerId);
         } catch (GBeanNotFoundException e) {
             throw new DeploymentException("Can not resolve admin object ref " + containerId + " in configuration " + localConfiguration.getId(), e);
         }
-        return new ResourceReference(module.getConfigId(), containerId, iface);
+        return new ResourceReferenceFactory<RuntimeException>(module.getConfigId(), containerId, iface);
     }
 
     private static AbstractNameQuery getAdminObjectContainerId(String name, GerResourceEnvRefType gerResourceEnvRef) {

Modified: geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Tue Jan  1 15:07:17 2008
@@ -38,13 +38,11 @@
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 
-import javax.naming.Reference;
 import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.common.UnresolvedReferenceException;
 import org.apache.geronimo.common.propertyeditor.PropertyEditors;
 import org.apache.geronimo.connector.ActivationSpecWrapperGBean;
 import org.apache.geronimo.connector.AdminObjectWrapper;
@@ -99,7 +97,6 @@
 import org.apache.geronimo.management.geronimo.JCAResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
-import org.apache.geronimo.naming.reference.ResourceReference;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
 import org.apache.geronimo.xbeans.geronimo.GerAdminobjectType;

Modified: geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java Tue Jan  1 15:07:17 2008
@@ -30,12 +30,13 @@
 import java.util.Set;
 
 import javax.annotation.Resource;
-import javax.naming.Reference;
+import javax.resource.ResourceException;
 import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.connector.naming.ResourceReferenceFactory;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -54,7 +55,6 @@
 import org.apache.geronimo.naming.deployment.ResourceEnvironmentBuilder;
 import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 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;
@@ -172,7 +172,7 @@
 
                     module.getEarContext().findGBean(containerId);
 
-                    Reference ref = new ResourceReference(module.getConfigId(), containerId, iface);
+                    Object ref = new ResourceReferenceFactory<ResourceException>(module.getConfigId(), containerId, iface);
                     getJndiContextMap(componentContext).put(ENV + name, ref);
                 } catch (GBeanNotFoundException e) {
 

Modified: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/AdminObjectWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/AdminObjectWrapper.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/AdminObjectWrapper.java (original)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/AdminObjectWrapper.java Tue Jan  1 15:07:17 2008
@@ -24,6 +24,7 @@
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.DynamicGBean;
 import org.apache.geronimo.gbean.DynamicGBeanDelegate;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.geronimo.JCAAdminObject;
 
@@ -33,7 +34,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class AdminObjectWrapper implements DynamicGBean, JCAAdminObject, AdminObjectSource {
+public class AdminObjectWrapper implements DynamicGBean, JCAAdminObject, ResourceSource<RuntimeException> {
 
     private final String adminObjectInterface;
     private final String adminObjectClass;

Modified: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java (original)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java Tue Jan  1 15:07:17 2008
@@ -22,20 +22,20 @@
 import java.io.InputStreamReader;
 import java.net.URL;
 import java.sql.Connection;
+import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
-import java.sql.ResultSet;
 
+import javax.resource.ResourceException;
 import javax.sql.DataSource;
 
-import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 /**
  * @version $Rev$ $Date$
  */
@@ -44,7 +44,7 @@
 
     private static final Log log = LogFactory.getLog(DatabaseInitializationGBean.class);
 
-    public DatabaseInitializationGBean(String testSQL, String path, ConnectionFactorySource cfSource, ClassLoader classLoader) throws Exception {
+    public DatabaseInitializationGBean(String testSQL, String path, ResourceSource<ResourceException> cfSource, ClassLoader classLoader) throws Exception {
 
         DataSource ds = (DataSource) cfSource.$getResource();
         Connection c = ds.getConnection();
@@ -118,7 +118,7 @@
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(DatabaseInitializationGBean.class, "GBean");
         infoBuilder.addAttribute("testSQL", String.class, false);
         infoBuilder.addAttribute("path", String.class, true);
-        infoBuilder.addReference("DataSource", ConnectionFactorySource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
+        infoBuilder.addReference("DataSource", ResourceSource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
 
         infoBuilder.setConstructor(new String[]{"testSQL", "path", "DataSource", "classLoader"});

Added: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReference.java?rev=607943&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReference.java (added)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReference.java Tue Jan  1 15:07:17 2008
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.connector.naming;
+
+import javax.naming.NamingException;
+
+import org.apache.geronimo.naming.ResourceSource;
+import org.apache.xbean.naming.reference.SimpleReference;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class ResourceReference<E extends Throwable> extends SimpleReference {
+    private final ResourceSource<E> source;
+    private final String type;
+
+    public ResourceReference(ResourceSource<E> source, String type) {
+        this.source = source;
+        this.type = type;
+    }
+
+    public Object getContent() throws NamingException {
+        try {
+            return source.$getResource();
+        } catch (Throwable e) {
+            throw (NamingException)new NamingException("Could not create resource").initCause(e);
+        }
+    }
+
+    @Override
+    public String getClassName() {
+        return type;
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReference.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReference.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReferenceFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReferenceFactory.java?rev=607943&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReferenceFactory.java (added)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReferenceFactory.java Tue Jan  1 15:07:17 2008
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.connector.naming;
+
+import javax.naming.NamingException;
+
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.naming.ResourceSource;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.naming.reference.AbstractEntryFactory;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class ResourceReferenceFactory<E extends Throwable> extends AbstractEntryFactory<ResourceReference<E>, ResourceSource> {
+    private static final long serialVersionUID = -8208147204560412794L;
+    private final String type;
+
+
+    public ResourceReferenceFactory(Artifact[] configId, AbstractNameQuery abstractNameQuery, Class targetClass) {
+        super(configId, abstractNameQuery, ResourceSource.class);
+        type = targetClass.getName();
+    }
+
+    public ResourceReference buildEntry(Kernel kernel, ClassLoader classLoader) throws NamingException {
+        ResourceSource<E> source = getGBean(kernel);
+        return new ResourceReference<E>(source, type);
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReferenceFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReferenceFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/naming/ResourceReferenceFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java (original)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java Tue Jan  1 15:07:17 2008
@@ -33,13 +33,14 @@
 import org.apache.geronimo.gbean.DynamicGBean;
 import org.apache.geronimo.gbean.DynamicGBeanDelegate;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ManagedConnectionFactoryWrapper implements GBeanLifecycle, DynamicGBean, JCAManagedConnectionFactory, ConnectionFactorySource {
+public class ManagedConnectionFactoryWrapper implements GBeanLifecycle, DynamicGBean, JCAManagedConnectionFactory, ResourceSource<ResourceException> {
 
     private static final Log log = LogFactory.getLog(ManagedConnectionFactoryWrapper.class);
 

Modified: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLog.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLog.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLog.java (original)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLog.java Tue Jan  1 15:07:17 2008
@@ -26,11 +26,12 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.resource.ResourceException;
 import javax.sql.DataSource;
 import javax.transaction.xa.Xid;
 
-import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.transaction.manager.LogException;
 import org.apache.geronimo.transaction.manager.Recovery;
 import org.apache.geronimo.transaction.manager.TransactionBranchInfo;
@@ -52,9 +53,9 @@
 
     private DataSource dataSource;
     private final String systemId;
-    private final ConnectionFactorySource managedConnectionFactoryWrapper;
+    private final ResourceSource<ResourceException> managedConnectionFactoryWrapper;
 
-    public JDBCLog(String systemId, ConnectionFactorySource managedConnectionFactoryWrapper) {
+    public JDBCLog(String systemId, ResourceSource<ResourceException> managedConnectionFactoryWrapper) {
         this.systemId = systemId;
         this.managedConnectionFactoryWrapper = managedConnectionFactoryWrapper;
     }

Modified: geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLogGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLogGBean.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLogGBean.java (original)
+++ geronimo/server/trunk/plugins/connector/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/transactionlog/JDBCLogGBean.java Tue Jan  1 15:07:17 2008
@@ -17,9 +17,9 @@
 
 package org.apache.geronimo.connector.outbound.transactionlog;
 
-import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.transaction.manager.TransactionLog;
 
@@ -38,7 +38,7 @@
 
         infoFactory.addInterface(TransactionLog.class);
 
-        infoFactory.addReference("ConnectionFactorySource", ConnectionFactorySource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
+        infoFactory.addReference("ConnectionFactorySource", ResourceSource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
 
         infoFactory.setConstructor(new String[]{"systemId", "ConnectionFactorySource"});
 

Modified: geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/core/jms/JMSConnectionFactoryBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/core/jms/JMSConnectionFactoryBean.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/core/jms/JMSConnectionFactoryBean.java (original)
+++ geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/core/jms/JMSConnectionFactoryBean.java Tue Jan  1 15:07:17 2008
@@ -18,27 +18,26 @@
 package org.apache.geronimo.console.core.jms;
 
 import javax.jms.ConnectionFactory;
+import javax.resource.ResourceException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
-import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.naming.ResourceSource;
 
 public class JMSConnectionFactoryBean implements GBeanLifecycle {
 
     private static Log log = LogFactory.getLog(JMSConnectionFactoryBean.class);
 
-    private final ConnectionFactorySource managedConnectionFactoryWrapper;
+    private final ResourceSource<ResourceException> managedConnectionFactoryWrapper;
 
     private String connectionFactoryName = "jms/DefaultActiveMQConnectionFactory";
 
     private ConnectionFactory connectionFactory;
 
-    public JMSConnectionFactoryBean(
-            ConnectionFactorySource managedConnectionFactoryWrapper) {
+    public JMSConnectionFactoryBean(ResourceSource managedConnectionFactoryWrapper) {
         this.managedConnectionFactoryWrapper = managedConnectionFactoryWrapper;
 
     }
@@ -70,15 +69,12 @@
     static {
 
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("JMS Connection Factory Bean", JMSConnectionFactoryBean.class);
-        infoFactory.addAttribute("connectionFactory", ConnectionFactory.class,
-                false);
+        infoFactory.addAttribute("connectionFactory", ConnectionFactory.class, false);
 
-        infoFactory.addReference("ManagedConnectionFactoryWrapper",
-                ConnectionFactorySource.class);
+        infoFactory.addReference("ManagedConnectionFactoryWrapper", ResourceSource.class);
         infoFactory.addOperation("getConnectionFactory");
 
-        infoFactory
-                .setConstructor(new String[] { "ManagedConnectionFactoryWrapper" });
+        infoFactory.setConstructor(new String[] { "ManagedConnectionFactoryWrapper" });
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Modified: geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/mail/MailGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/mail/MailGBean.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/mail/MailGBean.java (original)
+++ geronimo/server/trunk/plugins/javamail/geronimo-mail/src/main/java/org/apache/geronimo/mail/MailGBean.java Tue Jan  1 15:07:17 2008
@@ -16,22 +16,23 @@
  */
 package org.apache.geronimo.mail;
 
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Properties;
+
 import javax.mail.Authenticator;
 import javax.mail.Session;
 import javax.naming.Context;
 import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import javax.naming.Name;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Properties;
+import javax.naming.NamingException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 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.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.JavaMailResource;
 
@@ -49,7 +50,7 @@
  * @see POP3StoreGBean
  * @see IMAPStoreGBean
  */
-public class MailGBean implements GBeanLifecycle, JavaMailResource {
+public class MailGBean implements GBeanLifecycle, JavaMailResource, ResourceSource {
 
     private final Log log = LogFactory.getLog(MailGBean.class);
 

Modified: geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java (original)
+++ geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java Tue Jan  1 15:07:17 2008
@@ -49,6 +49,7 @@
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.persistence.PersistenceUnitGBean;
 import org.apache.geronimo.xbeans.persistence.PersistenceDocument;
 import org.apache.xbean.finder.ResourceFinder;
@@ -69,6 +70,7 @@
     private final AbstractNameQuery defaultNonJtaDataSourceName;
     private final AbstractNameQuery extendedEntityManagerRegistryName;
     private static final String ANON_PU_NAME = "AnonymousPersistenceUnit";
+    private static final String RESOURCE_SOURCE_CLASS_NAME = ResourceSource.class.getName();
 
     public PersistenceUnitBuilder(Environment defaultEnvironment,
                                   String defaultPersistenceProviderClassName,
@@ -316,7 +318,7 @@
         if (dataSourceString.indexOf('=') == -1) {
             dataSourceString = "?name=" + dataSourceString;
         }
-        AbstractNameQuery dataSourceNameQuery = new AbstractNameQuery(new URI(dataSourceString + "#org.apache.geronimo.connector.outbound.ConnectionFactorySource"));
+        AbstractNameQuery dataSourceNameQuery = new AbstractNameQuery(new URI(dataSourceString + "#" + RESOURCE_SOURCE_CLASS_NAME));
         return dataSourceNameQuery;
     }
 

Modified: geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java (original)
+++ geronimo/server/trunk/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java Tue Jan  1 15:07:17 2008
@@ -35,14 +35,14 @@
 import javax.persistence.spi.PersistenceProvider;
 import javax.persistence.spi.PersistenceUnitInfo;
 import javax.persistence.spi.PersistenceUnitTransactionType;
-import javax.sql.DataSource;
 import javax.resource.ResourceException;
+import javax.sql.DataSource;
 
-import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.SingleElementCollection;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.classloader.TemporaryClassLoader;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
@@ -70,8 +70,8 @@
     public PersistenceUnitGBean(String persistenceUnitName,
             String persistenceProviderClassName,
             String persistenceUnitTransactionTypeString,
-            ConnectionFactorySource jtaDataSourceWrapper,
-            ConnectionFactorySource nonJtaDataSourceWrapper,
+            ResourceSource<ResourceException> jtaDataSourceWrapper,
+            ResourceSource<ResourceException> nonJtaDataSourceWrapper,
             List<String> mappingFileNamesUntyped,
             List<String> jarFileUrlsUntyped,
             String persistenceUnitRoot,
@@ -339,8 +339,8 @@
         infoBuilder.addAttribute("configurationBaseUrl", URL.class, true);
 
         infoBuilder.addReference("TransactionManager", TransactionManagerImpl.class, NameFactory.JTA_RESOURCE);
-        infoBuilder.addReference("JtaDataSourceWrapper", ConnectionFactorySource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
-        infoBuilder.addReference("NonJtaDataSourceWrapper", ConnectionFactorySource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
+        infoBuilder.addReference("JtaDataSourceWrapper", ResourceSource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
+        infoBuilder.addReference("NonJtaDataSourceWrapper", ResourceSource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
         infoBuilder.addReference("EntityManagerRegistry", ExtendedEntityManagerRegistry.class, NameFactory.GERONIMO_SERVICE);
 
         infoBuilder.setConstructor(new String[] {

Modified: geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java (original)
+++ geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledNonTransactionalTimer.java Tue Jan  1 15:07:17 2008
@@ -18,15 +18,15 @@
 package org.apache.geronimo.timer.jdbc;
 
 import java.sql.SQLException;
+import java.util.concurrent.Executor;
+
+import javax.resource.ResourceException;
 import javax.sql.DataSource;
 import javax.transaction.TransactionManager;
-import javax.resource.ResourceException;
-
-import java.util.concurrent.Executor;
 
-import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.timer.NontransactionalExecutorTaskFactory;
@@ -38,7 +38,7 @@
  */
 public class JDBCStoreThreadPooledNonTransactionalTimer extends ThreadPooledTimer {
 
-    public JDBCStoreThreadPooledNonTransactionalTimer(ConnectionFactorySource managedConnectionFactoryWrapper,
+    public JDBCStoreThreadPooledNonTransactionalTimer(ResourceSource<ResourceException> managedConnectionFactoryWrapper,
                                                       TransactionManager transactionManager,
                                                       Executor threadPool,
                                                       Kernel kernel) throws SQLException, ResourceException {
@@ -53,7 +53,7 @@
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(JDBCStoreThreadPooledNonTransactionalTimer.class);
         infoFactory.addInterface(PersistentTimer.class);
 
-        infoFactory.addReference("ManagedConnectionFactoryWrapper", ConnectionFactorySource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
+        infoFactory.addReference("ManagedConnectionFactoryWrapper", ResourceSource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
         infoFactory.addReference("ThreadPool", Executor.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addReference("TransactionManager", TransactionManager.class, NameFactory.JTA_RESOURCE);
 

Modified: geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java (original)
+++ geronimo/server/trunk/plugins/system-database/geronimo-timer/src/main/java/org/apache/geronimo/timer/jdbc/JDBCStoreThreadPooledTransactionalTimer.java Tue Jan  1 15:07:17 2008
@@ -18,15 +18,15 @@
 package org.apache.geronimo.timer.jdbc;
 
 import java.sql.SQLException;
+import java.util.concurrent.Executor;
+
+import javax.resource.ResourceException;
 import javax.sql.DataSource;
 import javax.transaction.TransactionManager;
-import javax.resource.ResourceException;
-
-import java.util.concurrent.Executor;
 
-import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.timer.PersistentTimer;
@@ -43,7 +43,7 @@
 
     public JDBCStoreThreadPooledTransactionalTimer(int repeatCount,
             TransactionManager transactionManager,
-            ConnectionFactorySource managedConnectionFactoryWrapper,
+            ResourceSource<ResourceException> managedConnectionFactoryWrapper,
             Executor threadPool,
             Kernel kernel) throws SQLException, ResourceException {
         super(new TransactionalExecutorTaskFactory(transactionManager, repeatCount),
@@ -59,7 +59,7 @@
 
         infoFactory.addAttribute("repeatCount", int.class, true);
         infoFactory.addReference("TransactionManager", TransactionManager.class, NameFactory.JTA_RESOURCE);
-        infoFactory.addReference("ManagedConnectionFactoryWrapper", ConnectionFactorySource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
+        infoFactory.addReference("ManagedConnectionFactoryWrapper", ResourceSource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
         infoFactory.addReference("ThreadPool", Executor.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addAttribute("kernel", Kernel.class, false);
 

Modified: geronimo/server/trunk/plugins/webservices/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/webservices/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java?rev=607943&r1=607942&r2=607943&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/webservices/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java (original)
+++ geronimo/server/trunk/plugins/webservices/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java Tue Jan  1 15:07:17 2008
@@ -16,21 +16,22 @@
  */
 package org.apache.geronimo.webservices.jaxr;
 
+import javax.xml.registry.ConnectionFactory;
+import javax.xml.registry.JAXRException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.Log;
-
-import javax.xml.registry.ConnectionFactory;
-import javax.xml.registry.JAXRException;
 
 /**
  * Simple GBean to provide access to a JAXR ConnectionFactory
  *
  * @version $Rev$ $Date$
  */
-public class JAXRGBean {
+public class JAXRGBean implements ResourceSource {
 
     private final Log log = LogFactory.getLog(JAXRGBean.class);
     private final ClassLoader cl;



Mime
View raw message