You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jb...@apache.org on 2003/11/05 06:03:18 UTC

cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/core/service SimpleInvocationResult.java

jboynes     2003/11/04 21:03:18

  Modified:    modules/core/src/java/org/apache/geronimo/core/service
                        SimpleInvocationResult.java
  Log:
  Make constructors a little less confusing
  
  Revision  Changes    Path
  1.2       +18 -1     incubator-geronimo/modules/core/src/java/org/apache/geronimo/core/service/SimpleInvocationResult.java
  
  Index: SimpleInvocationResult.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/core/service/SimpleInvocationResult.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleInvocationResult.java	8 Sep 2003 04:25:19 -0000	1.1
  +++ SimpleInvocationResult.java	5 Nov 2003 05:03:18 -0000	1.2
  @@ -69,14 +69,31 @@
       private final Object result;
       private final boolean normal;
   
  +    /**
  +     * @deprecated too confusing - use SimpleInvocationResult(true, result)
  +     */
       public SimpleInvocationResult(Object result) {
           this.result = result;
           normal = true;
       }
   
  +    /**
  +     * @deprecated too confusing - use SimpleInvocationResult(false, appException)
  +     */
       public SimpleInvocationResult(Exception appException) {
           this.result = appException;
           this.normal = false;
  +    }
  +
  +    /**
  +     * Create a object representing the normal result of an Invocation
  +     * @param normal true if the target returned; false if it threw an application Exception
  +     * @param result the result or Exception
  +     */
  +    public SimpleInvocationResult(boolean normal, Object result) {
  +        assert (normal || result instanceof Throwable) : "Result must be normal or a Throwable";
  +        this.normal = normal;
  +        this.result = result;
       }
   
       public boolean isNormal() {