You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ge...@apache.org on 2005/02/08 12:39:34 UTC

svn commit: r152662 - in geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/jaxr: ./ JAXRGBean.java

Author: geirm
Date: Tue Feb  8 03:39:31 2005
New Revision: 152662

URL: http://svn.apache.org/viewcvs?view=rev&rev=152662
Log:
new simple GBean to be resource for jaxr connection factories

Added:
    geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/jaxr/
    geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java

Added: geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java?view=auto&rev=152662
==============================================================================
--- geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java (added)
+++ geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/jaxr/JAXRGBean.java Tue Feb  8 03:39:31 2005
@@ -0,0 +1,70 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.webservices.jaxr;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+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 static final GBeanInfo GBEAN_INFO;
+
+    private final Log log = LogFactory.getLog(JAXRGBean.class);
+
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(JAXRGBean.class,
+                NameFactory.JAXR_CONNECTION_FACTORY);
+
+        infoFactory.addOperation("$getResource");
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+
+    /**
+     *  Returns a fresh, new implementation of javax.xml.registry.ConnectionFactory
+     *
+     * @return
+     */
+    public Object $getResource() {
+
+        try {
+            return ConnectionFactory.newInstance();
+        }
+        catch(JAXRException e) {
+            log.error("Error creating ConnectionFactory", e);
+        }
+
+        return null;
+    }
+}