geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment EARContext.java
Date Wed, 26 May 2004 21:12:08 GMT
dain        2004/05/26 14:12:08

  Modified:    modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment
                        EARContext.java
  Log:
  getApplicationObjectName will return null if the application name is "null"
  which means that there is no application and this is a standalone module
  
  Revision  Changes    Path
  1.3       +21 -12    incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
  
  Index: EARContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EARContext.java	26 May 2004 03:20:49 -0000	1.2
  +++ EARContext.java	26 May 2004 21:12:08 -0000	1.3
  @@ -46,6 +46,10 @@
           super(jos, id, parentID, kernel);
           this.j2eeDomainName = j2eeDomainName;
           this.j2eeServerName = j2eeServerName;
  +
  +        if (j2eeApplicationName == null) {
  +            j2eeApplicationName = "null";
  +        }
           this.j2eeApplicationName = j2eeApplicationName;
   
           Properties domainNameProps = new Properties();
  @@ -65,16 +69,21 @@
           } catch (MalformedObjectNameException e) {
               throw new DeploymentException("Unable to construct J2EEServer ObjectName",
e);
           }
  -        
  -        Properties applicationNameProps = new Properties();
  -        applicationNameProps.put("j2eeType", "J2EEApplication");
  -        applicationNameProps.put("name", j2eeApplicationName);
  -        applicationNameProps.put("J2EEServer", j2eeServerName);
  -        try {
  -            applicationObjectName = new ObjectName(j2eeDomainName, applicationNameProps);
  -        } catch (MalformedObjectNameException e) {
  -            throw new DeploymentException("Unable to construct J2EEApplication ObjectName",
e);
  +
  +        if (!j2eeApplicationName.equals("null")) {
  +            Properties applicationNameProps = new Properties();
  +            applicationNameProps.put("j2eeType", "J2EEApplication");
  +            applicationNameProps.put("name", j2eeApplicationName);
  +            applicationNameProps.put("J2EEServer", j2eeServerName);
  +            try {
  +                applicationObjectName = new ObjectName(j2eeDomainName, applicationNameProps);
  +            } catch (MalformedObjectNameException e) {
  +                throw new DeploymentException("Unable to construct J2EEApplication ObjectName",
e);
  +            }
  +        } else {
  +            applicationObjectName = null;
           }
  +
       }
   
       public String getJ2EEDomainName() {
  @@ -129,12 +138,12 @@
       }
   
       public Object getEJBRef(URI module, String ejbLink) throws DeploymentException {
  -        String name = ejbLink.substring(ejbLink.lastIndexOf('#')+1);
  +        String name = ejbLink.substring(ejbLink.lastIndexOf('#') + 1);
           return getRef(module, ejbLink, (Map) ejbRefs.get(name));
       }
   
       public Object getEJBLocalRef(URI module, String ejbLink) throws DeploymentException
{
  -        String name = ejbLink.substring(ejbLink.lastIndexOf('#')+1);
  +        String name = ejbLink.substring(ejbLink.lastIndexOf('#') + 1);
           return getRef(module, ejbLink, (Map) ejbLocalRefs.get(name));
       }
   
  
  
  

Mime
View raw message