org.openmdx.compatibility.base.exception
Class Assertions

java.lang.Object
  extended by org.openmdx.compatibility.base.exception.Assertions

Deprecated. without replacement

public class Assertions
extends Object


Method Summary
static void assertAtErrorLevel(boolean assertion, String description)
          Deprecated. without replacement
static void assertAtExceptionLevel(boolean assertion, String description)
          Deprecated. without replacement
static Error toError(Throwable throwable)
          Deprecated. without replacement
static Error toError(Throwable throwable, String description)
          Deprecated. without replacement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertAtErrorLevel

public static void assertAtErrorLevel(boolean assertion,
                                      String description)
Deprecated. without replacement

Throws a ServiceError if an assertion fails.

Parameters:
assertion - the condition expected to be true.
description - description of the assertion; or null
Throws:
ServiceError - if assertion is false

assertAtExceptionLevel

public static void assertAtExceptionLevel(boolean assertion,
                                          String description)
Deprecated. without replacement

Throws an RuntimeServiceException if an assertion fails and logs the fact at ERROR_LEVEL.

Parameters:
assertion - the condition expected to be true.
description - description of the assertion; or null
Throws:
RuntimeServiceException - if assertion is false

toError

public static Error toError(Throwable throwable)
Deprecated. without replacement

Maps a throwable to a ServiceError unless it is itself an instance of Error. This method is used when the program expects never to have to catch such a throwable.

Usage:

   
     public methodName (ParameterClass parameterValue) {
         try {
             ...
         } catch (Throwable throwable) {
             // This statement is expected never to be reached    
             throw Assertions.toError (exception);
         } 
     }
   

Parameters:
throwable - the unexpected exception
Returns:
the throwable if it's an Error; a ServiceError containing the throwable otherwise

toError

public static Error toError(Throwable throwable,
                            String description)
Deprecated. without replacement

Maps a throwable to an Error

Parameters:
throwable - the unexpected exception
domain - the exception domain
errorCode - the error code
description - a description of the error situation
Returns:
the throwable if it's an Error; a ServiceError containing the throwable otherwise


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.