org.objectweb.mobilitools.smi.api
Class BadOperation

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.objectweb.mobilitools.smi.api.BadOperation
All Implemented Interfaces:
java.io.Serializable

public class BadOperation
extends java.lang.Exception

MobiliTools $Name: $, $Id: BadOperation.java,v 1.1.1.1 2003/03/28 14:48:05 dillense Exp $

Exception indicating that a request has failed.

See Also:
Serialized Form

Field Summary
static int AGENTTYPE
          agent type is not recognized = 10
static int CLASSFAULT
          agent class fetch problem = 4
static int DESTINATION
          destination agency for agent move is unknown = 3
static int INFRASTRUCTURE
          infrastructure (network, CORBA, naming service...) problem = 2
static int INSTANTIATION
          agent class could not be instantiated (check access, security, abstract class, static constructor...)
static int INVALIDNAME
          name is invalid (already exists?
protected  java.lang.String message
          failure explanation message
protected  java.lang.Exception nested
          nested exception
static int OTHER
          unspecified failure = 0
protected  int reason
          failure identification
static int REJECTED
          the target agent rejected the operation = 1
static int RETRY
          a (temporary/normal or permanent/abnormal?)
static int RUNNING
          agent is active after a suspend or resume request failure = 7
static int SERIALIZATION
          agent or argument object de/serialization failure = 6
static int SUSPENDED
          agent is suspended after a suspend or resume request failure = 8
static int UNKNOWNAGENCY
          unknown agency = 13
static int UNKNOWNAGENT
          the target agent is unknown = 5
 
Constructor Summary
BadOperation(int reason, java.lang.String message)
          Creates a new exception to signal any request failure.
BadOperation(int reason, java.lang.String message, java.lang.Exception nested)
          Creates a new exception to signal any request failure.
 
Method Summary
 java.lang.String getMessage()
           
 java.lang.Exception getNested()
           
 int getReason()
           
 void printAllStackTrace()
          Prints the execution stack trace first, and then the nested exception stack trace if any.
 void printAllStackTrace(java.io.PrintStream s)
          Prints the execution stack trace first, and then the nested exception stack trace if any.
 void printAllStackTrace(java.io.PrintWriter w)
          Prints the execution stack trace first, and then the nested exception stack trace if any.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OTHER

public static final int OTHER
unspecified failure = 0

REJECTED

public static final int REJECTED
the target agent rejected the operation = 1

INFRASTRUCTURE

public static final int INFRASTRUCTURE
infrastructure (network, CORBA, naming service...) problem = 2

DESTINATION

public static final int DESTINATION
destination agency for agent move is unknown = 3

CLASSFAULT

public static final int CLASSFAULT
agent class fetch problem = 4

UNKNOWNAGENT

public static final int UNKNOWNAGENT
the target agent is unknown = 5

SERIALIZATION

public static final int SERIALIZATION
agent or argument object de/serialization failure = 6

RUNNING

public static final int RUNNING
agent is active after a suspend or resume request failure = 7

SUSPENDED

public static final int SUSPENDED
agent is suspended after a suspend or resume request failure = 8

INSTANTIATION

public static final int INSTANTIATION
agent class could not be instantiated (check access, security, abstract class, static constructor...) = 9

AGENTTYPE

public static final int AGENTTYPE
agent type is not recognized = 10

INVALIDNAME

public static final int INVALIDNAME
name is invalid (already exists? other?) = 11

UNKNOWNAGENCY

public static final int UNKNOWNAGENCY
unknown agency = 13

RETRY

public static final int RETRY
a (temporary/normal or permanent/abnormal?) unconsistency happened, retry later = 14

reason

protected int reason
failure identification

message

protected java.lang.String message
failure explanation message

nested

protected java.lang.Exception nested
nested exception
Constructor Detail

BadOperation

public BadOperation(int reason,
                    java.lang.String message)
Creates a new exception to signal any request failure.
Parameters:
reason - failure identification - should be one of the identifiers defined in this class.
message - failure explanation message.

BadOperation

public BadOperation(int reason,
                    java.lang.String message,
                    java.lang.Exception nested)
Creates a new exception to signal any request failure.
Parameters:
reason - failure identification - should be one of the identifiers defined in this class.
message - failure explanation message.
nested - the actual exception this BadOperation springs from.
Method Detail

getReason

public int getReason()
Returns:
failure reason identifer.

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable
Returns:
failure explanation message.

getNested

public java.lang.Exception getNested()
Returns:
the nested exception (if any is defined), null otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable
Returns:
a message describing the exception.

printAllStackTrace

public void printAllStackTrace()
Prints the execution stack trace first, and then the nested exception stack trace if any.

printAllStackTrace

public void printAllStackTrace(java.io.PrintStream s)
Prints the execution stack trace first, and then the nested exception stack trace if any.
Parameters:
s - where to print stack trace.

printAllStackTrace

public void printAllStackTrace(java.io.PrintWriter w)
Prints the execution stack trace first, and then the nested exception stack trace if any.
Parameters:
w - where to print stack trace.