<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
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. | |
--> | |
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:console="console.containers.*" xmlns="*" creationComplete="initApp();"> | |
<mx:Script> | |
<![CDATA[ | |
import console.ConsoleListener; | |
import console.containers.LogManager; | |
import console.containers.DestinationManager; | |
import console.containers.EndpointManager; | |
import console.containers.DefaultPanel; | |
import mx.core.Container; | |
import console.containers.UpdateListener; | |
import console.events.ManagementOperationInvokeEvent; | |
import mx.collections.ArrayCollection; | |
import console.containers.ServerManager; | |
import console.containers.AdvancedPanel; | |
import console.ConsoleManager; | |
import mx.messaging.management.*; | |
import mx.rpc.events.ResultEvent; | |
private var manager:ConsoleManager; | |
private var advPanel:AdvancedPanel; | |
private var srvManager:ServerManager; | |
private var currentSelectedPanel:Container; | |
private var consoleListener:ConsoleListener; | |
[Bindable] | |
public var appsList:ArrayCollection; | |
private function initApp():void | |
{ | |
appsList = new ArrayCollection; | |
manager = ConsoleManager.getInstance(); | |
manager.parent = this; | |
consoleNavigator.addChild(new DefaultPanel()); | |
consoleNavigator.addChild(new ServerManager()); | |
consoleNavigator.addChild(new EndpointManager()); | |
consoleNavigator.addChild(new DestinationManager()); | |
consoleNavigator.addChild(new LogManager()); | |
consoleNavigator.addChild(new AdvancedPanel()); | |
consoleListener = new ConsoleListener(this); | |
currentSelectedPanel = consoleNavigator.selectedChild as Container; | |
manager.activateListener(consoleNavigator.selectedChild as UpdateListener); | |
} | |
private function setCurrentTab():void | |
{ | |
manager.deactivateListener(currentSelectedPanel as UpdateListener); | |
manager.activateListener(consoleNavigator.selectedChild as UpdateListener); | |
currentSelectedPanel = consoleNavigator.selectedChild as Container; | |
} | |
private function setCurrentApp():void | |
{ | |
manager.currentApp = appSelect.selectedItem.data.label as String; | |
} | |
private function updatePollInterval():void | |
{ | |
manager.timerInterval = pollIntervalSlider.value * 1000; | |
} | |
public function updateModel(model:Object):void | |
{ | |
var mbeanModel:Object = manager.mbeanModel; | |
for each (var appObj:Object in mbeanModel) | |
{ | |
var names:Array = (appObj.label as String).split("."); | |
appsList.addItem({label: names[2], data: appObj}); | |
} | |
appSelect.selectedIndex = 0; | |
} | |
]]> | |
</mx:Script> | |
<mx:HBox width="100%" textAlign="left" horizontalAlign="right"> | |
<mx:Label text="Application"/> | |
<mx:ComboBox id="appSelect" dataProvider="{appsList}" labelField="label" width="300" change="{setCurrentApp()}" editable="false" enabled="true"/> | |
<mx:Label text="Polling Interval (seconds)" /> | |
<mx:HSlider id="pollIntervalSlider" minimum="0" maximum="20" snapInterval=".5" enabled="true" change="{updatePollInterval()}"/> | |
</mx:HBox> | |
<mx:TabNavigator width="100%" height="100%" id="consoleNavigator" change="{setCurrentTab()}"> | |
</mx:TabNavigator> | |
</mx:Application> |