Apache Flex 4.16.1 API Reference | All Packages | All Classes | Index | Frames No Frames |
NetworkMonitor

Package | mx.netmon
Class | public class NetworkMonitor
Inheritance | NetworkMonitor Object

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

NetworkMonitor is a stub used by the framework and enterprise service classes to send information to the Flash Builder Network Monitor feature. The NetworkMonitor declares a number of Impl functions which are to be filled in by a mix-in class provided by Flash Builder. If those functions are not assigned the stub will do nothing, will or return false or null as appropriate. We don't use a singleton or an instance object at the moment to simplify the code that calls the monitor.

Public Properties

| Property | Defined By
--- | --- | ---
|  | adjustNetConnectionURLImpl : Function [static] To be assigned by mix-in. | NetworkMonitor
|  | adjustURLRequestImpl : Function [static] To be assigned by mix-in. | NetworkMonitor
|  | isMonitoringImpl : Function [static] To be assigned by mix-in. | NetworkMonitor
|  | monitorEventImpl : Function [static] To be assigned by mix-in. | NetworkMonitor
|  | monitorFaultImpl : Function [static] To be assigned by mix-in. | NetworkMonitor
|  | monitorInvocationImpl : Function [static] To be assigned by mix-in. | NetworkMonitor
|  | monitorResultImpl : Function [static] To be assigned by mix-in. | NetworkMonitor

Public Methods

| Method | Defined By
--- | --- | ---
|  | adjustNetConnectionURL(rootUrl:String, url:String):String [static] Adjust the URL for NetConnectionChannel and HTTPChannel Requests so that it goes through the monitor. | NetworkMonitor
|  | adjustURLRequest(urlRequest:URLRequest, rootURL:String, correlationID:String):void [static] Adjust the URLRequest so that it goes through the monitor. | NetworkMonitor
|  | isMonitoring():Boolean [static] Returns true if the monitor is linked and monitoring. | NetworkMonitor
|  | monitorEvent(event:Event, correlationID:String):void [static] Tell the monitor that an event occurred. | NetworkMonitor
|  | monitorFault(faultMessage:Object, actualFault:Object):void [static] Tell the monitor that a fault occurred. | NetworkMonitor
|  | monitorInvocation(id:String, invocationMessage:Object, messageAgent:Object):void [static] Tell the monitor that an invocation is occuring. | NetworkMonitor
|  | monitorResult(resultMessage:Object, actualResult:Object):void [static] Tell the monitor that a result was returned. | NetworkMonitor

Property Detail

adjustNetConnectionURLImpl | property

`public static var adjustNetConnectionURLImpl:Function`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

To be assigned by mix-in.

adjustURLRequestImpl | property |

`public static var adjustURLRequestImpl:Function`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

To be assigned by mix-in.

isMonitoringImpl | property |

`public static var isMonitoringImpl:Function`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

To be assigned by mix-in.

monitorEventImpl | property |

`public static var monitorEventImpl:Function`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

To be assigned by mix-in.

monitorFaultImpl | property |

`public static var monitorFaultImpl:Function`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

To be assigned by mix-in.

monitorInvocationImpl | property |

`public static var monitorInvocationImpl:Function`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

To be assigned by mix-in.

monitorResultImpl | property |

`public static var monitorResultImpl:Function`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

To be assigned by mix-in.

Method Detail

adjustNetConnectionURL | () | method

`public static function adjustNetConnectionURL(rootUrl:String, url:String):String`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Adjust the URL for NetConnectionChannel and HTTPChannel Requests so that it goes through the monitor. Returns the modified url.

Parameters

| `rootUrl:String` — to adjust.
| `url:String`

Returns

| `String`

adjustURLRequest | () | method |

`public static function adjustURLRequest(urlRequest:URLRequest, rootURL:String, correlationID:String):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Adjust the URLRequest so that it goes through the monitor. The URLRequest sent to the monitor will have two headers:

- `actualHostPort`: The real `host:port` for the URL.
- `correlationID`: The correlationID for the request in case it's from messaging (Image/Loader requests need to create their own correlationIDs)

Parameters

| `urlRequest:URLRequest` — The URLRequest to adjust. (Relative URLs are supported.)
| `rootURL:String` — Computes an absolute URL from the relative URL. If necessary, pass the SWF file's URL as this value.
| `correlationID:String` — The correlationID that may be used for associated events.

isMonitoring | () | method |

`public static function isMonitoring():Boolean`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Returns true if the monitor is linked and monitoring.

Returns

| `Boolean`

monitorEvent | () | method |

`public static function monitorEvent(event:Event, correlationID:String):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Tell the monitor that an event occurred. This may be used by the Loader to monitor security and IO errors. It should not be used for the Loader's `complete` event.

Parameters

| `event:Event` — The event that is about to occur (or occurred).
| `correlationID:String` — The correlationID to associate with other events or the request.

monitorFault | () | method |

`public static function monitorFault(faultMessage:Object, actualFault:Object):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Tell the monitor that a fault occurred.

Parameters

| `faultMessage:Object` — The Message that came back indicating the result. It be null if this was due to an invocation failure. (It is untyped here to avoid linking in the dependency.)
| `actualFault:Object` — The Fault that occurred. (It is untyped here to avoid linking in the dependency.)

monitorInvocation | () | method |

`public static function monitorInvocation(id:String, invocationMessage:Object, messageAgent:Object):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Tell the monitor that an invocation is occuring.

Parameters

| `id:String` — The id of the tag causing the invocation if it can be determined.
| `invocationMessage:Object` — The Message that will be sent across the wire. (It is untyped here to avoid linking in the dependency.)
| `messageAgent:Object`

monitorResult | () | method |

`public static function monitorResult(resultMessage:Object, actualResult:Object):void`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Tell the monitor that a result was returned.

Parameters

| `resultMessage:Object` — The Message that came back indicating the result. (It is untyped here to avoid linking in the dependency.)
| `actualResult:Object` — the decoded result

Wed Nov 15 2017, 09:50 AM +01:00