flex.messaging
Class MessageException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by flex.messaging.LocalizedException
                  extended by flex.messaging.MessageException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DuplicateSessionException, ManagementException, SecurityException, SerializationException

public class MessageException
extends LocalizedException

The MessageException class is the basic exception type used throughout the server. This class is extended to support more specific exception types.

See Also:
Serialized Form

Field Summary
static String CODE_SERVER_RESOURCE_UNAVAILABLE
           
 
Constructor Summary
MessageException()
          Default constructor.
MessageException(ResourceLoader loader)
          Construct a message specifying a ResourceLoader to be used to load localized strings.
MessageException(String message)
          Constructor with a message.
MessageException(String message, Throwable t)
          Constructs a new exception with the specified message and the Throwable as the root cause.
MessageException(Throwable t)
          Constructs a new exception with the specified Throwable as the root cause.
 
Method Summary
 ErrorMessage createErrorMessage()
          Creates an error message from the exception.
 String getCode()
          Returns the code of the exception.
 String getDefaultLogMessageIntro()
          Returns the default initial text for use in the log output generated by logAtHingePoint().
 ErrorMessage getErrorMessage()
          Returns the error message of the exception.
 Map getExtendedData()
          Returns the extended data of the exception.
 short getPreferredLogLevel()
          Returns the preferred log level for this exception instance.
 boolean isLogged()
          Indicates whether this exception has already been logged by a call to logAtHingPoint().
 boolean isLogStackTraceEnabled()
          Indicates whether logging of this exception should include a full stack trace or not.
 void logAtHingePoint(Message inboundMessage, ErrorMessage outboundMessage, String logMessageIntro)
          Invoked at hinge-points in server processing where catch-all exception logging is performed.
 void setCode(String code)
          Sets the code of the exception.
 void setErrorMessage(ErrorMessage errorMessage)
          Sets the error message of the exception.
 void setExtendedData(Map extendedData)
          Sets the extended data of the exception.
 void setLogged(boolean value)
          Records whether this exception has been logged.
 
Methods inherited from class flex.messaging.LocalizedException
getDetails, getMessage, getNumber, getRootCause, setDetails, setDetails, setDetails, setDetails, setDetails, setDetails, setMessage, setMessage, setMessage, setMessage, setMessage, setMessage, setMessage, setMessage, setNumber, setRootCause, toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CODE_SERVER_RESOURCE_UNAVAILABLE

public static final String CODE_SERVER_RESOURCE_UNAVAILABLE
See Also:
Constant Field Values
Constructor Detail

MessageException

public MessageException()
Default constructor.


MessageException

public MessageException(ResourceLoader loader)
Construct a message specifying a ResourceLoader to be used to load localized strings.

Parameters:
loader -

MessageException

public MessageException(String message)
Constructor with a message.

Parameters:
message - The detailed message for the exception.

MessageException

public MessageException(String message,
                        Throwable t)
Constructs a new exception with the specified message and the Throwable as the root cause.

Parameters:
message - The detailed message for the exception.
t - The root cause of the exception.

MessageException

public MessageException(Throwable t)
Constructs a new exception with the specified Throwable as the root cause.

Parameters:
t - The root cause of the exception.
Method Detail

getCode

public String getCode()
Returns the code of the exception.

Returns:
Code of the exception.

setCode

public void setCode(String code)
Sets the code of the exception.

Parameters:
code - Code of the exception.

getDefaultLogMessageIntro

public String getDefaultLogMessageIntro()
Returns the default initial text for use in the log output generated by logAtHingePoint().


getExtendedData

public Map getExtendedData()
Returns the extended data of the exception.

Returns:
The extended data of the exception.

setExtendedData

public void setExtendedData(Map extendedData)
Sets the extended data of the exception.

Parameters:
extendedData - The extended data of the exception.

getErrorMessage

public ErrorMessage getErrorMessage()
Returns the error message of the exception.

Returns:
The error message of the exception.

setErrorMessage

public void setErrorMessage(ErrorMessage errorMessage)
Sets the error message of the exception.

Parameters:
errorMessage - The error message of the exception.

isLogStackTraceEnabled

public boolean isLogStackTraceEnabled()
Indicates whether logging of this exception should include a full stack trace or not. Default is true.

See Also:
MessageException.logAtHingePoint(Message, ErrorMessage, String)

isLogged

public boolean isLogged()
Indicates whether this exception has already been logged by a call to logAtHingPoint(). Manual logging for an exception can use setLogged(true) to suppress any further automatic logging of the exception.

Returns:
true if the exception has been logged; otherwise false.

setLogged

public void setLogged(boolean value)
Records whether this exception has been logged.

Parameters:
value - true if the exception has been logged; otherwise false.

getPreferredLogLevel

public short getPreferredLogLevel()
Returns the preferred log level for this exception instance. The default value is LogEvent.ERROR.

See Also:
MessageException.logAtHingePoint(Message, ErrorMessage, String)

createErrorMessage

public ErrorMessage createErrorMessage()
Creates an error message from the exception.

Returns:
The error message.

logAtHingePoint

public void logAtHingePoint(Message inboundMessage,
                            ErrorMessage outboundMessage,
                            String logMessageIntro)
Invoked at hinge-points in server processing where catch-all exception logging is performed. This method uses isLogged() and setLogged() to avoid repeat logging of the same exception and uses getPreferredLogLevel() which may be overridden in subclasses to control the log level that the logging is output at. The underlying exception stack traces are also conditionally included in log output if the exception class allows it and this is determined by invoking isLogStackTraceEnabled()

Parameters:
inboundMessage - The inbound message that triggered an exception during processing.
outboundMessage - The outbound ErrorMessage, which may be null depending on whether it has been generated or not at the point this method is invoked.
logMessageIntro - The beginning text for the log message, which may be null; default value is returned by getDefaultLogMessageIntro().


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/MessageException.html