当前位置: 首页>>代码示例>>Java>>正文


Java App.instance方法代码示例

本文整理汇总了Java中act.app.App.instance方法的典型用法代码示例。如果您正苦于以下问题:Java App.instance方法的具体用法?Java App.instance怎么用?Java App.instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在act.app.App的用法示例。


在下文中一共展示了App.instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAllWithList

import act.app.App; //导入方法依赖的package包/类
private void getAllWithList(final Set<String> withList, final ControllerClassMetaInfoManager infoBase) {
    withList.addAll(this.withList);
    if (null != superType) {
        final String superClass = superType.getClassName();
        App app = App.instance();
        ClassInfoRepository repo = app.classLoader().classInfoRepository();
        ControllerClassMetaInfo info = infoBase.controllerMetaInfo(superClass);
        String curSuperClass = superClass;
        while (null == info && !"java.lang.Object".equals(curSuperClass)) {
            ClassNode node = repo.node(curSuperClass);
            if (null != node) {
                node = node.parent();
            }
            if (null == node) {
                break;
            }
            curSuperClass = node.name();
            info = infoBase.controllerMetaInfo(curSuperClass);
        }
        if (null != info) {
            withList.add(superClass);
        }
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:25,代码来源:ControllerClassMetaInfo.java

示例2: initialized

import act.app.App; //导入方法依赖的package包/类
@Override
protected void initialized() {
    App app = App.instance();

    rawType = spec.rawType();
    notNull = spec.hasAnnotation(NotNull.class);
    findOne = !(Iterable.class.isAssignableFrom(rawType));
    dao = app.dbServiceManager().dao(findOne ? rawType : (Class) spec.typeParams().get(0));

    queryFieldName = S.string(options.get("field"));
    byId = findOne && S.blank(queryFieldName) && (Boolean) options.get("byId");
    resolver = app.resolverManager().resolver(byId ? dao.idType() : (Class) options.get("fieldType"));
    if (null == resolver) {
        throw new IllegalArgumentException("Cannot find String value resolver for type: " + dao.idType());
    }
    requestParamName = S.string(value());
    if (S.blank(requestParamName)) {
        requestParamName = ParamValueLoaderService.bindName(spec);
    }
    if (!byId) {
        if (S.blank(queryFieldName)) {
            queryFieldName = requestParamName;
        }
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:26,代码来源:FindBy.java

示例3: RedirectToLoginUrl

import act.app.App; //导入方法依赖的package包/类
public RedirectToLoginUrl() {
    userDefined = null;
    App app = App.instance();
    AppConfig<?> config = app.config();
    String loginUrl = config.loginUrl();
    String ajaxLoginUrl = config.ajaxLoginUrl();

    Router router = app.router();
    $.Var<Result> result = $.var(), ajaxResult = $.var();
    findResults(loginUrl, ajaxLoginUrl, result, ajaxResult, router);
    R = result.get();
    R_AJAX = result.get();
    resultMap.put("", R);
    ajaxResultMap.put("", R_AJAX);
    for (NamedPort port: config.namedPorts()) {
        Router routerX = app.router(port);
        findResults(loginUrl, ajaxLoginUrl, result, ajaxResult, routerX);
        resultMap.put(port.name(), result.get());
        ajaxResultMap.put(port.name(), ajaxResult.get());
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:22,代码来源:RedirectToLoginUrl.java

示例4: initialized

import act.app.App; //导入方法依赖的package包/类
@Override
protected void initialized() {
    App app = App.instance();

    Class rawType = spec.rawType();
    dao = app.dbServiceManager().dao(rawType);

    querySpec = S.string(options.get(KEY_USER_KEY));
    if (S.blank(querySpec)) {
        querySpec = AAAConfig.user.key.get();
    }
}
 
开发者ID:actframework,项目名称:act-aaa-plugin,代码行数:13,代码来源:LoginUserFinder.java

示例5: JobContext

import act.app.App; //导入方法依赖的package包/类
private JobContext() {
    super(App.instance());
    ActContext<?> actContext = ActContext.Base.currentContext();
    if (null != actContext) {
        bag_.put("locale", actContext.locale());
        if (actContext instanceof ActionContext) {
            H.Session session = ((ActionContext) actContext).session();
            if (null != session) {
                bag_.put("session", session);
            }
        }
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:14,代码来源:JobContext.java

示例6: foundConfigurator

import act.app.App; //导入方法依赖的package包/类
@SubClassFinder(callOn = SysEventId.CLASS_LOADED)
public static void foundConfigurator(final Class<? extends AppConfigurator> configuratorClass) {
    final App app = App.instance();
    AppConfigurator configurator = app.getInstance(configuratorClass);
    configurator.app(app);
    configurator.configure();
    app.config()._merge(configurator);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:9,代码来源:AppConfigPlugin.java

示例7: host

import act.app.App; //导入方法依赖的package包/类
private Object host() {
    if (isStatic) {
        return null;
    } else {
        if (null == host) {
            synchronized (this) {
                if (null == host) {
                    App app = App.instance();
                    host = app.getInstance(hostClass);
                }
            }
        }
        return host;
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:16,代码来源:ReflectedSimpleEventListener.java

示例8: scheduleFind

import act.app.App; //导入方法依赖的package包/类
public void scheduleFind() {
    if (logger.isTraceEnabled()) {
        logger.trace("schedule class finding for %s", this);
    }
    final App app = App.instance();
    app.jobManager().on(when, jobId(), new Runnable() {
        @Override
        public void run() {
            how.find(app, ClassFinderData.this);
        }
    });
}
 
开发者ID:actframework,项目名称:actframework,代码行数:13,代码来源:ClassFinderData.java

示例9: addModuleClass

import act.app.App; //导入方法依赖的package包/类
public static void addModuleClass(Class<?> moduleClass) {
    if (!isModuleAllowed(moduleClass)) {
        return;
    }
    App app = App.instance();
    GenieInjector genieInjector = app.injector();
    genieInjector.addModule(moduleClass);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:9,代码来源:GenieInjector.java

示例10: foundGenericTypedBeanLoader

import act.app.App; //导入方法依赖的package包/类
@SubClassFinder
public static void foundGenericTypedBeanLoader(Class<? extends GenericTypedBeanLoader> loaderClass) {
    App app = App.instance();
    GenieInjector genieInjector = app.injector();
    Type[] ta = loaderClass.getGenericInterfaces();
    for (Type t : ta) {
        if (t instanceof ParameterizedType) {
            ParameterizedType pt = (ParameterizedType) t;
            if (GenericTypedBeanLoader.class == pt.getRawType()) {
                Type compoentType = pt.getActualTypeArguments()[0];
                genieInjector.genie().registerGenericTypedBeanLoader((Class) compoentType, app.getInstance(loaderClass));
            }
        }
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:16,代码来源:GenieInjector.java

示例11: foundProviderBase

import act.app.App; //导入方法依赖的package包/类
@SubClassFinder
public static void foundProviderBase(Class<? extends ActProvider> providerClass) {
    App app = App.instance();
    GenieInjector genieInjector = app.injector();
    ActProvider provider = app.getInstance(providerClass);
    genieInjector.genie().registerProvider(provider.targetType(), provider);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:8,代码来源:GenieInjector.java

示例12: discoverDiListener

import act.app.App; //导入方法依赖的package包/类
@SubClassFinder(value = DependencyInjectionListener.class, callOn = SysEventId.DEPENDENCY_INJECTOR_PROVISIONED)
public static void discoverDiListener(final Class<? extends DependencyInjectionListener> target) {
    App app = App.instance();
    DependencyInjector di = app.injector();
    di.registerDiListener(app.getInstance(target));
}
 
开发者ID:actframework,项目名称:actframework,代码行数:7,代码来源:DependencyInjectorBase.java

示例13: foundValueLoader

import act.app.App; //导入方法依赖的package包/类
@AnnotatedClassFinder(value = LoadValue.class, noAbstract = false, callOn = SysEventId.DEPENDENCY_INJECTOR_LOADED)
public static void foundValueLoader(Class<? extends Annotation> valueLoader) {
    App app = App.instance();
    GenieInjector genieInjector = app.injector();
    genieInjector.injectTags.add(valueLoader);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:7,代码来源:GenieInjector.java

示例14: app

import act.app.App; //导入方法依赖的package包/类
private static App app() {
    return App.instance();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:4,代码来源:GenieProviders.java

示例15: SingletonScope

import act.app.App; //导入方法依赖的package包/类
public SingletonScope() {
    app = App.instance();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:4,代码来源:SingletonScope.java


注:本文中的act.app.App.instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。