//////////////////////////////////////////////////////////////////////////////// // // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////////// package mx.messaging.events { import flash.events.Event; import mx.messaging.messages.ErrorMessage; /** * The MessageFaultEvent class is used to propagate fault messages within the messaging system. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion BlazeDS 4 * @productversion LCDS 3 */ public class MessageFaultEvent extends Event { //-------------------------------------------------------------------------- // // Static Constants // //-------------------------------------------------------------------------- /** * The FAULT event type; dispatched for a message fault. *
The value of this constant is "fault"
.
The properties of the event object have the following values:
*Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
* event listener that handles the event. For example, if you use
* myButton.addEventListener() to register an event listener,
* myButton is the value of the currentTarget . |
faultCode | Provides destination-specific * details of the failure. |
faultDetail | Provides access to the * destination-specific reason for the failure. |
faultString | Provides access to the underlying * reason for the failure if the channel did not raise the failure itself. |
message | The ErrorMessage for this event. |
rootCause | Provides access to the underlying reason * for the failure, if one exists. |
target | The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the currentTarget property to always access the
* Object listening for the event. |
faultString
and
* faultDetails
properties.
*
* The format of the fault codes are provided by the remote destination,
* but, will typically have the following form: host.operation.error
* For example, "Server.Connect.Failed"
Typically fault details are a stack trace of an exception thrown at * the remote destination.
* * @see #faultString * @see #faultCode * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion BlazeDS 4 * @productversion LCDS 3 */ public function get faultDetail():String { return message.faultDetail; } //---------------------------------- // faultString //---------------------------------- /** * Provides access to the destination specific reason for the failure. * * @see #faultCode * @see #faultDetail * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion BlazeDS 4 * @productversion LCDS 3 */ public function get faultString():String { return message.faultString; } //---------------------------------- // rootCause //---------------------------------- /** * Provides access to the root cause of the failure, if one exists. * * In the case of custom exceptions thrown by a destination, the root cause * represents the top level failure that is merely transported by the * ErrorMessage. * * @see MessageFaultEvent#rootCause * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion BlazeDS 4 * @productversion LCDS 3 */ public function get rootCause():Object { return message.rootCause; } //-------------------------------------------------------------------------- // // Overridden Methods // //-------------------------------------------------------------------------- /** * Clones the MessageFaultEvent. * * @return Copy of this MessageFaultEvent. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion BlazeDS 4 * @productversion LCDS 3 */ override public function clone():Event { return new MessageFaultEvent(type, bubbles, cancelable, message); } /** * Returns a string representation of the MessageFaultEvent. * * @return String representation of the MessageFaultEvent. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion BlazeDS 4 * @productversion LCDS 3 */ override public function toString():String { return formatToString("MessageFaultEvent", "faultCode", "faultDetail", "faultString", "rootCause", "type", "bubbles", "cancelable", "eventPhase"); } } }