Flex3构建网络监控程序

ESRIA网络监视器是一个演示应用程序,在多个视图中显示网络上的设备。 三个视图分别为网络拓扑,设备类型和网格。 每个设备显示实时数据使用 LiveCycle 数据服务 ES,并且允许用户单击它的数据模块时显示更为详细的内容。 代替数据库的是服务器上含有布局和初始设备信息加载数据XML 文件。 实例中的这些数据是在服务器上随机生成的。

网络拓扑结果动态监控

查看节点中更为详细的数据

如果你希望了解更多关于这个案例的详细,可以下载源码导入FLEX3即可调试。

你需要做以下准备:

  • 安装 LiveCycle 数据 Servcies ES。
  • 解压缩的 LiveCycle 数据 Service ES 运行 Web 应用程序,内容。
  • 将"/classes/"目录复制到 WEB-INF。
  • 从下载文件上面指定将复制到 WEB-INF / FLEX / user_classes 的 Cairngorm.Swc 和 CairngormEnterprise.Swc /。
  • 添加以下代码到 WEB-INF/flex/remoting-config.xml 的<service>标记后 。

<destination id="networkMonitor">
<properties>
<source>com.esria.samples.networkMonitor.NetworkMonitor</source>
</properties>
</destination>
 

  • 接着添加以下代码到WEB-INF/flex/messaging-config.xml的<service>标记后 。 

<default-channels>
<channel ref="my-rtmp"/>
</default-channels>
<destination id="feed">
<properties>
<network>
<session-timeout>0</session-timeout>
</network>
<server>
<max-cache-size>1000</max-cache-size>
<message-time-to-live>0</message-time-to-live>
<durable>false</durable>
</server>
</properties>
</destination>

<?xml version="1.0" encoding="utf-8"?>
<!--
 The main application file for the NetworkMonitor app.
-->
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:control="com.esria.samples.networkMonitor.control.*"
    xmlns:service="com.esria.samples.networkMonitor.business.*"
    xmlns:view="com.esria.samples.networkMonitor.view.*"
    backgroundColor="#FFFFFF"
    creationComplete="onCreationComplete()"
    width="978" height="790"
    backgroundImage="@Embed(&apos;assets/application_background.gif&apos;)"
    viewSourceURL="srcview/index.html">

    <mx:Style source="assets/styles.css"/>

    <mx:Script>
        <![CDATA[
            import com.adobe.cairngorm.control.CairngormEvent;
            import com.adobe.cairngorm.control.CairngormEventDispatcher;
            import com.adobe.viewsource.ViewSource;
            import com.esria.samples.networkMonitor.event.GetDevicesEvent;
            import com.esria.samples.networkMonitor.event.SubscribeToFeedEvent;
            import com.esria.samples.networkMonitor.model.NetworkMonitorModelLocator;
            import com.esria.samples.networkMonitor.view.StartFeedServerPopUp;
            import mx.binding.utils.BindingUtils;
            import mx.core.IFlexDisplayObject;
            import mx.managers.PopUpManager;
            
            private function onCreationComplete():void
            {
                // GetDevicesCommand is a sequence which checks the feed status after the device list is returned.
                BindingUtils.bindProperty(this, "feedRunning", NetworkMonitorModelLocator.getInstance().application, 
"feedRunning");
                
                // Get the list of devices. In lieu of a database the data is stored in data/devices.xml.
                CairngormEventDispatcher.getInstance().dispatchEvent(new CairngormEvent(GetDevicesEvent.GET_DEVICES));
            }
            
            // Triggered when feedRunning is updated in the networkMonitor model.
            public function set feedRunning(b:Boolean):void
            {
                if (!b) // If the feed is not running open the popup so the user can start it.
                {
                    var popUp:IFlexDisplayObject = PopUpManager.createPopUp(this, StartFeedServerPopUp, true);
                    PopUpManager.centerPopUp(popUp);
                }
                else
                {
                    CairngormEventDispatcher.getInstance().dispatchEvent(new SubscribeToFeedEvent());
                }
            }
        ]]>
    </mx:Script>

    <service:Services />
    <control:NetworkMonitorController />
    
    <view:ViewControlBar />
    <view:DeviceView />
    <view:Detail />
    
    <mx:TraceTarget level="0" />    
        
</mx:Application>

 

下载案例源码

 down/source/NetworkMonitor.zip

案例在线体验

http://examples.adobe.com/flex3/devnet/networkmonitor/main.html

源自:AIRIA.CN

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值