• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java NotAppliedException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.osgl.exception.NotAppliedException的典型用法代码示例。如果您正苦于以下问题:Java NotAppliedException类的具体用法?Java NotAppliedException怎么用?Java NotAppliedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NotAppliedException类属于org.osgl.exception包,在下文中一共展示了NotAppliedException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: apply

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Override
public Void apply(Class<?> clazz, Method method) throws NotAppliedException, $.Break {
    if (null != method.getAnnotation(Catch.class)) {
        // skip exception catch method
        return null;
    }
    if (hasAnnotation(RequireAuthentication.class, clazz, method) || hasAnnotation(RequireAuthenticate.class, clazz, method)) {
        requireAuthentication = true;
        throw $.breakOut(true);
    }
    if (hasAnnotation(NoAuthentication.class, clazz, method) || hasAnnotation(NoAuthenticate.class, clazz, method)) {
        return null;
    }
    String actionName = S.builder(clazz.getName()).append(".").append(method.getName()).toString();
    requireAuthentication = requireAuthentication(actionName);
    if (requireAuthentication) {
        throw $.breakOut(true);
    }
    return null;
}
 
开发者ID:actframework,项目名称:act-aaa-plugin,代码行数:21,代码来源:AAAService.java


示例2: beforeHandler

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Override
public $.Function<ActionContext, Result> beforeHandler(final Class<?> controllerClass, final Method actionMethod) {
    int size = controllerPlugins.size();
    switch (size) {
        case 0:
            return super.beforeHandler(controllerClass, actionMethod);
        case 1:
            return controllerPlugins.get(0).beforeHandler(controllerClass, actionMethod);
        default:
            return new $.Function<ActionContext, Result>() {
                @Override
                public Result apply(ActionContext context) throws NotAppliedException, Osgl.Break {
                    for (ControllerPlugin plugin: controllerPlugins) {
                        Result result = plugin.beforeHandler(controllerClass, actionMethod).apply(context);
                        if (null != result) {
                            return result;
                        }
                    }
                    return null;
                }
            };
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:24,代码来源:ControllerPlugin.java


示例3: afterHandler

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Override
public $.Func2<Result, ActionContext, Result> afterHandler(final Class<?> controllerClass, final Method actionMethod) {
    int size = controllerPlugins.size();
    switch (size) {
        case 0:
            return super.afterHandler(controllerClass, actionMethod);
        case 1:
            return controllerPlugins.get(0).afterHandler(controllerClass, actionMethod);
        default:
            return new $.Func2<Result, ActionContext, Result>() {
                @Override
                public Result apply(Result result, ActionContext context) throws NotAppliedException, Osgl.Break {
                    for (ControllerPlugin plugin: controllerPlugins) {
                        result = plugin.afterHandler(controllerClass, actionMethod).apply(result, context);
                    }
                    return result;
                }
            };
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:21,代码来源:ControllerPlugin.java


示例4: apply

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Override
public String apply() throws NotAppliedException, Osgl.Break {
    ActContext context = ActContext.Base.currentContext();
    E.illegalStateIf(null == context, "Cannot get full action path reference outside of act context");
    /*
     * try to determine if the template is free or bounded template
     */
    if (context.templatePathIsImplicit()) {
        return context.methodPath();
    } else {
        String path = context.templatePath();
        path = org.osgl.util.S.beforeLast(path, ".");
        if (!isTemplateBounded(path, context.methodPath())) {
            return context.methodPath();
        }
        return path.replace('/', '.');
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:19,代码来源:Tags.java


示例5: Job

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
Job(String id, JobManager manager, final Callable<?> callable) {
    this.id = id;
    this.manager = $.notNull(manager);
    this.oneTime = true;
    this.app = manager.app();
    this.jobProgressTag = wsJobProgressTag(id);
    this.manager.addJob(this);
    this.worker = new F0() {
        @Override
        public Object apply() throws NotAppliedException, Osgl.Break {
            try {
                callableResult = callable.call();
            } catch (Exception e) {
                callableException = e;
            }
            return null;
        }
    };
}
 
开发者ID:actframework,项目名称:actframework,代码行数:20,代码来源:Job.java


示例6: setRenderJsonContenTypeIE

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
private void setRenderJsonContenTypeIE(final String contentType) {
    if (H.Format.JSON.contentType().equalsIgnoreCase(contentType)) {
        renderJsonIeFix = false;
        return;
    }
    renderJsonIeFix = true;
    jsonIE = H.Format.of("json_ie", contentType);
    jsonContentTypeProvider = new Osgl.Func0<H.Format>() {
        @Override
        public H.Format apply() throws NotAppliedException, Osgl.Break {
            ActionContext context = ActionContext.current();
            if (null != context) {
                UserAgent ua = context.userAgent();
                if (ua.isIE()) {
                    return jsonIE;
                }
            }
            return H.Format.JSON;
        }
    };
}
 
开发者ID:actframework,项目名称:actframework,代码行数:22,代码来源:AppConfig.java


示例7: buildEnumPropertyGetters

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
private static Map<String, $.Function<Object, Object>> buildEnumPropertyGetters(Class<? extends Enum> enumClass) {
    Map<String, $.Function<Object, Object>> map = new HashMap<>();
    for (final Method method : enumClass.getMethods()) {
        if (void.class == method.getReturnType() || Void.class == method.getReturnType() || Modifier.isStatic(method.getModifiers()) || method.getParameterTypes().length > 0) {
            continue;
        }
        String name = propertyName(method);
        if (standardsAnnotationMethods.contains(name)) {
            continue;
        }
        map.put(method.getName(), new Osgl.Function<Object, Object>() {
            @Override
            public Object apply(Object o) throws NotAppliedException, Osgl.Break {
                return $.invokeVirtual(o, method);
            }
        });
    }
    return map;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:20,代码来源:I18n.java


示例8: apply

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Override
public Void apply(H.Request request, H.Response response, ErrorResult error
) throws NotAppliedException, $.Break {
    H.Format fmt = request.accept();
    if (request.isAjax() && fmt == H.Format.HTML) {
        fmt = H.Format.TXT;
    }
    MvcConfig.applyBeforeCommitResultHandler(error, request, response);
    String s = renderTemplate(error, fmt);
    if (null != s) {
        response.writeContent(s);
    } else {
        IO.close(response.outputStream());
    }
    MvcConfig.applyAfterCommitResultHandler(error, request, response);
    return null;
}
 
开发者ID:osglworks,项目名称:java-mvc,代码行数:18,代码来源:ErrorPageRenderer.java


示例9: testComposeWithFunc5

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Test
public void testComposeWithFunc5() {
    String randStr2 = newRandStr(), randStr3 = newRandStr(),
           randStr4 = newRandStr(), randStr5 = newRandStr();
    $.Func5<String, String, String, String, String, String> concat;
    concat = new $.Func5<String, String, String, String, String, String>() {
        @Override
        public String apply(String s, String s2, String s3, String s4, String s5)
        throws NotAppliedException, $.Break {
            return s + s2 + s3 + s4 + s5;
        }
    };
    int expectedLen = randStrLen + randStr2.length()
            + randStr3.length() + randStr4.length() + randStr5.length();
    eq(expectedLen, S.F.LENGTH.compose(concat).apply(randStr, randStr2, randStr3, randStr4, randStr5));
}
 
开发者ID:osglworks,项目名称:java-tool,代码行数:17,代码来源:F1Test.java


示例10: apply

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Override
public String apply(H.Request request, String s) throws NotAppliedException, Osgl.Break {
    if (s.length() < contextLen || !s.startsWith(context)) {
        throw NotFound.get();
    }
    return s.substring(contextLen, s.length());
}
 
开发者ID:actframework,项目名称:actframework,代码行数:8,代码来源:NetworkHandler.java


示例11: ContextualJob

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
ContextualJob(String id, final Runnable runnable) {
    super(id, JobManager.this, new $.F0() {
        @Override
        public Object apply() throws NotAppliedException, $.Break {
            runnable.run();
            return null;
        }
    }, true);
    foo();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:11,代码来源:JobManager.java


示例12: scheduleDelayedRegister

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
private void scheduleDelayedRegister(final JobManager manager, final Job job) {
    final String id = delayedRegisterJobId(job);
    before(START).register(new Job(id, manager, new $.F0<Void>() {
        @Override
        public Void apply() throws NotAppliedException, $.Break {
            Job associateTo = manager.jobById(id);
            if (null == associateTo) {
                LOGGER.warn("Cannot find associated job: %s", id);
            } else {
                associate(job, associateTo);
            }
            return null;
        }
    }), manager);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:16,代码来源:JobTrigger.java


示例13: of

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
private static Job of(String jobId, final Runnable runnable, JobManager manager, boolean oneTime) {
    return new Job(jobId, manager, new F0() {
        @Override
        public Object apply() throws NotAppliedException, $.Break {
            runnable.run();
            return null;
        }
    }, oneTime);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:10,代码来源:Job.java


示例14: apply

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Override
public Object apply() throws NotAppliedException, $.Break {
    if (null == jobClass) {
        init();
    }
    if (disabled) {
        return null;
    }
    JobContext ctx = JobContext.current();
    ctx.handlerMethod(method);
    Object job = jobClassInstance(app, ctx);
    return invoke(job, ctx);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:14,代码来源:ReflectedJobInvoker.java


示例15: AutoConfigPlugin

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
public AutoConfigPlugin() {
    super(true, false, AutoConfig.class, new $.F2<App, String, Map<Class<? extends AppByteCodeScanner>, Set<String>>>() {
        @Override
        public Map<Class<? extends AppByteCodeScanner>, Set<String>> apply(final App app, final String className) throws NotAppliedException, $.Break {
            app.eventBus().bind(SysEventId.PRE_START, new SysEventListenerBase() {
                @Override
                public void on(EventObject event) throws Exception {
                    Class<?> autoConfigClass = $.classForName(className, app.classLoader());
                    new AutoConfigLoader(app, autoConfigClass).load();
                }
            });
            return null;
        }
    });
}
 
开发者ID:actframework,项目名称:actframework,代码行数:16,代码来源:AutoConfigPlugin.java


示例16: apply

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Override
public String apply(ActionContext context) throws NotAppliedException, Osgl.Break {
    TreeMap<String, String> keyValues = keyValues(context);
    S.Buffer buffer = S.newBuffer(base);
    for (Map.Entry<String, String> entry : keyValues.entrySet()) {
        buffer.append("-").append(entry.getKey()).append(":").append(entry.getValue());
    }
    buffer.append(context.userAgent().isMobile() ? "M" : "B");
    return buffer.toString();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:11,代码来源:ReflectedHandlerInvoker.java


示例17: apply

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
@Override
public Void apply(Result result, H.Request<?> request, H.Response<?> response) throws NotAppliedException, Osgl.Break {
    ActionContext context = request.context();
    context.applyCorsSpec().applyContentSecurityPolicy().applyContentType(result);
    context.app().eventBus().emit(new BeforeResultCommit(result, request, response));
    return null;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:8,代码来源:ResultEvent.java


示例18: prependContext

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
private Set<String> prependContext(C.Set<String> paths) {
    return C.set(paths.map(new $.F1<String, String>() {
        @Override
        public String apply(String s) throws NotAppliedException, $.Break {
            return context + s;
        }
    }));
}
 
开发者ID:actframework,项目名称:actframework,代码行数:9,代码来源:FsChangeDetector.java


示例19: ConfigKeyHelper

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
public ConfigKeyHelper($.F0<Act.Mode> mode, final ClassLoader cl) {
    this.mode = mode;
    this.classLoaderProvider = new $.F0<ClassLoader>() {
        @Override
        public ClassLoader apply() throws NotAppliedException, $.Break {
            return cl;
        }
    };
}
 
开发者ID:actframework,项目名称:actframework,代码行数:10,代码来源:ConfigKeyHelper.java


示例20: getConfiguration

import org.osgl.exception.NotAppliedException; //导入依赖的package包/类
<T> T getConfiguration(final ConfigKey confKey, Map<String, ?> configuration) {
    String key = confKey.key();
    $.F0<?> defVal = new $.F0<Object>() {
        @Override
        public Object apply() throws NotAppliedException, $.Break {
            return confKey.defVal();
        }
    };
    return getConfiguration(key, defVal, configuration);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:11,代码来源:ConfigKeyHelper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PackagingElement类代码示例发布时间:2022-05-23
下一篇:
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap