geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r158814 [2/9] - in geronimo/trunk/modules: assembly/ assembly/src/plan/ interop/ interop/src/idl/ interop/src/java/org/apache/geronimo/interop/ interop/src/java/org/apache/geronimo/interop/CosNaming/iiop_stubs/ interop/src/java/org/apache/geronimo/interop/adapter/ interop/src/java/org/apache/geronimo/interop/client/ interop/src/java/org/apache/geronimo/interop/generator/ interop/src/java/org/apache/geronimo/interop/naming/ interop/src/java/org/apache/geronimo/interop/properties/ interop/src/java/org/apache/geronimo/interop/repository/ interop/src/java/org/apache/geronimo/interop/rmi/iiop/ interop/src/java/org/apache/geronimo/interop/rmi/iiop/client/ interop/src/java/org/apache/geronimo/interop/rmi/iiop/compiler/ interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/ interop/src/java/org/apache/geronimo/interop/server/ interop/src/java/org/apache/geronimo/interop/util/
Date Wed, 23 Mar 2005 17:56:59 GMT
Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/CosNaming/iiop_stubs/NamingContext_Stub.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/CosNaming/iiop_stubs/NamingContext_Stub.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/CosNaming/iiop_stubs/NamingContext_Stub.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/CosNaming/iiop_stubs/NamingContext_Stub.java Wed Mar 23 09:56:34 2005
@@ -1,392 +0,0 @@
-/**
- *
- *  Copyright 2004-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.interop.CosNaming.iiop_stubs;
-
-import org.apache.geronimo.interop.rmi.iiop.ObjectRef;
-
-
-public class NamingContext_Stub
-        extends ObjectRef
-        implements org.apache.geronimo.interop.CosNaming.NamingContext {
-    // 
-    // Fields
-    // 
-    public java.lang.String[] _ids = {"org.apache.geronimo.interop.CosNaming.NamingContext", "RMI:org.apache.geronimo.interop.CosNaming.NamingContext:0000000000000000"};
-    private static final org.apache.geronimo.interop.rmi.iiop.ValueType vt$0 = org.apache.geronimo.interop.rmi.iiop.ValueType.getInstance(java.lang.String.class);
-    private static final org.apache.geronimo.interop.rmi.iiop.ValueType vt$1 = org.apache.geronimo.interop.rmi.iiop.ValueType.getInstance(org.apache.geronimo.interop.CosNaming.BindingListHolder.class);
-    private static final org.apache.geronimo.interop.rmi.iiop.ValueType vt$2 = org.apache.geronimo.interop.rmi.iiop.ValueType.getInstance(org.apache.geronimo.interop.CosNaming.BindingIteratorHolder.class);
-    private static final org.apache.geronimo.interop.rmi.iiop.ValueType vt$3 = org.apache.geronimo.interop.rmi.iiop.ValueType.getInstance(org.apache.geronimo.interop.CosNaming.NameComponent[].class);
-    private static final org.apache.geronimo.interop.rmi.iiop.ValueType vt$4 = org.apache.geronimo.interop.rmi.iiop.ValueType.getInstance(org.omg.CORBA.Object.class);
-    private static final org.apache.geronimo.interop.rmi.iiop.ValueType vt$5 = org.apache.geronimo.interop.rmi.iiop.ValueType.getInstance(org.apache.geronimo.interop.CosNaming.NamingContext.class);
-
-    //
-    // Constructors
-    // 
-    public NamingContext_Stub() {
-        super();
-    }
-    
-    // 
-    // Methods
-    // 
-    
-    public boolean _is_a(java.lang.String id) {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                boolean $rc;
-                org.apache.geronimo.interop.rmi.iiop.ObjectInputStream $in;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $out.writeObject(vt$0, id);
-                $conn.invoke(this, "_is_a", $key, $retry);
-                $in = $conn.getSimpleInputStream();
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-                $rc = $in.readBoolean();
-                return $rc;
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-
-    public void list(int p0, org.apache.geronimo.interop.CosNaming.BindingListHolder p1, org.apache.geronimo.interop.CosNaming.BindingIteratorHolder p2) {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $out.writeInt(p0);
-                $out.writeObject(vt$1, p1);
-                $out.writeObject(vt$2, p2);
-                $conn.invoke(this, "list", $key, $retry);
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-
-    public org.omg.CORBA.Object resolve(org.apache.geronimo.interop.CosNaming.NameComponent[] p0) throws org.apache.geronimo.interop.CosNaming.NamingContextPackage.NotFound, org.apache.geronimo.interop.CosNaming.NamingContextPackage.CannotProceed, org.apache.geronimo.interop.CosNaming.NamingContextPackage.InvalidName {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                org.omg.CORBA.Object $rc;
-                org.apache.geronimo.interop.rmi.iiop.ObjectInputStream $in;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $out.writeObject(vt$3, p0);
-                $conn.invoke(this, "resolve", $key, $retry);
-                $in = $conn.getSimpleInputStream();
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-                $rc = (org.omg.CORBA.Object) $in.readObject(vt$4);
-                return $rc;
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-
-    public void bind(org.apache.geronimo.interop.CosNaming.NameComponent[] p0, org.omg.CORBA.Object p1) throws org.apache.geronimo.interop.CosNaming.NamingContextPackage.NotFound, org.apache.geronimo.interop.CosNaming.NamingContextPackage.CannotProceed, org.apache.geronimo.interop.CosNaming.NamingContextPackage.InvalidName, org.apache.geronimo.interop.CosNaming.NamingContextPackage.AlreadyBound {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $out.writeObject(vt$3, p0);
-                $out.writeObject(vt$4, p1);
-                $conn.invoke(this, "bind", $key, $retry);
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-
-    public void bind_context(org.apache.geronimo.interop.CosNaming.NameComponent[] p0, org.apache.geronimo.interop.CosNaming.NamingContext p1) throws org.apache.geronimo.interop.CosNaming.NamingContextPackage.NotFound, org.apache.geronimo.interop.CosNaming.NamingContextPackage.CannotProceed, org.apache.geronimo.interop.CosNaming.NamingContextPackage.InvalidName, org.apache.geronimo.interop.CosNaming.NamingContextPackage.AlreadyBound {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $out.writeObject(vt$3, p0);
-                $out.writeObject(vt$5, p1);
-                $conn.invoke(this, "bind_context", $key, $retry);
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-
-    public void rebind(org.apache.geronimo.interop.CosNaming.NameComponent[] p0, org.omg.CORBA.Object p1) throws org.apache.geronimo.interop.CosNaming.NamingContextPackage.NotFound, org.apache.geronimo.interop.CosNaming.NamingContextPackage.CannotProceed, org.apache.geronimo.interop.CosNaming.NamingContextPackage.InvalidName {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $out.writeObject(vt$3, p0);
-                $out.writeObject(vt$4, p1);
-                $conn.invoke(this, "rebind", $key, $retry);
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-
-    public void rebind_context(org.apache.geronimo.interop.CosNaming.NameComponent[] p0, org.apache.geronimo.interop.CosNaming.NamingContext p1) throws org.apache.geronimo.interop.CosNaming.NamingContextPackage.NotFound, org.apache.geronimo.interop.CosNaming.NamingContextPackage.CannotProceed, org.apache.geronimo.interop.CosNaming.NamingContextPackage.InvalidName {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $out.writeObject(vt$3, p0);
-                $out.writeObject(vt$5, p1);
-                $conn.invoke(this, "rebind_context", $key, $retry);
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-
-    public void unbind(org.apache.geronimo.interop.CosNaming.NameComponent[] p0) throws org.apache.geronimo.interop.CosNaming.NamingContextPackage.NotFound, org.apache.geronimo.interop.CosNaming.NamingContextPackage.CannotProceed, org.apache.geronimo.interop.CosNaming.NamingContextPackage.InvalidName {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $out.writeObject(vt$3, p0);
-                $conn.invoke(this, "unbind", $key, $retry);
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-
-    public org.apache.geronimo.interop.CosNaming.NamingContext new_context() {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                org.apache.geronimo.interop.CosNaming.NamingContext $rc;
-                org.apache.geronimo.interop.rmi.iiop.ObjectInputStream $in;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $conn.invoke(this, "new_context", $key, $retry);
-                $in = $conn.getSimpleInputStream();
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-                $rc = (org.apache.geronimo.interop.CosNaming.NamingContext) $in.readObject(vt$5);
-                return $rc;
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-
-    public org.apache.geronimo.interop.CosNaming.NamingContext bind_new_context(org.apache.geronimo.interop.CosNaming.NameComponent[] p0) throws org.apache.geronimo.interop.CosNaming.NamingContextPackage.NotFound, org.apache.geronimo.interop.CosNaming.NamingContextPackage.AlreadyBound, org.apache.geronimo.interop.CosNaming.NamingContextPackage.CannotProceed, org.apache.geronimo.interop.CosNaming.NamingContextPackage.InvalidName {
-        java.lang.Object $key = $getRequestKey();
-        int $retry;
-
-        for ($retry = 0
-                ; ; $retry++
-                ) {
-
-            try {
-                org.apache.geronimo.interop.rmi.iiop.client.Connection $conn;
-                org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream $out;
-                java.lang.String $et;
-                org.apache.geronimo.interop.CosNaming.NamingContext $rc;
-                org.apache.geronimo.interop.rmi.iiop.ObjectInputStream $in;
-                $conn = this.$connect();
-                $out = $conn.getSimpleOutputStream();
-                $out.writeObject(vt$3, p0);
-                $conn.invoke(this, "bind_new_context", $key, $retry);
-                $in = $conn.getSimpleInputStream();
-                $conn.forget($key);
-                $conn.close();
-                $et = $conn.getExceptionType();
-
-                if ($et != null) {
-                    throw org.apache.geronimo.interop.rmi.iiop.SystemExceptionFactory.getException($conn.getException());
-                }
-                $rc = (org.apache.geronimo.interop.CosNaming.NamingContext) $in.readObject(vt$5);
-                return $rc;
-            } catch (org.apache.geronimo.interop.rmi.iiop.client.RetryInvokeException $ex) {
-
-                if ($retry == 3) {
-                    throw $ex.getRuntimeException();
-                }
-            }
-        }
-    }
-}

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/InteropGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/InteropGBean.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/InteropGBean.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/InteropGBean.java Wed Mar 23 09:56:34 2005
@@ -39,17 +39,17 @@
 
     private IOR ior;
 
-    private Properties properties;
-    private String strprop;
-    private String objectName;
+    private Properties  properties;
+    private String      strprop;
+    private String      name;
 
     /**
      * Construct an instance of InteropGBean
      *
      * @param strprop some strprop
      */
