geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r292663 - /geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Date Fri, 30 Sep 2005 07:46:52 GMT
Author: djencks
Date: Fri Sep 30 00:46:49 2005
New Revision: 292663

URL: http://svn.apache.org/viewcvs?rev=292663&view=rev
Log:
GERONIMO-1034 If corba info is supplied, use it instead of ejb-link

Modified:
    geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java

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?rev=292663&r1=292662&r2=292663&view=diff
==============================================================================
--- 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
Fri Sep 30 00:46:49 2005
@@ -398,64 +398,66 @@
 
                 String ejbLink = null;
                 GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
-                if (remoteRef != null && remoteRef.isSetEjbLink()) {
-                    ejbLink = remoteRef.getEjbLink();
-                } else if (ejbRef.isSetEjbLink()) {
-                    ejbLink = getStringValue(ejbRef.getEjbLink());
-                }
+                if (remoteRef.isSetNsCorbaloc()) {
+                    try {
+                        ObjectName cssBean;
+                        if (remoteRef.isSetCssName()) {
+                            cssBean = ObjectName.getInstance(getStringValue(remoteRef.getCssName()));
+                        } else if (remoteRef.isSetCssLink()) {
+                            String cssLink = remoteRef.getCssLink().trim();
+                            //TODO is this correct?
+                            String moduleType = null;
+                            cssBean = refContext.locateComponentName(cssLink, moduleURI,
moduleType, NameFactory.CORBA_CSS, earContext.getJ2eeContext(), earContext, "css gbean");
+                        } else {
+                            GerCssType css = remoteRef.getCss();
+                            cssBean = NameFactory.getComponentName(getStringValue(css.getDomain()),
+                                    getStringValue(css.getServer()),
+                                    getStringValue(css.getApplication()),
+                                    getStringValue(css.getModule()),
+                                    getStringValue(css.getName()),
+                                    getStringValue(NameFactory.CORBA_CSS),
+                                    earContext.getJ2eeContext());
+                        }
+                        ejbReference = refContext.getCORBARemoteRef(new URI(getStringValue(remoteRef.getNsCorbaloc())),
+                                getStringValue(remoteRef.getName()),
+                                ObjectName.getInstance(cssBean),
+                                home);
+                    } catch (URISyntaxException e) {
+                        throw new DeploymentException("Could not construct CORBA NameServer
URI: " + remoteRef.getNsCorbaloc(), e);
+                    } catch (MalformedObjectNameException e) {
+                        throw new DeploymentException("Could not construct CSS container
name: " + remoteRef.getCssName(), e);
+                    }
+                } else {
+                    if (remoteRef != null && remoteRef.isSetEjbLink()) {
+                        ejbLink = remoteRef.getEjbLink();
+                    } else if (ejbRef.isSetEjbLink()) {
+                        ejbLink = getStringValue(ejbRef.getEjbLink());
+                    }
 
-                if (ejbLink != null) {
-                    ejbReference = refContext.getEJBRemoteRef(moduleURI, ejbLink, isSession,
home, remote, ejbContext);
-                } else if (remoteRef != null) {
-                    if (remoteRef.isSetTargetName()) {
-                        ejbReference = refContext.getEJBRemoteRef(getStringValue(remoteRef.getTargetName()),
isSession, home, remote);
-                    } else if (remoteRef.isSetNsCorbaloc()) {
-                        try {
-                            ObjectName cssBean;
-                            if (remoteRef.isSetCssName()) {
-                                cssBean = ObjectName.getInstance(getStringValue(remoteRef.getCssName()));
-                            } else if (remoteRef.isSetCssLink()) {
-                                String cssLink = remoteRef.getCssLink().trim();
-                                //TODO is this correct?
-                                String moduleType = null;
-                                cssBean = refContext.locateComponentName(cssLink, moduleURI,
moduleType, NameFactory.CORBA_CSS, earContext.getJ2eeContext(), earContext, "css gbean");
-                            } else {
-                                GerCssType css = remoteRef.getCss();
-                                cssBean = NameFactory.getComponentName(getStringValue(css.getDomain()),
-                                        getStringValue(css.getServer()),
-                                        getStringValue(css.getApplication()),
-                                        getStringValue(css.getModule()),
-                                        getStringValue(css.getName()),
-                                        getStringValue(NameFactory.CORBA_CSS),
-                                        earContext.getJ2eeContext());
+                    if (ejbLink != null) {
+                        ejbReference = refContext.getEJBRemoteRef(moduleURI, ejbLink, isSession,
home, remote, ejbContext);
+                    } else if (remoteRef != null) {
+                        if (remoteRef.isSetTargetName()) {
+                            ejbReference = refContext.getEJBRemoteRef(getStringValue(remoteRef.getTargetName()),
isSession, home, remote);
+                        } else {
+                            String containerId = null;
+                            try {
+                                containerId = NameFactory.getEjbComponentNameString(getStringValue(remoteRef.getDomain()),
+                                        getStringValue(remoteRef.getServer()),
+                                        getStringValue(remoteRef.getApplication()),
+                                        getStringValue(remoteRef.getModule()),
+                                        getStringValue(remoteRef.getName()),
+                                        getStringValue(remoteRef.getType()),
+                                        j2eeContext);
+                            } catch (MalformedObjectNameException e) {
+                                throw new DeploymentException("Could not construct ejb object
name: " + remoteRef.getName(), e);
                             }
-                            ejbReference = refContext.getCORBARemoteRef(new URI(getStringValue(remoteRef.getNsCorbaloc())),
-                                    getStringValue(remoteRef.getName()),
-                                    ObjectName.getInstance(cssBean),
-                                    home);
-                        } catch (URISyntaxException e) {
-                            throw new DeploymentException("Could not construct CORBA NameServer
URI: " + remoteRef.getNsCorbaloc(), e);
-                        } catch (MalformedObjectNameException e) {
-                            throw new DeploymentException("Could not construct CSS container
name: " + remoteRef.getCssName(), e);
+                            ejbReference = refContext.getEJBRemoteRef(containerId, isSession,
home, remote);
+
                         }
                     } else {
-                        String containerId = null;
-                        try {
-                            containerId = NameFactory.getEjbComponentNameString(getStringValue(remoteRef.getDomain()),
-                                    getStringValue(remoteRef.getServer()),
-                                    getStringValue(remoteRef.getApplication()),
-                                    getStringValue(remoteRef.getModule()),
-                                    getStringValue(remoteRef.getName()),
-                                    getStringValue(remoteRef.getType()),
-                                    j2eeContext);
-                        } catch (MalformedObjectNameException e) {
-                            throw new DeploymentException("Could not construct ejb object
name: " + remoteRef.getName(), e);
-                        }
-                        ejbReference = refContext.getEJBRemoteRef(containerId, isSession,
home, remote);
-
+                        ejbReference = refContext.getImplicitEJBRemoteRef(moduleURI, ejbRefName,
isSession, home, remote, ejbContext);
                     }
-                } else {
-                    ejbReference = refContext.getImplicitEJBRemoteRef(moduleURI, ejbRefName,
isSession, home, remote, ejbContext);
                 }
             }
             builder.bind(ejbRefName, ejbReference);
@@ -514,7 +516,7 @@
         }
     }
 
-    //TODO current implementation does not deal with portComponentRef links.
+//TODO current implementation does not deal with portComponentRef links.
     static void addServiceRefs(EARContext earContext, Module module, ServiceRefType[] serviceRefs,
Map serviceRefMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException
{
 
         RefContext refContext = earContext.getRefContext();
@@ -572,7 +574,7 @@
             ServiceRefHandlerType[] handlers = serviceRef.getHandlerArray();
             List handlerInfos = buildHandlerInfoList(handlers, cl);
 
-            //we could get a Reference or the actual serializable Service back.
+//we could get a Reference or the actual serializable Service back.
             Object ref = refContext.getServiceReference(serviceInterface, wsdlURI, jaxrpcMappingURI,
serviceQName, portComponentRefMap, handlerInfos, serviceRefType, earContext, module, cl);
             builder.bind(name, ref);
         }
@@ -754,16 +756,16 @@
             ejbContext = earContext;
         }
 
-        // ejb-ref
+// ejb-ref
         addEJBRefs(earContext, ejbContext, refContext, moduleURI, ejbRefs, mapEjbRefs(gerEjbRefs),
cl, builder);
 
-        // ejb-local-ref
+// ejb-local-ref
         addEJBLocalRefs(ejbContext, refContext, moduleURI, ejbLocalRefs, mapEjbLocalRefs(gerEjbLocalRef),
cl, builder);
 
-        // resource-ref
+// resource-ref
         addResourceRefs(earContext, moduleURI, resourceRefs, mapResourceRefs(gerResourceRef),
cl, builder);
 
-        // resource-env-ref
+// resource-env-ref
         addResourceEnvRefs(earContext, resourceEnvRefs, mapResourceEnvRefs(gerResourceEnvRef),
cl, builder);
 
         addMessageDestinationRefs(earContext.getRefContext(), earContext, messageDestinationRefs,
cl, builder);



Mime
View raw message