代码改变世界

FLE3构建网络监控程序

2008-10-06 15:11  宝宝合凤凰  阅读(471)  评论(0)    收藏  举报

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

 

ESRIA网络监视器是一个演示应用程序,在多个视图中显示网络上的设备。 三个视图分别为网络拓扑,设备类型和网格。 每个设备显示实时数据使用 LiveCycle 数据服务 ES,并且允许用户单击它的数据模块时显示更为详细的内容。 代替数据库的是服务器上含有布局和初始设备信息加载数据XML 文件。 实例中的这些数据是在服务器上随机生成的。
& r( F7 A# e8 p$ D+ S5 sRIA是Rich Internet Applications的缩写,52RIA.com[我爱RIA网]是中国第一个以RIA开源为主的网站,还包括Flex,Flash,Ajax等RIA技术开源地方www.52ria.com. J5 B0 }2 m; J' ]. [) @6 J$ E5 y5 P
网络拓扑结果动态监控www.52ria.com+ y& X" i" p6 [+ v- @7 F0 a

如果你希望了解更多关于这个案例的详细,可以下载源码导入FLEX3即可调试。
: ~" D# y0 ^, m, B2 M$ g7 M+ B" k+ _RIA|RIA电子书|RIA论坛|RIA源文件你需要做以下准备:RIA是Rich Internet Applications的缩写,52RIA.com[我爱RIA网]是中国第一个以RIA开源为主的网站,还包括Flex,Flash,Ajax等RIA技术开源地方9 A3 t6 J' b! n0 d3 p9 _7 o

  • 安装 LiveCycle 数据 Servcies ES。 ria开源, ria技术 ria应用,ria教程,ria开发,flashria,flash,rich internet application) u7 e/ F6 Z. g2 P! ]& C1 G4 Y4 p
  • 解压缩的 LiveCycle 数据 Service ES 运行 Web 应用程序,内容。
    . H  x, v* E6 ^www.52ria.com
  • 将"/classes/"目录复制到 WEB-INF。
    ; d! n3 s; f7 b$ H) O中国最大的RIA分享社区-与中国闪客一起成长和发展!
  • 从下载文件上面指定将复制到 WEB-INF / FLEX / user_classes 的 Cairngorm.Swc 和 CairngormEnterprise.Swc /。 中国最大的RIA分享社区-与中国闪客一起成长和发展!: _3 d' B) Z) H* r( c9 Z  m! @
  • 添加以下代码到 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>
  • 启动 Java 应用程序服务器。
  • 打开http://localhost:{port}/{context-root}/main.mxml.
    复制内容到剪贴板
    代码:
    <?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 />
        <vieweviceView />
        <viewetail />
       
        <mx:TraceTarget level="0" />   
            
    </mx:Application>

RIA是Rich Internet Applications的缩写,52RIA.com[我爱RIA网]是中国第一个以RIA开源为主的网站,还包括Flex,Flash,Ajax等RIA技术开源地方7 Z# S& G- w  s) }1 p' G
案例在线体验
4 }! h* G* a! `ria开源, ria技术 ria应用,ria教程,ria开发,flashria,flash,rich internet applicationhttp://examples.adobe.com/flex3/devnet/networkmonitor/main.htmlria开源, ria技术 ria应用,ria教程,ria开发,flashria,flash,rich internet application+ @0 R, L/ H8 {& t( p4 C; O1 ^% B1 h$ D