-    public InteropGBean(String objectName, String strprop, Properties properties) {
-        this.objectName = objectName;
+    public InteropGBean(String name, String strprop, Properties properties) {
+        this.name = name;
         this.strprop = strprop;
         this.properties = (properties == null ? new Properties() : properties);
     }
@@ -89,15 +89,15 @@
     /**
      * Returns the object name of this protocol GBean
      */
-    public String getObjectName() {
-        return objectName;
+    public String getName() {
+        return name;
     }
 
     /**
      * Add the overrides from the member variables to the properties file.
      */
     public void echo(String msg) {
-        log.info(getObjectName() + ": Echo " + msg);
+        log.info(getName() + ": Echo " + msg);
     }    
 
     /* 
@@ -105,15 +105,15 @@
      */
 
     public void doStart() throws Exception {
-        log.info("Started " + getObjectName());
+        log.info("Started " + getName());
     }
 
     public void doStop() throws Exception {
-        log.info("Stopped " + getObjectName());
+        log.info("Stopped " + getName());
     }
 
     public void doFail() {
-        log.info("Failed " + getObjectName());
+        log.info("Failed " + getName());
     }
 
     /* 
@@ -125,13 +125,13 @@
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(InteropGBean.class);
 
-        infoFactory.addAttribute("objectName", String.class, false);
+        infoFactory.addAttribute("name", String.class, true);
         infoFactory.addAttribute("strprop", String.class, true);
         infoFactory.addAttribute("properties", Properties.class, true);
 
         infoFactory.addOperation("echo", new Class[]{String.class});
 
-        infoFactory.setConstructor(new String[]{"objectName", "strprop", "properties"});
+        infoFactory.setConstructor(new String[]{"name", "strprop", "properties"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/SystemException.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/SystemException.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/SystemException.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/SystemException.java Wed Mar 23 09:56:34 2005
@@ -17,6 +17,24 @@
  */
 package org.apache.geronimo.interop;
 
+/*
+ * This class is used to help marshall server side exceptions back to the client.
+ * A server exception is caught and then set as a cause of the system exception.
+ *
+ * Originally there were two different implementations of the this cause, one for 
+ * JDK 1.3 (which didn't have the cause object on an Exception) and this one for JDK 1.4
+ * The JDK 1.3 class has been removed.
+ *
+ * In the stubs/skeletons, they check to see if the marshalled exception is an instance of
+ * SystemException and then it take appropriate actions.
+ *
+ * Its possible that this could change to use the JDK 1.4 RuntimeException.  This may 
+ * cause some troubles with identification of specific server side exceptions vs. a
+ * general runtime exception.
+ *
+ * For now, I am going to leave this class in place.  A future TODO would be to investigate
+ * this situation more carefully.
+ */
 
 public class SystemException extends RuntimeException {
     public SystemException(String message) {
@@ -34,17 +52,4 @@
                        && cause.getMessage() == null
                        ? cause.getCause() : cause);
     }
-
-    /*
-Constructor Summary 
-RuntimeException() 
-          Constructs a new runtime exception with null as its detail message. 
-RuntimeException(String message) 
-          Constructs a new runtime exception with the specified detail message. 
-RuntimeException(String message, Throwable cause) 
-          Constructs a new runtime exception with the specified detail message and cause. 
-RuntimeException(Throwable cause) 
-          Constructs a new runtime exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). 
-          */
-
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/adapter/Adapter.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/adapter/Adapter.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/adapter/Adapter.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/adapter/Adapter.java Wed Mar 23 09:56:34 2005
@@ -17,236 +17,39 @@
  */
 package org.apache.geronimo.interop.adapter;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Vector;
-
+import org.apache.geronimo.interop.rmi.iiop.ObjectRef;
 import org.apache.geronimo.interop.rmi.iiop.RemoteInterface;
+import org.openejb.EJBContainer;
 
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 
-public class Adapter {
-    //
-    // Public Accessible Properties
-    //
-    protected String _bindName;
-    protected String _remoteClassName;
-    protected String _remoteInterfaceName;
-    protected Vector _idVector;
-    protected boolean _shared;
-    protected ClassLoader _cl;
-    protected RemoteInterface _ri;
-
-    //
-    // Internal Properrties
-    //
-
-    protected Object _sharedObject;
-    protected HashMap _objects;
-    protected Class _remoteClassClass;
-    protected Class _remoteInterfaceClass;
-
-    public Adapter() {
-        _objects = new HashMap();
-        _idVector = new Vector();
-    }
-
-    /*
-     * BindName is the name that will be registered with the INS (Inter-operable Name Service)
-     */
-    public String getBindName() {
-        return _bindName;
-    }
-
-    public void setBindName(String bindName) {
-        _bindName = bindName;
-    }
-
-    /*
-     * Is this a shared component?  If so this will invoke the getInstance method on
-     * the component ...
-     */
-    public boolean isShared() {
-        return _shared;
-    }
-
-    public void setShared(boolean shared) {
-        _shared = shared;
-    }
-
-    /*
-     * The classloader that will load any dependancies of the adapter or corba skel interfaces.
-     * Its should be set by the ejb container
-     */
-    public ClassLoader getClassLoader() {
-        return _cl;
-    }
-
-    public void setClassLoader(ClassLoader cl) {
-        _cl = cl;
-    }
-
-    /*
-     * This is the name of the remote class that implements the remote interface.
-     *
-     * This is only used if this adapter is going to directly invoke an object.  For the
-     * EJB Container, the adapter will pass through the method invocations.
-     */
-    public String getRemoteClassName() {
-        return _remoteClassName;
-    }
-
-    public void setRemoteClassName(String rcName) {
-        _remoteClassName = rcName;
-    }
-
-    /*
-     * The remote interface name for the remote object.  This will most likely be the name
-     * of the EJB's RemoteInterface and RemoteHomeInterface
-     *
-     * The stub/skel generator will use this interface name.
-     */
-    public String getRemoteInterfaceName() {
-        return _remoteInterfaceName;
-    }
-
-    public void setRemoteInterfaceName(String riName) {
-        _remoteInterfaceName = riName;
-    }
-
-    /*
-     * A list of public IDs that the remote object implements:
-     *
-     * IDL:....:1.0
-     * RMI:....:X:Y
-     */
-    public Vector getIds() {
-        return _idVector;
-    }
-
-    public void addId(String id) {
-        _idVector.add(id);
-    }
-
-    public void removeId(String id) {
-        _idVector.remove(id);
-    }
-
-    /*
-     * Return the skeleton implemention for the remote interface.  This interface has the
-     * invoke method to handle the rmi/iiop messages.
-     */
-    public RemoteInterface getRemoteInterface() {
-        if (_ri == null) {
-            synchronized (this) {
-                String riName = _remoteInterfaceName + "_Skeleton";
-                _remoteInterfaceClass = loadClass(riName);
-
-                try {
-                    _ri = (RemoteInterface) _remoteInterfaceClass.newInstance();
-                } catch (InstantiationException e) {
-                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                } catch (IllegalAccessException e) {
-                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                }
-            }
-        }
-
-        return _ri;
-    }
-
-    /*
-     * Get an object instance to invoke based on the object key.
-     *
-     * The objectKey could probably be passed to the EJB container so that the
-     * container can directly invoke the ejb object as required.
-     */
-    public Object getInstance(byte[] objectKey) {
-        String key = new String(objectKey);
-        return getInstance(key);
-    }
-
-    public Object getInstance(String key) {
-        Object o = _objects.get(key);
-
-        if (o == null) {
-            o = newInstance(key);
-        }
-
-        return o;
-    }
-
-    public Object newInstance(byte[] objectKey) {
-        String key = new String(objectKey);
-        return newInstance(key);
-    }
+public abstract class Adapter
+{
+    public abstract Object getAdapterID();
+    public abstract String[] getBindNames();
 
-    public Object newInstance(String key) {
-        Object o = null;
+    public abstract void start();
+    public abstract void stop();
 
-        if (_remoteClassClass == null) {
-            synchronized (this) {
-                _remoteClassClass = loadClass(_remoteClassName);
-            }
-
-            try {
-                if (_shared) {
-                    synchronized (this) {
-                        Method m = _remoteClassClass.getMethod("getInstance", (Class[]) null);
-                        o = m.invoke(_remoteClassClass, (Object[]) null);
-
-                        if (o != null) {
-                            _objects.put(key, o);
-                        }
-                    }
-                } else {
-                    o = _remoteClassClass.newInstance();
-                    _objects.put(key, o);
-                }
-            } catch (InstantiationException e) {
-                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-            } catch (NoSuchMethodException e) {
-                e.printStackTrace();
-            } catch (InvocationTargetException e) {
-                e.printStackTrace();
-            }
-        }
+    public abstract ObjectRef getObjectRef();
 
-        return o;
-    }
+    public abstract Object getServant();
+    public abstract EJBContainer getEJBContainer();
+    public abstract Object getEJBHome();
 
-    /*
-     * Invoke method from the IIOP Message Handler.  The adapter is bound to the INS name service.
-     * When an RMI/IIOP message is processed by the server, the message handler will perform a lookup
-     * on the name service to get the Adapter, then the invocation will be passed to the adapter
-     * The adapter will obtain the object key and then determine which object instance to pass the
-     * invocation to.
-     */
-    public void invoke(java.lang.String methodName, byte[] objectKey, org.apache.geronimo.interop.rmi.iiop.ObjectInputStream input, org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream output) {
-        RemoteInterface skeleton = getRemoteInterface();
-        Object instance = getInstance(objectKey);
-
-        if (instance != null) {
-            skeleton.$invoke(methodName, objectKey, instance, input, output);
-        } else {
-            throw new org.omg.CORBA.OBJECT_NOT_EXIST(new String(objectKey));
-        }
-    }
+    public abstract void invoke(java.lang.String methodName, byte[] objectKey, org.apache.geronimo.interop.rmi.iiop.ObjectInputStream input, org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream output);
 
-    /*
-     * Helper function to load a class.  This uses classloader for the adapter.
-     */
-    protected Class loadClass(String name) {
-        Class c = null;
 
+    protected Class loadClass( String className, ClassLoader cl )
+    {
+        Class rc = null;
         try {
-            c = _cl.loadClass(name);
-        } catch (Exception e) {
-            e.printStackTrace();
+            rc = cl.loadClass(className);
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();  
         }
-
-        return c;
+        return rc;
     }
+
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/adapter/AdapterManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/adapter/AdapterManager.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/adapter/AdapterManager.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/adapter/AdapterManager.java Wed Mar 23 09:56:34 2005
@@ -17,27 +17,176 @@
  */
 package org.apache.geronimo.interop.adapter;
 
-import java.util.Hashtable;
+import org.openejb.EJBContainer;
+import org.openejb.EJBComponentType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.gbean.*;
+import org.apache.geronimo.interop.naming.NameService;
+
+import java.util.HashMap;
+import java.util.Collection;
+import java.util.Collections;
+
+public class AdapterManager implements ReferenceCollectionListener {
+
+    private final Log       log = LogFactory.getLog(AdapterManager.class);
+    private HashMap         homeAdapters;
+    private HashMap         remoteAdapters;
+    private Collection      containers = Collections.EMPTY_SET;
+    private ClassLoader     classLoader;
+
+    private NameService     nameService = NameService.getInstance();
+
+    /*
+     * This is a singleton GBean.  Do not reference it directly, but use a
+     * GBean reference to get it.
+     */
+    public AdapterManager()
+    {
+        this.homeAdapters = null;
+        this.remoteAdapters = null;
+        this.containers = null;
+        this.classLoader = null;
+    }
+
+    public AdapterManager( ClassLoader classLoader, Collection containers ) {
+        log.debug( "AdapterManager(): containers = " + containers );
+
+        this.classLoader = classLoader;
+
+        ReferenceCollection ref = (ReferenceCollection) containers;
+        ref.addReferenceCollectionListener(this);
+
+        this.containers = containers;
+
+        int len = ( containers != null ? containers.size() : 20 );
+        homeAdapters = new HashMap( len );
+        remoteAdapters = new HashMap( len );
+
+        // Todo: Add the containers .. invoke memberAdded for each element in containers.
+
+        registerNameServer();
+    }
+
+    protected void registerNameServer()
+    {
+        //
+        // NameService
+        //
+
+        String bindNames[] = new String[] { "NameService" };
+        String remoteClassName = "org.apache.geronimo.interop.rmi.iiop.server.ServerNamingContext";
+        //String remoteInterfaceName = "org.apache.geronimo.interop.rmi.iiop.NameService";
+        String remoteInterfaceName = "org.apache.geronimo.interop.CosNaming.NamingContext";
+        String ids[] = new String[] { "IDL:omg.org/CosNaming/NamingContext:1.0",
+                                      "IDL:omg.org/CosNaming/NamingContextExt:1.0" };                                      
+        ClassLoader cl = this.getClass().getClassLoader();
+
+        CorbaAdapter a = new CorbaAdapter( bindNames, ids, remoteClassName, remoteInterfaceName, cl );
+        a.start();
+        registerRemoteAdapter(a);
+    }
+
+    protected Adapter getAdapter( Object adapterID ) {
+        // more likely to be using the remoteadapter...
+        Adapter rc = getRemoteAdapter( adapterID );
+        if (rc == null)
+        {
+            rc = getHomeAdapter( adapterID );
+        }
+        return rc;
+    }
+
+    protected Adapter getHomeAdapter( Object adapterID )
+    {
+        return (Adapter)homeAdapters.get( adapterID );
+    }
 
+    protected Adapter getRemoteAdapter( Object adapterID )
+    {
+        return (Adapter)remoteAdapters.get( adapterID );
+    }
+
+    protected void registerHomeAdapter( Adapter adapter )
+    {
+        homeAdapters.put( adapter.getAdapterID(), adapter );
+    }
+
+    protected void registerRemoteAdapter( Adapter adapter )
+    {
+        remoteAdapters.put( adapter.getAdapterID(), adapter );
+    }
 
-public class AdapterManager {
-    protected Hashtable _adapters;
-    protected static AdapterManager _me = new AdapterManager();
+    protected void unregisterHomeAdapter( Adapter adapter )
+    {
+        homeAdapters.remove( adapter.getAdapterID() );
+    }
 
-    protected AdapterManager() {
-        _adapters = new Hashtable();
+    protected void unregisterRemoteAdapter( Adapter adapter )
+    {
+        remoteAdapters.remove( adapter.getAdapterID() );
     }
 
-    public static AdapterManager getInstance() {
-        return _me;
+    public void memberAdded(ReferenceCollectionEvent event) {
+        EJBContainer container = (EJBContainer) event.getMember();
+
+        log.debug( "AdapterManager.memberAdded(): container = " + container );
+        log.debug( "AdapterManager.memberAdded(): containerID = " + container.getContainerID() );
+
+        switch (container.getProxyInfo().getComponentType()) {
+            case EJBComponentType.STATELESS:
+                //generator = new AdapterStateless(container, orb, poa, tieLoader);
+                break;
+            case EJBComponentType.STATEFUL:
+                //generator = new AdapterStateful(container, orb, poa, tieLoader);
+                break;
+            case EJBComponentType.BMP_ENTITY:
+            case EJBComponentType.CMP_ENTITY:
+                //generator = new AdapterEntity(container, orb, poa, tieLoader);
+                break;
+            default:
+                // throw new CORBAException("CORBA HomeAdapter does not handle MDB containers");
+        }
+
+        Adapter adapter = new HomeAdapter( container );
+        adapter.start();
+        registerHomeAdapter( adapter );
+
+        adapter = new RemoteAdapter( container );
+        adapter.start();
+        registerRemoteAdapter( adapter );
     }
 
-    public void registerAdapter(Adapter a) {
+    public void memberRemoved(ReferenceCollectionEvent event) {
+        EJBContainer container = (EJBContainer) event.getMember();
+
+        log.debug( "AdapterManager.memberRemoved(): container = " + container );
+        log.debug( "AdapterManager.memberRemoved(): containerID = " + container.getContainerID() );
+
+        Adapter adapter = getHomeAdapter( container.getContainerID() );
+        adapter.stop();
+        unregisterHomeAdapter( adapter );
+
+        adapter = getRemoteAdapter( container.getContainerID() );
+        adapter.stop();
+        unregisterRemoteAdapter( adapter );
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(AdapterManager.class);
+
+        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
+        infoFactory.addReference("containers", EJBContainer.class);
+
+        infoFactory.setConstructor(new String[]{"classLoader", "containers"});
 
-        _adapters.put(a.getBindName(), a);
+        GBEAN_INFO = infoFactory.getBeanInfo();
     }
 
-    public Adapter getAdapter(String objectName) {
-        return (Adapter) _adapters.get(objectName);
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/client/InitialContextFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/client/InitialContextFactory.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/client/InitialContextFactory.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/client/InitialContextFactory.java Wed Mar 23 09:56:34 2005
@@ -21,10 +21,9 @@
 import javax.naming.Context;
 import javax.naming.NamingException;
 
-
 public class InitialContextFactory
         implements javax.naming.spi.InitialContextFactory {
-    private HashMap _startMap = new HashMap();
+    private HashMap     startMap = new HashMap();
 
     public Context getInitialContext(java.util.Hashtable env) throws NamingException {
         return org.apache.geronimo.interop.rmi.iiop.client.ClientNamingContext.getInstance(env);

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/CodeWriter.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/CodeWriter.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/CodeWriter.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/CodeWriter.java Wed Mar 23 09:56:34 2005
@@ -19,43 +19,41 @@
 
 import java.io.File;
 
-
 public abstract class CodeWriter {
-    protected GenOptions _genOptions;
-
-    protected File _file;
+    private GenOptions  genOptions;    
+    private String      fileName;
+    private String      fileExt = ".java";
 
-    protected String _fileName;
-    protected String _fileExt = ".java";
+    protected File        file;
 
     public CodeWriter(GenOptions genOptions, String fileName, String ext) {
-        _genOptions = genOptions;
-        _fileName = fileName;
-        _fileExt = ext;
+        this.genOptions = genOptions;
+        this.fileName = fileName;
+        fileExt = ext;
     }
 
     public GenOptions getGenOptions() {
-        return _genOptions;
+        return genOptions;
     }
 
     public void setGenOptions(GenOptions genOptions) {
-        _genOptions = genOptions;
+        this.genOptions = genOptions;
     }
 
     public void setFileName(String val) {
-        _fileName = val;
+        fileName = val;
     }
 
     public String getFileName() {
-        return _fileName;
+        return fileName;
     }
 
     public void setFileExt(String val) {
-        _fileExt = val;
+        fileExt = val;
     }
 
     public String getFileExt() {
-        return _fileExt;
+        return fileExt;
     }
 
     public abstract void openFile() throws GenException;

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/GenException.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/GenException.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/GenException.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/GenException.java Wed Mar 23 09:56:34 2005
@@ -17,12 +17,6 @@
  */
 package org.apache.geronimo.interop.generator;
 
-/**
- * User: Mark
- * Date: Dec 21, 2004
- * Time: 3:49:45 PM
- */
-
 public class GenException
         extends Exception {
     public GenException() {

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/GenOptions.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/GenOptions.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/GenOptions.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/GenOptions.java Wed Mar 23 09:56:34 2005
@@ -17,42 +17,134 @@
  */
 package org.apache.geronimo.interop.generator;
 
-public class GenOptions {
-    protected String _genDir = "./";
-    protected boolean _overwrite = false;
-    protected boolean _verbose = false;
+import org.apache.geronimo.interop.rmi.iiop.compiler.StubCompiler;
 
-    public GenOptions() {
-    }
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Iterator;
 
-    public GenOptions(String genDir, boolean overwrite, boolean verbose) {
-        _genDir = genDir;
-        _overwrite = overwrite;
-        _verbose = verbose;
+public class GenOptions {
+    // -gs  genSrcDir
+    // -gc  genClassDir
+    // -o   overwrite
+    // -v   verbose
+    // -s   simpleidl
+    // -cp  classpath
+    // -g   generate
+    // -c   compile
+    // -cd  compiledebug
+    // -lc  loadclass
+
+    private String      genSrcDir = "./src";
+    private String      genClassDir = "./classes";
+    private boolean     overwrite = false;
+    private boolean     verbose = false;
+    private boolean     simpleidl = false;
+    private String      classpath = "";
+    private boolean     generate = true;
+    private boolean     compile = false;
+    private boolean     compileDebug = false;
+    private boolean     loadclass = false;
+
+    private List        interfaces = new LinkedList();
+
+    public GenOptions( String defaultSrcDir, String args[] )
+        throws GenWarning, GenException {
+        genSrcDir = defaultSrcDir;
+        parseOptions( args );
     }
 
-    public String getGenDir() {
-        return _genDir;
+    public String getGenSrcDir() {
+        return genSrcDir;
     }
 
-    public void setGenDir(String genDir) {
-        _genDir = genDir;
+    public String getGenClassDir() {
+        return genClassDir;
     }
 
     public boolean isOverwrite() {
-        return _overwrite;
-    }
-
-    public void setOverwrite(boolean overwrite) {
-        _overwrite = overwrite;
+        return overwrite;
     }
 
     public boolean isVerbose() {
-        return _verbose;
+        return verbose;
     }
 
-    public void setVerbose(boolean verbose) {
-        _verbose = verbose;
+    public boolean isSimpleIdl() {
+        return simpleidl;
     }
 
+    public String getClasspath() {
+        return classpath;
+    }
+
+    public boolean isGenerate() {
+        return generate;
+    }
+
+    public boolean isCompile() {
+        return compile;
+    }
+
+    public boolean isCompileDebug() {
+        return compileDebug;
+    }
+
+    public boolean isLoadclass() {
+        return loadclass;
+    }
+
+    public List getInterfaces() {
+        return interfaces;
+    }
+
+    protected void parseOptions(String args[]) throws GenException, GenWarning {
+        GenWarning genWarning = null;
+
+        for (int i = 0; i < args.length; i++) {
+            if (args[i].equals("-g")) {
+                generate = true;
+            } else if (args[i].equals("-c")) {
+                compile = true;
+            } else if (args[i].equals("-cd")) {
+                compileDebug = true;
+            } else if (args[i].equals("-l")) {
+                loadclass = true;
+            } else if (args[i].equals("-s")) {
+                simpleidl = true;
+            } else if (args[i].equals("-gs")) {
+                if ((i + 1) < args.length) {
+                    genSrcDir = args[++i];
+                } else {
+                    throw new GenException( "-gs requires an source output diretory." );
+                }
+            } else if (args[i].equals("-cp")) {
+                if ((i + 1) < args.length) {
+                    classpath = args[++i];
+                } else {
+                    throw new GenException( "-cp requires a classpath directory." );
+                }
+            } else if (args[i].equals("-gc")) {
+                if ((i + 1) < args.length) {
+                    genClassDir = args[++i];
+                } else {
+                    throw new GenException( "-gc requires an class output diretory." );
+                }
+            } else if (args[i].equals("-v")) {
+                verbose = true;
+            } else if (args[i].equals("-o")) {
+                overwrite = true;
+            } else if (args[i].startsWith("-")) {
+                String msg = "Ignoring unrecognized options: '" + args[i] + "'";
+                if (genWarning != null) {
+                    // just a cheap way of chaining the warnings...
+                    genWarning = new GenWarning( msg, genWarning);
+                } else {
+                    genWarning = new GenWarning( msg );
+                }
+            } else {
+                interfaces.add(args[i]);
+            }
+        }
+    }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JBlockStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JBlockStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JBlockStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JBlockStatement.java Wed Mar 23 09:56:34 2005
@@ -19,22 +19,21 @@
 
 import java.util.Vector;
 
-
 public class JBlockStatement extends JStatement {
-    protected Vector _localVars;
-    protected Vector _statements;
+    private Vector    localVars;
+    private Vector    statements;
 
     public JBlockStatement() {
-        _localVars = new Vector();
-        _statements = new Vector();
+        localVars = new Vector();
+        statements = new Vector();
     }
 
     public boolean hasVariables() {
-        return _localVars.size() > 0;
+        return localVars.size() > 0;
     }
 
     public boolean hasStatements() {
-        return _statements.size() > 0;
+        return statements.size() > 0;
     }
 
     public JLocalVariable newLocalVariable(Class type, String name) {
@@ -46,26 +45,26 @@
 
         v.setInitExpression(initExpr);
 
-        _localVars.add(v);
+        localVars.add(v);
 
         return v;
     }
 
     public void deleteLocalVariable(JLocalVariable f) {
-        _localVars.remove(f);
+        localVars.remove(f);
     }
 
     public Vector getLocalVariables() {
-        return _localVars;
+        return localVars;
     }
 
     public void addStatement(JStatement s) {
         if (s != this) {
-            _statements.add(s);
+            statements.add(s);
         }
     }
 
     public Vector getStatements() {
-        return _statements;
+        return statements;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCaseStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCaseStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCaseStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCaseStatement.java Wed Mar 23 09:56:34 2005
@@ -17,33 +17,30 @@
  */
 package org.apache.geronimo.interop.generator;
 
-
-
-
 public class JCaseStatement extends JStatement {
-    protected JExpression _expr;
-    protected JBlockStatement _statements;
+    private JExpression       expr;
+    private JBlockStatement   statements;
 
     public JCaseStatement(JExpression e) {
         super();
 
-        _expr = e;
-        _statements = new JBlockStatement();
+        expr = e;
+        statements = new JBlockStatement();
     }
 
     public void setExpression(JExpression e) {
-        _expr = e;
+        expr = e;
     }
 
     public JExpression getExpression() {
-        return _expr;
+        return expr;
     }
 
     public void addStatement(JStatement s) {
-        _statements.addStatement(s);
+        statements.addStatement(s);
     }
 
     public JBlockStatement getStatement() {
-        return _statements;
+        return statements;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCatchStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCatchStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCatchStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCatchStatement.java Wed Mar 23 09:56:34 2005
@@ -18,19 +18,19 @@
 package org.apache.geronimo.interop.generator;
 
 public class JCatchStatement extends JBlockStatement {
-    protected JVariable _var;
+    private JVariable     var;
 
     public JCatchStatement(JVariable v) {
         super();
-        _var = v;
+        var = v;
     }
 
     public JVariable getVariable() {
-        return _var;
+        return var;
     }
 
     public int hashCode() {
-        return _var.hashCode();
+        return var.hashCode();
     }
 
     public boolean equals(Object other) {
@@ -41,13 +41,13 @@
         } else if (other instanceof JCatchStatement) {
             JCatchStatement cs = (JCatchStatement) other;
 
-            if (cs._var.getType().equals(_var.getType())) {
+            if (cs.var.getType().equals(var.getType())) {
                 rc = true;
             }
         } else if (other instanceof JVariable) {
             JVariable v = (JVariable) other;
 
-            if (v.getType().equals(_var.getType())) {
+            if (v.getType().equals(var.getType())) {
                 rc = true;
             }
         }
@@ -56,69 +56,3 @@
         return rc;
     }
 }
-
-/*
-public class JCatchStatement extends JStatement
-{
-    protected JVariable          _var;
-    protected JBlockStatement    _statements;
-
-    public JCatchStatement( JVariable v )
-    {
-        _var = v;
-        _statements = new JBlockStatement();
-    }
-
-    public void addStatement( JStatement s )
-    {
-        _statements.addStatement( s );
-    }
-
-    public JBlockStatement getStatement()
-    {
-        return _statements;
-    }
-
-    public JVariable getVariable()
-    {
-        return _var;
-    }
-
-    public int hashCode()
-    {
-        return _var.hashCode();
-    }
-
-    public boolean equals( Object other )
-    {
-        boolean rc = false;
-
-        if (this == other)
-        {
-            rc = true;
-        }
-        else if (other instanceof JCatchStatement)
-        {
-            JCatchStatement cs = (JCatchStatement)other;
-
-            if (cs._var.getType().equals(_var.getType()))
-            {
-                rc = true;
-            }
-        }
-        else if (other instanceof JVariable)
-        {
-            JVariable v = (JVariable)other;
-
-            if (v.getType().equals( _var.getType() ))
-            {
-                rc = true;
-            }
-        }
-
-
-        return rc;
-    }
-}
-
-*/
\ No newline at end of file

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JClass.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JClass.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JClass.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JClass.java Wed Mar 23 09:56:34 2005
@@ -20,31 +20,27 @@
 import java.lang.reflect.Modifier;
 import java.util.Vector;
 
-
 public class JClass extends JEntity {
-    protected JPackage _pkg;
-
-    protected Vector _imports;
-    protected Vector _implements;
-    protected String _baseClassName;
-
-    protected Vector _constructors;
-    protected Vector _methods;
-    protected Vector _fields;
-
-    protected Vector _classes = new Vector();
-    protected JClass _parent;
+    private JPackage      pkg;
+    private Vector        imports;
+    private Vector        impls;
+    private String        baseClassName;
+    private Vector        constructors;
+    private Vector        methods;
+    private Vector        fields;
+    private Vector        classes = new Vector();
+    private JClass        parent;
 
     protected JClass(String name) {
         super(name, Modifier.PUBLIC);
 
-        _imports = new Vector();
-        _implements = new Vector();
-        _baseClassName = "";
-
-        _constructors = new Vector();
-        _methods = new Vector();
-        _fields = new Vector();
+        imports = new Vector();
+        impls = new Vector();
+        baseClassName = "";
+
+        constructors = new Vector();
+        methods = new Vector();
+        fields = new Vector();
     }
 
     protected JClass(String name, JPackage pkg) {
@@ -54,63 +50,43 @@
             pkg = new JPackage("");
         }
 
-        _pkg = pkg;
+        this.pkg = pkg;
     }
 
     protected JClass(String name, JClass parent) {
         this(name);
 
-        _parent = parent;
+        this.parent = parent;
     }
 
     public JConstructor newConstructor(JParameter parms[], Class thrown[]) {
         JConstructor c = new JConstructor(parms, thrown);
         c.setParent(this);
-        _constructors.add(c);
+        constructors.add(c);
         return c;
     }
 
-    /*
-    public JConstructor newConstructor( JParameter parms[], String thrown[] )
-    {
-        JConstructor c = new JConstructor( parms, thrown );
-        c.setParent( this );
-        _constructors.add( c );
-        return c;
-    }
-    */
-
     public void deleteConstructor(JConstructor m) {
-        _constructors.removeElement(m);
+        constructors.removeElement(m);
     }
 
     public Vector getConstructors() {
-        return _constructors;
+        return constructors;
     }
 
     public JMethod newMethod(JReturnType rt, String name, JParameter parms[], Class thrown[]) {
         JMethod m = new JMethod(rt, name, parms, thrown);
         m.setParent(this);
-        _methods.add(m);
-        return m;
-    }
-
-    /*
-    public JMethod newMethod( JReturnType rt, String name, JParameter parms[], String thrown[] )
-    {
-        JMethod m = new JMethod( rt, name, parms, thrown );
-        m.setParent( this );
-        _methods.add( m );
+        methods.add(m);
         return m;
     }
-    */
 
     public void deleteMethod(JMethod m) {
-        _methods.removeElement(m);
+        methods.removeElement(m);
     }
 
     public Vector getMethods() {
-        return _methods;
+        return methods;
     }
 
     protected void setFieldParentAndModifier(JField f) {
@@ -143,36 +119,36 @@
         setFieldParentAndModifier(f);
         f.setInitExpression(initExpr);
 
-        _fields.add(f);
+        fields.add(f);
 
         return f;
     }
 
     public void deleteField(JField f) {
-        _fields.remove(f);
+        fields.remove(f);
     }
 
     public Vector getFields() {
-        return _fields;
+        return fields;
     }
 
     public JClass newClass(String name) {
         JClass c = new JClass(name, this);
-        _classes.add(c);
+        classes.add(c);
         return c;
     }
 
     public JPackage getPackage() {
-        if (_parent != null) {
-            return _parent.getPackage();
+        if (parent != null) {
+            return parent.getPackage();
         } else {
-            return _pkg;
+            return pkg;
         }
     }
 
     public String getName() {
-        if (_parent != null) {
-            return _parent.getName() + "$" + super.getName();
+        if (parent != null) {
+            return parent.getName() + "$" + super.getName();
         } else {
             return super.getName();
         }
@@ -187,23 +163,23 @@
     }
 
     public void setBaseClassName(String bcl) {
-        _baseClassName = bcl;
+        baseClassName = bcl;
     }
 
     public String getBaseClassName() {
-        return _baseClassName;
+        return baseClassName;
     }
 
     public void addImplements(String className) {
-        _implements.add(className);
+        impls.add(className);
     }
 
     public void removeImplements(String className) {
-        _implements.remove(className);
+        impls.remove(className);
     }
 
     public Vector getImplements() {
-        return _implements;
+        return impls;
     }
 
     /*
@@ -226,7 +202,7 @@
     }
 
     public void addImport(String fqName) {
-        _imports.add(fqName);
+        imports.add(fqName);
     }
 
     public void removeImport(Package pkg, String itemName) {
@@ -246,10 +222,10 @@
     }
 
     public void removeImport(String name) {
-        _imports.remove(name);
+        imports.remove(name);
     }
 
     public Vector getImports() {
-        return _imports;
+        return imports;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCodeStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCodeStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCodeStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JCodeStatement.java Wed Mar 23 09:56:34 2005
@@ -17,17 +17,14 @@
  */
 package org.apache.geronimo.interop.generator;
 
-
-
-
 public class JCodeStatement extends JStatement {
-    protected String _code;
+    private String    code;
 
     public JCodeStatement(String code) {
-        _code = code;
+        this.code = code;
     }
 
     public String getCode() {
-        return _code;
+        return code;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JConstructor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JConstructor.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JConstructor.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JConstructor.java Wed Mar 23 09:56:34 2005
@@ -17,9 +17,6 @@
  */
 package org.apache.geronimo.interop.generator;
 
-
-
-
 public class JConstructor extends JMethod {
     protected JConstructor(String name) {
         super(name);
@@ -28,11 +25,4 @@
     protected JConstructor(JParameter parms[], Class thrown[]) {
         super((JReturnType) null, (String) null, parms, thrown);
     }
-
-    /*
-    protected JConstructor( JParameter parms[], String thrownType[] )
-    {
-        super( (JReturnType)null, (String)null, parms, thrownType );
-    }
-    */
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JDeclareStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JDeclareStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JDeclareStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JDeclareStatement.java Wed Mar 23 09:56:34 2005
@@ -18,31 +18,31 @@
 package org.apache.geronimo.interop.generator;
 
 public class JDeclareStatement extends JStatement {
-    protected JVariable _v;
-    protected JExpression _initExpr;
+    private JVariable         v;
+    private JExpression       initExpr;
 
     public JDeclareStatement(JVariable v) {
         this(v, null);
     }
 
     public JDeclareStatement(JVariable v, JExpression initExpr) {
-        _v = v;
-        _initExpr = initExpr;
+        this.v = v;
+        this.initExpr = initExpr;
     }
 
     public void setVariable(JVariable s) {
-        _v = s;
+        v = s;
     }
 
     public JVariable getVariable() {
-        return _v;
+        return v;
     }
 
     public void setInitExpression(JExpression initExpr) {
-        _initExpr = initExpr;
+        this.initExpr = initExpr;
     }
 
     public JExpression getInitExpression() {
-        return _initExpr;
+        return initExpr;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JEntity.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JEntity.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JEntity.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JEntity.java Wed Mar 23 09:56:34 2005
@@ -17,55 +17,72 @@
  */
 package org.apache.geronimo.interop.generator;
 
+import java.lang.reflect.Modifier;
+
 public class JEntity {
-    protected String _name;
-    protected int _modifiers;
-    protected JEntity _parent;
+    private String    name;
+    private int       modifiers;
+    private JEntity   parent;
 
     public JEntity(String name) {
-        this(name, 0);
+        this(name, Modifier.PUBLIC);
     }
 
     public JEntity(String name, int modifiers) {
-        _name = name;
-        _modifiers = modifiers;
+        this.name = name;
+        this.modifiers = modifiers;
     }
 
     public JEntity getParent() {
-        return _parent;
+        return parent;
     }
 
     public void setParent(JEntity parent) {
-        _parent = parent;
+        this.parent = parent;
     }
 
     public String getName() {
-        return _name;
+        return name;
     }
 
     public void setName(String val) {
-        _name = val;
+        name = val;
     }
 
     /*
      * if value is true, then the modifier will be set,
      * if value is false, then the modifier will be unset.
      */
-    public void setModifier(int modifier, boolean value) {
+    protected void adjustModifier(int modifier, boolean value) {
         if (value) {
-            _modifiers = (_modifiers | modifier);
+            modifiers = (modifiers | modifier);
         } else {
-            if ((_modifiers & modifier) == modifier) {
-                _modifiers = (_modifiers ^ modifier);
+            if ((modifiers & modifier) == modifier) {
+                modifiers = (modifiers ^ modifier);
             }
         }
     }
 
+    public void setModifier( int modifier )
+    {
+        adjustModifier( modifier, true );
+    }
+
+    public void unsetModifier( int modifier )
+    {
+        adjustModifier( modifier, false );
+    }
+
+    /*
+     * Sets all the modifiers in one set
+     *
+     * Example: setModifiers(Modifier.PRIVATE | Modifier.STATIC | Modifier.FINAL);
+     */
     public void setModifiers(int modifiers) {
-        _modifiers = modifiers;
+        this.modifiers = modifiers;
     }
 
     public int getModifiers() {
-        return _modifiers;
+        return modifiers;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JExpression.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JExpression.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JExpression.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JExpression.java Wed Mar 23 09:56:34 2005
@@ -18,17 +18,17 @@
 package org.apache.geronimo.interop.generator;
 
 public class JExpression extends JStatement {
-    protected JStatement _statement;
+    private JStatement    statement;
 
     public JExpression(JStatement s) {
-        _statement = s;
+        statement = s;
     }
 
     public void setStatement(JStatement s) {
-        _statement = s;
+        statement = s;
     }
 
     public JStatement getStatement() {
-        return _statement;
+        return statement;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JFinallyStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JFinallyStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JFinallyStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JFinallyStatement.java Wed Mar 23 09:56:34 2005
@@ -17,27 +17,24 @@
  */
 package org.apache.geronimo.interop.generator;
 
-
-
-
 public class JFinallyStatement extends JStatement {
-    protected JBlockStatement _finallyStatements;
-    protected boolean _hasStatements = false;
+    private JBlockStatement   finallyStatements;
+    private boolean           hasStatements = false;
 
     public JFinallyStatement() {
-        _finallyStatements = new JBlockStatement();
+        finallyStatements = new JBlockStatement();
     }
 
     public void addStatement(JStatement s) {
-        _finallyStatements.addStatement(s);
-        _hasStatements = true;
+        finallyStatements.addStatement(s);
+        hasStatements = true;
     }
 
     public JBlockStatement getStatement() {
-        return _finallyStatements;
+        return finallyStatements;
     }
 
     public boolean hasStatements() {
-        return _hasStatements;
+        return hasStatements;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JForStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JForStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JForStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JForStatement.java Wed Mar 23 09:56:34 2005
@@ -17,30 +17,27 @@
  */
 package org.apache.geronimo.interop.generator;
 
-
-
-
 public class JForStatement extends JBlockStatement {
-    protected JStatement _initStmt;
-    protected JExpression _loopExpr;
-    protected JStatement _iterStmt;
+    private JStatement    initStmt;
+    private JExpression   loopExpr;
+    private JStatement    iterStmt;
 
     public JForStatement(JStatement init, JExpression loop, JStatement iter) {
         super();
-        _initStmt = init;
-        _loopExpr = loop;
-        _iterStmt = iter;
+        initStmt = init;
+        loopExpr = loop;
+        iterStmt = iter;
     }
 
     public JStatement getInitStatement() {
-        return _initStmt;
+        return initStmt;
     }
 
     public JExpression getLoopExpression() {
-        return _loopExpr;
+        return loopExpr;
     }
 
     public JStatement getIterStatement() {
-        return _iterStmt;
+        return iterStmt;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JIfElseIfElseStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JIfElseIfElseStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JIfElseIfElseStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JIfElseIfElseStatement.java Wed Mar 23 09:56:34 2005
@@ -19,48 +19,47 @@
 
 import java.util.Vector;
 
-
 public class JIfElseIfElseStatement extends JStatement {
-    protected JIfStatement _ifStatement;
-    protected Vector _elseifStatements;
-    protected JElseStatement _elseStatement;
+    private JIfStatement      ifStatement;
+    private Vector            elseifStatements;
+    private JElseStatement    elseStatement;
 
     public JIfElseIfElseStatement(JExpression if_expr) {
-        _ifStatement = new JIfStatement(if_expr);
-        _elseifStatements = new Vector();
-        _elseStatement = new JElseStatement();
+        ifStatement = new JIfStatement(if_expr);
+        elseifStatements = new Vector();
+        elseStatement = new JElseStatement();
     }
 
     public void addIfStatement(JStatement s) {
-        _ifStatement.addStatement(s);
+        ifStatement.addStatement(s);
     }
 
     public JIfStatement getIfStatement() {
-        return _ifStatement;
+        return ifStatement;
     }
 
     public Vector getIfStatements() {
-        return _ifStatement.getStatements();
+        return ifStatement.getStatements();
     }
 
     public void addElseStatement(JStatement s) {
-        _elseStatement.addStatement(s);
+        elseStatement.addStatement(s);
     }
 
     public JElseStatement getElseStatement() {
-        return _elseStatement;
+        return elseStatement;
     }
 
     public Vector getElseStatements() {
-        return _elseStatement.getStatements();
+        return elseStatement.getStatements();
     }
 
     public JElseIfStatement getElseIf(JExpression e) {
         JElseIfStatement rc = null;
-        int index = _elseifStatements.indexOf(e);
+        int index = elseifStatements.indexOf(e);
 
         if (index >= 0) {
-            rc = (JElseIfStatement) _elseifStatements.get(index);
+            rc = (JElseIfStatement) elseifStatements.get(index);
         }
 
         return rc;
@@ -71,7 +70,7 @@
 
         if (rc == null) {
             rc = new JElseIfStatement(e);
-            _elseifStatements.add(rc);
+            elseifStatements.add(rc);
         }
 
         return rc;
@@ -88,6 +87,6 @@
     }
 
     public Vector getElseIfs() {
-        return _elseifStatements;
+        return elseifStatements;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JIfStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JIfStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JIfStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JIfStatement.java Wed Mar 23 09:56:34 2005
@@ -18,19 +18,19 @@
 package org.apache.geronimo.interop.generator;
 
 public class JIfStatement extends JBlockStatement {
-    protected JExpression _expr;
+    private JExpression   expr;
 
     public JIfStatement(JExpression e) {
         super();
-        _expr = e;
+        expr = e;
     }
 
     public JExpression getExpression() {
-        return _expr;
+        return expr;
     }
 
     public int hashCode() {
-        return _expr.hashCode();
+        return expr.hashCode();
     }
 
     public boolean equals(Object other) {
@@ -41,7 +41,7 @@
         } else if (other instanceof JIfStatement) {
             JIfStatement is = (JIfStatement) other;
 
-            if (is._expr == _expr) {
+            if (is.expr == expr) {
                 // Todo: Need equals()
                 rc = true;
             }
@@ -49,4 +49,4 @@
 
         return rc;
     }
-}
\ No newline at end of file
+}

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JMethod.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JMethod.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JMethod.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JMethod.java Wed Mar 23 09:56:34 2005
@@ -20,22 +20,19 @@
 import java.lang.reflect.Modifier;
 import java.util.Vector;
 
-
 public class JMethod extends JEntity {
-    protected JReturnType _rt;
-    protected JParameter _parms[];
-    protected Class _thrown[];
-
-    protected Vector _statements;
-    protected JBlockStatement _bodyBlockStatement;
-
-    protected String _body;  // Yuck
+    private JReturnType       rt;
+    private JParameter        parms[];
+    private Class             thrown[];
+    private Vector            statements;
+    private JBlockStatement   bodyBlockStatement;
+    private String            body;  // Yuck
 
     protected JMethod(String name) {
         super(name, Modifier.PUBLIC);
 
-        _statements = new Vector();
-        _bodyBlockStatement = new JBlockStatement();
+        statements = new Vector();
+        bodyBlockStatement = new JBlockStatement();
     }
 
     protected JMethod(JReturnType rt, String name, JParameter parms[], Class thrown[]) {
@@ -47,87 +44,58 @@
     }
 
     public void setRT(JReturnType jt) {
-        _rt = jt;
+        rt = jt;
     }
 
     public JReturnType getRT() {
-        return _rt;
+        return rt;
     }
 
     public void setParms(JParameter parms[]) {
-        _parms = parms;
+        this.parms = parms;
     }
 
     public JParameter[] getParms() {
-        return _parms;
+        return parms;
     }
 
     public void setThrown(Class thrown[]) {
-        _thrown = thrown;
-
-        /*
-        if (_thrown != null)
-        {
-            _thrownType = new String[_thrown.length];
-            int i;
-            for( i=0; i<_thrown.length; i++ )
-            {
-                _thrownType[i] = _thrown[i].getName();
-            }
-        }
-        else
-        {
-            _thrownType = null;
-        }
-        */
+        this.thrown = thrown;
     }
 
     public Class[] getThrown() {
-        return _thrown;
-    }
-
-    /*
-    public void setThrownType( String thrownType[] )
-    {
-        _thrownType = thrownType;
-        _thrown = null;
-    }
-
-    public String[] getThrownType()
-    {
-        return _thrownType;
+        return thrown;
     }
-    */
 
     public void setBody(String body) {
-        _body = body;
+        this.body = body;
     }
 
     public String getBody() {
-        return _body;
+        return body;
     }
 
     public JLocalVariable newLocalVariable(Class type, String name) {
-        return _bodyBlockStatement.newLocalVariable(type, name);
+        return bodyBlockStatement.newLocalVariable(type, name);
     }
 
     public JLocalVariable newLocalVariable(Class type, String name, JExpression initExpr) {
-        return _bodyBlockStatement.newLocalVariable(type, name, initExpr);
+        return bodyBlockStatement.newLocalVariable(type, name, initExpr);
     }
 
     public void deleteLocalVariable(JLocalVariable f) {
-        _bodyBlockStatement.deleteLocalVariable(f);
+        bodyBlockStatement.deleteLocalVariable(f);
     }
 
     public Vector getLocalVariables() {
-        return _bodyBlockStatement.getLocalVariables();
+        return bodyBlockStatement.getLocalVariables();
     }
 
     public void addStatement(JStatement s) {
-        _statements.add(s);
+        statements.add(s);
     }
 
     public Vector getStatements() {
-        return _statements;
+        return statements;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JPackage.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JPackage.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JPackage.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JPackage.java Wed Mar 23 09:56:34 2005
@@ -19,9 +19,8 @@
 
 import java.util.Vector;
 
-
 public class JPackage extends JEntity {
-    protected Vector _classes = new Vector();
+    private Vector    classes = new Vector();
 
     public JPackage(String name) {
         super(name);
@@ -29,15 +28,15 @@
 
     public JClass newClass(String name) {
         JClass c = new JClass(name, this);
-        _classes.add(c);
+        classes.add(c);
         return c;
     }
 
     public void deleteClass(JClass c) {
-        _classes.removeElement(c);
+        classes.removeElement(c);
     }
 
     public Vector getClasses() {
-        return _classes;
+        return classes;
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JReturnType.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JReturnType.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JReturnType.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JReturnType.java Wed Mar 23 09:56:34 2005
@@ -17,73 +17,9 @@
  */
 package org.apache.geronimo.interop.generator;
 
-public class JReturnType {
-    protected Class _type;
-    protected String _typeName;
-    protected boolean _isArray;
+public class JReturnType extends JType {
 
     public JReturnType(Class type) {
-        this(type, false);
-    }
-
-    public JReturnType(Class type, boolean isArray) {
-        _type = type;
-        _typeName = type.getName();
-        _isArray = isArray;
-    }
-
-    public JReturnType(String typeName) {
-        this(typeName, false);
-    }
-
-    public JReturnType(String typeName, boolean isArray) {
-        _typeName = typeName;
-        _isArray = isArray;
-
-        try {
-            _type = Class.forName(_typeName);
-        } catch (Exception e) {
-            // Ignore;
-        }
-    }
-
-    public void setType(Class type) {
-        _type = type;
-        _typeName = type.getName();
-    }
-
-    public Class getType() {
-        return _type;
-    }
-
-    public void setTypeName(String typeName) {
-        _type = null;
-        _typeName = typeName;
-    }
-
-    public String getTypeName() {
-        return _typeName;
-    }
-
-    public boolean isArray() {
-        return _isArray;
-    }
-
-    public int hashCode() {
-        return _type.hashCode();
-    }
-
-    public boolean equals(Object other) {
-        boolean rc = false;
-
-        if (other == this) {
-            rc = true;
-        } else if (other instanceof org.apache.geronimo.interop.generator.JReturnType) {
-            org.apache.geronimo.interop.generator.JReturnType jr = (org.apache.geronimo.interop.generator.JReturnType) other;
-
-            rc = jr._typeName.equals(_typeName);
-        }
-
-        return rc;
+        super(type);
     }
 }

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JSwitchStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JSwitchStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JSwitchStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JSwitchStatement.java Wed Mar 23 09:56:34 2005
@@ -19,30 +19,29 @@
 
 import java.util.Vector;
 
-
 public class JSwitchStatement extends JStatement {
-    protected JExpression _switchExpr;
-    protected Vector _caseStatements;
+    private JExpression       switchExpr;
+    private Vector            caseStatements;
 
     public JSwitchStatement(JExpression e) {
-        _switchExpr = e;
-        _caseStatements = new Vector();
+        switchExpr = e;
+        caseStatements = new Vector();
     }
 
     public void setVariable(JExpression e) {
-        _switchExpr = e;
+        switchExpr = e;
     }
 
     public JExpression getExpression() {
-        return _switchExpr;
+        return switchExpr;
     }
 
     public JCaseStatement getCase(JExpression e) {
         JCaseStatement rc = null;
-        int index = _caseStatements.indexOf(e);
+        int index = caseStatements.indexOf(e);
 
         if (index >= 0) {
-            rc = (JCaseStatement) _caseStatements.get(index);
+            rc = (JCaseStatement) caseStatements.get(index);
         }
 
         return rc;
@@ -53,7 +52,7 @@
 
         if (rc == null) {
             rc = new JCaseStatement(e);
-            _caseStatements.add(rc);
+            caseStatements.add(rc);
         }
 
         return rc;
@@ -70,6 +69,6 @@
     }
 
     public Vector getCases() {
-        return _caseStatements;
+        return caseStatements;
     }
 }



Mime
View raw message