org.spicefactory.cinnamon.service
Class ErrorMessage

java.lang.Object
  extended by org.spicefactory.cinnamon.service.ErrorMessage

public class ErrorMessage
extends Object

Represents a single error message. Instances of this class will be sent to the client if the service invocation threw an Exception or if the specified service or operation does not exist or if the method parameters do not match those parameters required by the operation.

Author:
Jens Halm

Constructor Summary
ErrorMessage()
          Creates an empty ErrorMessage.
ErrorMessage(String message, String exceptionType)
          Creates a new error message.
ErrorMessage(Throwable exception)
          Creates a new error message.
 
Method Summary
 String getExceptionType()
          String representation of the exception type.
 String getMessage()
          The error description.
 String getStacktrace()
          Returns the stacktrace of this error.
 void setExceptionType(String exceptionType)
          Sets the String representation of the exception type.
 void setMessage(String message)
          Sets the error description.
 void setStacktrace(String stackTrace)
          Sets the stacktrace of this error.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorMessage

public ErrorMessage()
Creates an empty ErrorMessage. Default Constructor needed for instances that will be deserialized on the client (if using the Cinnamon Java client instead of the AS3 client).


ErrorMessage

public ErrorMessage(Throwable exception)
Creates a new error message.

Parameters:
exception - the cause of the error

ErrorMessage

public ErrorMessage(String message,
                    String exceptionType)
Creates a new error message.

Parameters:
message - the error description
exceptionType - String representation of the type of exception
Method Detail

getMessage

public String getMessage()
The error description.

Returns:
the error description

getExceptionType

public String getExceptionType()
String representation of the exception type. This will usually be the fully qualified name of the Java Exception.

Returns:
a String representation of the exception type

getStacktrace

public String getStacktrace()
Returns the stacktrace of this error.

Returns:
the stacktrace of this error

setExceptionType

public void setExceptionType(String exceptionType)
Sets the String representation of the exception type. This will usually be the fully qualified name of the Java Exception.

Parameters:
exceptionType - a String representation of the exception type

setMessage

public void setMessage(String message)
Sets the error description.

Parameters:
message - the error description

setStacktrace

public void setStacktrace(String stackTrace)
Sets the stacktrace of this error.

Parameters:
stackTrace - the stacktrace of this error

toString

public String toString()
Overrides:
toString in class Object