geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: rev 46288 - in geronimo/trunk/modules: connector/src/test/org/apache/geronimo/connector connector/src/test/org/apache/geronimo/connector/outbound naming/src/java/org/apache/geronimo/naming naming/src/java/org/apache/geronimo/naming/java naming/src/java/org/apache/geronimo/naming/jmx naming/src/test/org/apache/geronimo/naming/java
Date Fri, 17 Sep 2004 23:33:48 GMT
Author: dain
Date: Fri Sep 17 16:33:47 2004
New Revision: 46288

Added:
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/ReferenceFactory.java
Modified:
   geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
   geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/jmx/JMXReferenceFactory.java
   geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
Log:
Extracted ReferenceFactory interface from JMXReferenceFactory


Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
(original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
Fri Sep 17 16:33:47 2004
@@ -32,6 +32,7 @@
 import org.apache.geronimo.naming.java.ComponentContextBuilder;
 import org.apache.geronimo.naming.java.ReadOnlyContext;
 import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
+import org.apache.geronimo.naming.ReferenceFactory;
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -89,7 +90,7 @@
 
 
     public void testLocalLookup() throws Exception {
-        JMXReferenceFactory referenceFactory = new JMXReferenceFactory();
+        ReferenceFactory referenceFactory = new JMXReferenceFactory();
         ComponentContextBuilder builder = new ComponentContextBuilder(referenceFactory);
         builder.addResourceEnvRef("resourceenvref", MockAdminObject.class, new RefAdapter()
{
             public XmlObject getXmlObject() {

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
(original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
Fri Sep 17 16:33:47 2004
@@ -45,6 +45,7 @@
 import org.apache.geronimo.naming.java.ComponentContextBuilder;
 import org.apache.geronimo.naming.java.ReadOnlyContext;
 import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
+import org.apache.geronimo.naming.ReferenceFactory;
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -124,7 +125,7 @@
     }
 
     public void testLocalLookup() throws Exception {
-        JMXReferenceFactory referenceFactory = new JMXReferenceFactory();
+        ReferenceFactory referenceFactory = new JMXReferenceFactory();
         ComponentContextBuilder builder = new ComponentContextBuilder(referenceFactory);
         builder.addResourceRef("resourceref", ConnectionFactory.class, new RefAdapter() {
             public XmlObject getXmlObject() {

Added: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/ReferenceFactory.java
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/ReferenceFactory.java
Fri Sep 17 16:33:47 2004
@@ -0,0 +1,38 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.naming;
+
+import javax.naming.Reference;
+import javax.management.MalformedObjectNameException;
+
+import org.apache.geronimo.naming.deployment.RefAdapter;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface ReferenceFactory {
+    Reference buildConnectionFactoryReference(RefAdapter refAdapter, Class iface) throws
MalformedObjectNameException;
+
+    Reference buildAdminObjectReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException;
+
+    //TODO warning: this only works if there is only one kernel!
+    Reference buildMessageDestinationReference(String linkName, Class iface) throws MalformedObjectNameException;
+
+    Reference buildEjbReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException;
+
+    Reference buildEjbLocalReference(RefAdapter refAdapter, Class iface) throws MalformedObjectNameException;
+}

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
Fri Sep 17 16:33:47 2004
@@ -24,7 +24,7 @@
 import javax.transaction.UserTransaction;
 
 import org.apache.geronimo.naming.deployment.RefAdapter;
-import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
+import org.apache.geronimo.naming.ReferenceFactory;
 
 /**
  *
@@ -33,10 +33,10 @@
  */
 public class ComponentContextBuilder {
     private static final String ENV = "env/";
-    private final JMXReferenceFactory referenceFactory;
+    private final ReferenceFactory referenceFactory;
     private final ReadOnlyContext context;
 
-    public ComponentContextBuilder(JMXReferenceFactory referenceFactory) {
+    public ComponentContextBuilder(ReferenceFactory referenceFactory) {
         this.referenceFactory = referenceFactory;
         this.context = new ReadOnlyContext();
     }

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/jmx/JMXReferenceFactory.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/jmx/JMXReferenceFactory.java
(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/jmx/JMXReferenceFactory.java
Fri Sep 17 16:33:47 2004
@@ -22,6 +22,7 @@
 import javax.naming.Reference;
 
 import org.apache.geronimo.naming.deployment.RefAdapter;
+import org.apache.geronimo.naming.ReferenceFactory;
 
 /**
  *
@@ -29,7 +30,7 @@
  * @version $Rev$ $Date$
  *
  * */
-public class JMXReferenceFactory {
+public class JMXReferenceFactory implements ReferenceFactory {
 
     //TODO these names are constructed in a more generic fashion in ConnectorModuleBuilder.
     public static final String BASE_MANAGED_CONNECTION_FACTORY_NAME = "geronimo.server:J2EEServer=geronimo,j2eeType=JCAManagedConnectionFactory,name=";

Modified: geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
==============================================================================
--- geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
(original)
+++ geronimo/trunk/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
Fri Sep 17 16:33:47 2004
@@ -35,6 +35,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.naming.deployment.RefAdapter;
 import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
+import org.apache.geronimo.naming.ReferenceFactory;
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -172,7 +173,7 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        JMXReferenceFactory referenceFactory = new JMXReferenceFactory();
+        ReferenceFactory referenceFactory = new JMXReferenceFactory();
         builder = new ComponentContextBuilder(referenceFactory);
     }
 

Mime
View raw message