| 1 |
/* |
/* |
| 2 |
* Copyright 2004-2008 the Seasar Foundation and the Others. |
* Copyright 2004-2010 the Seasar Foundation and the Others. |
| 3 |
* |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
* you may not use this file except in compliance with the License. |
* you may not use this file except in compliance with the License. |
| 15 |
*/ |
*/ |
| 16 |
package org.seasar.akabana.yui.framework.mixin |
package org.seasar.akabana.yui.framework.mixin |
| 17 |
{ |
{ |
| 18 |
|
CONFIG::FP10{ |
| 19 |
|
import __AS3__.vec.Vector; |
| 20 |
|
} |
| 21 |
|
import flash.net.registerClassAlias; |
| 22 |
|
|
| 23 |
|
import mx.core.IFlexModuleFactory; |
| 24 |
|
import mx.managers.ISystemManager; |
| 25 |
|
|
| 26 |
|
import org.seasar.akabana.yui.core.yui_internal; |
| 27 |
|
import org.seasar.akabana.yui.framework.YuiFrameworkGlobals; |
| 28 |
|
import org.seasar.akabana.yui.framework.bridge.FrameworkBridge; |
| 29 |
|
import org.seasar.akabana.yui.framework.core.YuiFrameworkContainer; |
| 30 |
|
import org.seasar.akabana.yui.logging.LogManager; |
| 31 |
|
import org.seasar.akabana.yui.logging.config.ConfigurationProvider; |
| 32 |
|
import org.seasar.akabana.yui.logging.config.factory.LogConfigurationFactory; |
| 33 |
|
|
| 34 |
|
[ExcludeClass] |
| 35 |
|
[Mixin] |
| 36 |
|
[ResourceBundle("conventions")] |
| 37 |
|
/** |
| 38 |
|
* YuiFramework初期設定用Mixinクラス |
| 39 |
|
* |
| 40 |
|
* @author $Author$ |
| 41 |
|
* @version $Revision$ |
| 42 |
|
*/ |
| 43 |
|
public class YuiFrameworkMixin |
| 44 |
|
{ |
| 45 |
|
{ |
| 46 |
|
LogConfigurationFactory; |
| 47 |
|
registerClassAlias(ConfigurationProvider.FACTORY_CLASS_NAME,LogConfigurationFactory); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
import flash.events.Event; |
private static var _this:YuiFrameworkMixin; |
|
import flash.net.registerClassAlias; |
|
|
import flash.system.ApplicationDomain; |
|
|
|
|
|
import mx.core.ClassFactory; |
|
|
import mx.core.IFactory; |
|
|
import mx.core.IFlexModuleFactory; |
|
|
import mx.managers.ISystemManager; |
|
|
import mx.resources.ResourceManager; |
|
|
import mx.styles.CSSStyleDeclaration; |
|
|
import mx.styles.StyleManager; |
|
|
|
|
|
import org.seasar.akabana.yui.core.yui_internal; |
|
|
import org.seasar.akabana.yui.framework.YuiFrameworkGlobals; |
|
|
import org.seasar.akabana.yui.framework.bridge.FrameworkBridge; |
|
|
import org.seasar.akabana.yui.framework.convention.NamingConvention; |
|
|
import org.seasar.akabana.yui.framework.core.YuiFrameworkContainer; |
|
|
import org.seasar.akabana.yui.framework.core.event.FrameworkEvent; |
|
|
import org.seasar.akabana.yui.logging.LogManager; |
|
|
import org.seasar.akabana.yui.logging.config.ConfigurationProvider; |
|
|
import org.seasar.akabana.yui.logging.config.factory.LogConfigurationFactory; |
|
|
|
|
|
[Mixin] |
|
|
[ResourceBundle("conventions")] |
|
|
/** |
|
|
* YuiFramework初期設定用Mixinクラス |
|
|
* |
|
|
* @author $Author$ |
|
|
* @version $Revision$ |
|
|
*/ |
|
|
public class YuiFrameworkMixin |
|
|
{ |
|
|
{ |
|
|
LogConfigurationFactory; |
|
|
registerClassAlias(ConfigurationProvider.FACTORY_CLASS_NAME,LogConfigurationFactory); |
|
|
} |
|
|
|
|
|
private static var _this:YuiFrameworkMixin; |
|
|
|
|
|
private static var _container:YuiFrameworkContainer; |
|
| 51 |
|
|
| 52 |
private static var _namingConventionClassFactory:IFactory; |
private static var _container:YuiFrameworkContainer; |
| 53 |
|
|
| 54 |
public static function init( flexModuleFactory:IFlexModuleFactory ):void{ |
public static function init( flexModuleFactory:IFlexModuleFactory ):void{ |
| 55 |
LogManager.init(); |
LogManager.init(); |
| 56 |
|
|
| 57 |
_this = new YuiFrameworkMixin(); |
_this = new YuiFrameworkMixin(); |
| 58 |
_container = new YuiFrameworkContainer(); |
_container = new YuiFrameworkContainer(); |
| 59 |
YuiFrameworkGlobals.yui_internal::frameworkBridge = FrameworkBridge.initialize(); |
YuiFrameworkGlobals.yui_internal::frameworkBridge = FrameworkBridge.initialize(); |
| 60 |
|
|
| 61 |
if( flexModuleFactory is ISystemManager ){ |
if( flexModuleFactory is ISystemManager ){ |
| 62 |
var systemManager_:ISystemManager = flexModuleFactory as ISystemManager; |
var systemManager_:ISystemManager = flexModuleFactory as ISystemManager; |
|
|
|
|
systemManager_ |
|
|
.addEventListener( |
|
|
FrameworkEvent.APPLICATION_MONITOR_START, |
|
|
applicationMonitorStartHandler, |
|
|
false, |
|
|
int.MAX_VALUE |
|
|
); |
|
| 63 |
_container.yui_internal::monitoringSystemManager(systemManager_); |
_container.yui_internal::monitoringSystemManager(systemManager_); |
| 64 |
} |
} |
| 65 |
} |
} |
| 66 |
|
} |
|
protected static function applicationMonitorStartHandler(event:Event):void{ |
|
|
var appDomain:ApplicationDomain = ApplicationDomain.currentDomain; |
|
|
if(appDomain.hasDefinition("ja_JP$log4yui_properties")) |
|
|
{ |
|
|
trace("a"); |
|
|
} |
|
|
|
|
|
initNamingConventionClassFactory(); |
|
|
initNamingConvention(); |
|
|
} |
|
|
|
|
|
protected static function initNamingConvention():void{ |
|
|
var namingConvention:NamingConvention = _namingConventionClassFactory.newInstance() as NamingConvention; |
|
|
namingConvention.conventions = ResourceManager.getInstance().getStringArray("conventions","package"); |
|
|
YuiFrameworkGlobals.yui_internal::namingConvention = namingConvention; |
|
|
} |
|
|
|
|
|
protected static function initNamingConventionClassFactory():void{ |
|
|
var namingConventionClassFactoryDef:CSSStyleDeclaration = StyleManager.getStyleDeclaration("org.seasar.akabana.yui.framework.core.YuiFrameworkSettings"); |
|
|
if( namingConventionClassFactoryDef == null ){ |
|
|
_namingConventionClassFactory = new ClassFactory(NamingConvention); |
|
|
} else { |
|
|
var classFactory:Class = namingConventionClassFactoryDef.getStyle("namingConventionClass") as Class; |
|
|
_namingConventionClassFactory = new ClassFactory(classFactory); |
|
|
} |
|
|
} |
|
|
} |
|
| 67 |
} |
} |