geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r157487 - in geronimo/trunk/modules: client-builder/src/java/org/apache/geronimo/client/builder/ connector-builder/src/test/org/apache/geronimo/connector/deployment/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/ jetty-builder/src/test/org/apache/geronimo/jetty/deployment/ naming-builder/src/java/org/apache/geronimo/naming/deployment/ naming/src/java/org/apache/geronimo/naming/java/ naming/src/java/org/apache/geronimo/naming/reference/
Date Tue, 15 Mar 2005 00:06:06 GMT
Author: dain
Date: Mon Mar 14 16:06:01 2005
New Revision: 157487

URL: http://svn.apache.org/viewcvs?view=rev&rev=157487
Log:
Bind ORB to java:comp/ORB

Added:
    geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/ORBReference.java
Modified:
    geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
    geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
    geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
    geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/SimpleReference.java

Modified: geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?view=diff&r1=157486&r2=157487
==============================================================================
--- geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Mon Mar 14 16:06:01 2005
@@ -346,7 +346,7 @@
                             connectionTrackerObjectName,
                             null,
                             null,
-                            RefContext.derivedClientRefContext(earContext.getRefContext(),
ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder));
+                            null, RefContext.derivedClientRefContext(earContext.getRefContext(),
ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder));
                 } catch (Exception e) {
                     throw new DeploymentException("Could not create a deployment context
for the app client", e);
                 }

Modified: geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?view=diff&r1=157486&r2=157487
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
Mon Mar 14 16:06:01 2005
@@ -73,7 +73,6 @@
 import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
-import org.apache.geronimo.xbeans.j2ee.ServiceRefHandlerType;
 import org.tranql.sql.jdbc.JDBCUtil;
 
 /**
@@ -94,22 +93,22 @@
                     return false;
                 }
 
-                public URL getURL(URI uri) throws MalformedURLException {
+                public URL getURL(URI uri) {
                     return null;
                 }
             };
 
     private EJBReferenceBuilder ejbReferenceBuilder = new EJBReferenceBuilder() {
 
-        public Reference createEJBLocalReference(String objectName, boolean isSession, String
localHome, String local) throws DeploymentException {
+        public Reference createEJBLocalReference(String objectName, boolean isSession, String
localHome, String local) {
             return null;
         }
 
-        public Reference createEJBRemoteReference(String objectName, boolean isSession, String
home, String remote) throws DeploymentException {
+        public Reference createEJBRemoteReference(String objectName, boolean isSession, String
home, String remote) {
             return null;
         }
 
-        public Reference createCORBAReference(URI corbaURL, String objectName, ObjectName
containerName, String home) throws DeploymentException {
+        public Reference createCORBAReference(URI corbaURL, String objectName, ObjectName
containerName, String home) {
             return null;
         }
 
@@ -120,31 +119,31 @@
 
     private ResourceReferenceBuilder resourceReferenceBuilder = new ResourceReferenceBuilder()
{
 
-        public Reference createResourceRef(String containerId, Class iface) throws DeploymentException
{
+        public Reference createResourceRef(String containerId, Class iface)  {
             return null;
         }
 
-        public Reference createAdminObjectRef(String containerId, Class iface) throws DeploymentException
{
+        public Reference createAdminObjectRef(String containerId, Class iface)  {
             return null;
         }
 
-        public ObjectName locateResourceName(ObjectName query) throws DeploymentException
{
+        public ObjectName locateResourceName(ObjectName query)  {
             return null;
         }
 
-        public GBeanData locateActivationSpecInfo(ObjectName resourceAdapterName, String
messageListenerInterface) throws DeploymentException {
+        public GBeanData locateActivationSpecInfo(ObjectName resourceAdapterName, String
messageListenerInterface)  {
             return null;
         }
 
-        public GBeanData locateResourceAdapterGBeanData(ObjectName resourceAdapterModuleName)
throws DeploymentException {
+        public GBeanData locateResourceAdapterGBeanData(ObjectName resourceAdapterModuleName)
 {
             return null;
         }
 
-        public GBeanData locateAdminObjectInfo(ObjectName resourceAdapterModuleName, String
adminObjectInterfaceName) throws DeploymentException {
+        public GBeanData locateAdminObjectInfo(ObjectName resourceAdapterModuleName, String
adminObjectInterfaceName)  {
             return null;
         }
 
-        public GBeanData locateConnectionFactoryInfo(ObjectName resourceAdapterModuleName,
String connectionFactoryInterfaceName) throws DeploymentException {
+        public GBeanData locateConnectionFactoryInfo(ObjectName resourceAdapterModuleName,
String connectionFactoryInterfaceName) {
             return null;
         }
     };
@@ -168,7 +167,7 @@
             kernel.startGBean(store.getName());
 
             rarFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear-noger.ear"));
-            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, null,
connectionTrackerName, null, null, null, null, ejbReferenceBuilder, null, new ConnectorModuleBuilder(defaultParentId,
defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes,
defaultXATransactionCaching, defaultXAThreadCaching, repository, kernel), resourceReferenceBuilder,
null, serviceReferenceBuilder, kernel);
+            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, null,
connectionTrackerName, null, null, null, null, null, ejbReferenceBuilder, null, new ConnectorModuleBuilder(defaultParentId,
defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes,
defaultXATransactionCaching, defaultXAThreadCaching, repository, kernel), resourceReferenceBuilder,
null, serviceReferenceBuilder, kernel);
             File tempDir = null;
             try {
                 tempDir = DeploymentUtil.createTempDir();
@@ -332,7 +331,7 @@
                         connectionTrackerName,
                         null,
                         null,
-                        new RefContext(ejbReferenceBuilder,
+                        null, new RefContext(ejbReferenceBuilder,
                                 moduleBuilder,
                                 serviceReferenceBuilder, kernel));
 

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?view=diff&r1=157486&r2=157487
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Mon Mar 14 16:06:01 2005
@@ -83,9 +83,10 @@
     private final ObjectName connectionTrackerObjectName;
     private final ObjectName transactionalTimerObjectName;
     private final ObjectName nonTransactionalTimerObjectName;
+    private final ObjectName corbaGBeanObjectName;
 
 
-    public EARConfigBuilder(URI defaultParentId, ObjectName transactionContextManagerObjectName,
ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName
nonTransactionalTimerObjectName, Repository repository, ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder
ejbReferenceBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder,
ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder appClientConfigBuilder, ServiceReferenceBuilder
serviceReferenceBuilder, Kernel kernel) {
+    public EARConfigBuilder(URI defaultParentId, ObjectName transactionContextManagerObjectName,
ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName
nonTransactionalTimerObjectName, ObjectName corbaGBeanObjectName, Repository repository, ModuleBuilder
ejbConfigBuilder, EJBReferenceBuilder ejbReferenceBuilder, ModuleBuilder webConfigBuilder,
ModuleBuilder connectorConfigBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder
appClientConfigBuilder, ServiceReferenceBuilder serviceReferenceBuilder, Kernel kernel) {
         this.kernel = kernel;
         this.repository = repository;
         this.defaultParentId = defaultParentId;
@@ -101,6 +102,7 @@
         this.connectionTrackerObjectName = connectionTrackerObjectName;
         this.transactionalTimerObjectName = transactionalTimerObjectName;
         this.nonTransactionalTimerObjectName = nonTransactionalTimerObjectName;
+        this.corbaGBeanObjectName = corbaGBeanObjectName;
     }
 
     public Object getDeploymentPlan(File planFile, JarFile jarFile) throws DeploymentException
{
@@ -286,6 +288,7 @@
                         connectionTrackerObjectName,
                         transactionalTimerObjectName,
                         nonTransactionalTimerObjectName,
+                        corbaGBeanObjectName,
                         new RefContext(ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder,
kernel));
             } catch (MalformedObjectNameException e) {
                 throw new DeploymentException(e);
@@ -528,6 +531,7 @@
         infoFactory.addAttribute("connectionTrackerObjectName", ObjectName.class, true);
         infoFactory.addAttribute("transactionalTimerObjectName", ObjectName.class, true);
         infoFactory.addAttribute("nonTransactionalTimerObjectName", ObjectName.class, true);
+        infoFactory.addAttribute("corbaGBeanObjectName", ObjectName.class, true);
 
         infoFactory.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addReference("EJBConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
@@ -548,6 +552,7 @@
             "connectionTrackerObjectName",
             "transactionalTimerObjectName",
             "nonTransactionalTimerObjectName",
+            "corbaGBeanObjectName",
             "Repository",
             "EJBConfigBuilder",
             "EJBReferenceBuilder",

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java?view=diff&r1=157486&r2=157487
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
Mon Mar 14 16:06:01 2005
@@ -43,10 +43,12 @@
     private final ObjectName transactedTimerName;
     private final ObjectName nonTransactedTimerName;
 
+    private final ObjectName corbaGBeanObjectName;
+
     private final RefContext refContext;
     private final J2eeContext j2eeContext;
 
-    public EARContext(File baseDir, URI id, ConfigurationModuleType moduleType, URI parentID,
Kernel kernel, String j2eeApplicationName, ObjectName transactionContextManagerObjectName,
ObjectName connectionTrackerObjectName, ObjectName transactedTimerName, ObjectName nonTransactedTimerName,
RefContext refContext) throws MalformedObjectNameException, DeploymentException {
+    public EARContext(File baseDir, URI id, ConfigurationModuleType moduleType, URI parentID,
Kernel kernel, String j2eeApplicationName, ObjectName transactionContextManagerObjectName,
ObjectName connectionTrackerObjectName, ObjectName transactedTimerName, ObjectName nonTransactedTimerName,
ObjectName corbaGBeanObjectName, RefContext refContext) throws MalformedObjectNameException,
DeploymentException {
         super(baseDir, id, moduleType, parentID, kernel);
         j2eeContext = new J2eeContextImpl(getDomain(), getServer(), j2eeApplicationName ==
null ? NameFactory.NULL : j2eeApplicationName, NameFactory.J2EE_MODULE, NameFactory.NULL,
null, null);
         domainObjectName = NameFactory.getDomainName(null, j2eeContext);
@@ -62,6 +64,7 @@
         this.connectionTrackerObjectName = connectionTrackerObjectName;
         this.transactedTimerName = transactedTimerName;
         this.nonTransactedTimerName = nonTransactedTimerName;
+        this.corbaGBeanObjectName = corbaGBeanObjectName;
         this.refContext = refContext;
     }
 
@@ -103,6 +106,10 @@
 
     public ObjectName getNonTransactedTimerName() {
         return nonTransactedTimerName;
+    }
+
+    public ObjectName getCORBAGBeanObjectName() {
+        return corbaGBeanObjectName;
     }
 
     public RefContext getRefContext() {

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?view=diff&r1=157486&r2=157487
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
Mon Mar 14 16:06:01 2005
@@ -64,7 +64,7 @@
     private static ServiceReferenceBuilder serviceReferenceBuilder = new ServiceReferenceBuilder()
{
 
         //it could return a Service or a Reference, we don't care
-        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
+        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) {
             return null;
         }
     };
@@ -240,7 +240,7 @@
         kernel.loadGBean(store, this.getClass().getClassLoader());
         kernel.startGBean(store.getName());
 
-        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder,
appClientConfigBuilder, serviceReferenceBuilder, kernel);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder,
resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, kernel);
 
 
         File tempDir = null;
@@ -255,7 +255,7 @@
     }
 
     public void testNoEJBDeployer() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, null, null, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder,
serviceReferenceBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, null, null, null, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder,
appClientConfigBuilder, serviceReferenceBuilder, null);
 
         File tempDir = null;
         try {
@@ -271,7 +271,7 @@
     }
 
     public void testNoWARDeployer() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, null, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder,
serviceReferenceBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, null, ejbConfigBuilder, null, null, connectorConfigBuilder, resourceReferenceBuilder,
appClientConfigBuilder, serviceReferenceBuilder, null);
 
         File tempDir = null;
         try {
@@ -287,7 +287,7 @@
     }
 
     public void testNoConnectorDeployer() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, webConfigBuilder, null, resourceReferenceBuilder, appClientConfigBuilder,
serviceReferenceBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, null, ejbConfigBuilder, null, webConfigBuilder, null, resourceReferenceBuilder, appClientConfigBuilder,
serviceReferenceBuilder, null);
 
         File tempDir = null;
         try {

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?view=diff&r1=157486&r2=157487
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Mon Mar 14 16:06:01 2005
@@ -149,7 +149,7 @@
                 ctcName,
                 null,
                 null,
-                new RefContext(new EJBReferenceBuilder() {
+                null, new RefContext(new EJBReferenceBuilder() {
 
                     public Reference createEJBLocalReference(String objectName, boolean isSession,
String localHome, String local) throws DeploymentException {
                         return null;

Modified: geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?view=diff&r1=157486&r2=157487
==============================================================================
--- geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
(original)
+++ geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Mon Mar 14 16:06:01 2005
@@ -644,6 +644,11 @@
             builder.addUserTransaction(userTransaction);
         }
 
+        ObjectName corbaGBean = earContext.getCORBAGBeanObjectName();
+        if (corbaGBean != null) {
+            builder.addORB(corbaGBean);
+        }
+
         Object handleDelegateReference = earContext.getRefContext().getHandleDelegateReference();
         if (handleDelegateReference != null) {
             builder.addHandleDelegateReference(handleDelegateReference);

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java?view=diff&r1=157486&r2=157487
==============================================================================
--- 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
Mon Mar 14 16:06:01 2005
@@ -27,6 +27,7 @@
 import org.apache.geronimo.kernel.ClassLoading;
 import org.apache.geronimo.naming.reference.GBeanProxyReference;
 import org.apache.geronimo.naming.reference.KernelReference;
+import org.apache.geronimo.naming.reference.ORBReference;
 
 /**
  * TODO consider removing this class. The only purpose is to slightly hide the internalBind
method.
@@ -43,6 +44,10 @@
 
     public void addUserTransaction(UserTransaction userTransaction) {
         context.put("UserTransaction", userTransaction);
+    }
+
+    public void addORB(ObjectName corbaGBeanObjectName) {
+        context.put("ORB", new ORBReference(corbaGBeanObjectName));
     }
 
     public void addHandleDelegateReference(Object handleDelegateReference) {

Added: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/ORBReference.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/ORBReference.java?view=auto&rev=157487
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/ORBReference.java
(added)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/ORBReference.java
Mon Mar 14 16:06:01 2005
@@ -0,0 +1,47 @@
+/**
+ *
+ * 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.reference;
+
+import javax.management.ObjectName;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+
+import org.apache.geronimo.kernel.Kernel;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ORBReference extends SimpleAwareReference {
+    private final ObjectName corbaGBean;
+
+    public ORBReference(ObjectName corbaGBean) {
+        this.corbaGBean = corbaGBean;
+    }
+
+    public String getClassName() {
+        return "org.omg.CORBA.ORB";
+    }
+
+    public Object getContent() throws NamingException {
+        Kernel kernel = getKernel();
+        try {
+            return kernel.getAttribute(corbaGBean, "ORB");
+        } catch (Exception e) {
+            throw (NameNotFoundException) new NameNotFoundException("Error getting ORB attribut
from CORBAGBean: objectName=" + corbaGBean).initCause(e);
+        }
+    }
+}

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/SimpleReference.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/SimpleReference.java?view=diff&r1=157486&r2=157487
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/SimpleReference.java
(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/SimpleReference.java
Mon Mar 14 16:06:01 2005
@@ -23,6 +23,7 @@
 import javax.naming.Name;
 import javax.naming.RefAddr;
 import javax.naming.Reference;
+import javax.naming.NamingException;
 import javax.naming.spi.ObjectFactory;
 
 /**
@@ -47,7 +48,7 @@
      * Gets the actual referenced Object.
      * @return the referenced object
      */
-    public abstract Object getContent();
+    public abstract Object getContent() throws NamingException;
 
     /**
      * We will atleast return an Object.  Subclasses may want to provide a more specific
class.



Mime
View raw message