Git Product home page Git Product logo

melbshark / jrouter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tripluo/jrouter

0.0 2.0 0.0 255 KB

jrouter is an open source lightweight method router processing container implemented entirely in Java. It focuses on methods' mapping, invoking, intercepting and result processing. You can use it to search and collect your application objects' methods for HTTP controller, Web services, RPC, a variety of applications, etc.

Home Page: http://www.jrouter.net/

Java 100.00%

jrouter's Introduction

jrouter is an open source lightweight method router processing container implemented entirely in Java. It focuses on methods' mapping, invoking, intercepting and result processing. You can use it to search and collect your application objects' methods for HTTP controller, Web services, RPC, a variety of applications, etc.

jrouter 是一个基于对象方法架构的开源轻量级Java容器。它专注于方法的映射、调用、拦截和结果处理,采用基于配置和注解的方式来抽取和收集程序中对象的方法(method)以用于HTTP控制器,Web服务,RPC,各种应用等。

针对方法,提供基于注解(@Annotation)的配置:

★ 命名空间(Namespace)

★ 行为定义(Action)

★ 拦截器(Interceptor)

★ 拦截栈(InterceptorStack)

★ 结果对象(Result)

★ 结果类型(ResultType)

outline

● require jdk 1.6+

● require slf4j

changelog

Maven:

<dependency>
    <groupId>net.jrouter</groupId>
    <artifactId>jrouter</artifactId>
    <version>1.7.2</version>
</dependency>

Springframework Integration:

<!-- JRouter ActionFactory -->
<bean id="actionFactory" class="jrouter.spring.DefaultActionFactoryBean">
    <!-- optional default:null -->
    <property name="configLocation" value="classpath:jrouter.xml" />
    <!-- optional default -->
    <property name="actionFactoryClass" value="jrouter.impl.DefaultActionFactory"/>
    <!-- optional default -->
    <property name="objectFactory">
        <bean class="jrouter.spring.SpringObjectFactory"/>
    </property>
    <!-- optional default -->
    <property name="actionFactoryProperties">
        <value>
            <!-- optional default:null deprecated since 1.6.6 -->
            <!--actionInvocationClass = jrouter.impl.DefaultActionInvocation-->
            <!-- optional default:null -->
            defaultInterceptorStack = empty
            <!-- optional default:null -->
            defaultResultType = empty
            <!-- optional default -->
            pathSeparator = /
            <!-- optional default -->
            extension = .
            <!-- optional default -->
            actionCacheNumber = 10000
            <!-- optional default -->
            bytecode = javassist
            <!-- optional default -->
            converterFactory = jrouter.impl.MultiParameterConverterFactory
            <!-- optional default:null -->
            interceptorMethodChecker = jrouter.ActionInvocation.invoke(**)|jrouter.ActionInvocation.invokeActionOnly(**)
        </value>
    </property>

    <!-- scan classes properties -->
    <property name="componentClassScanProperties">
        <list>
            <value>
                <!-- required -->
                package = jrouter
                <!-- optional, if empty means all -->
                includeExpression = jrouter.impl.**
                <!-- optional -->
                excludeExpression = jrouter.result.**, jrouter.interceptor.**
            </value>
        </list>
    </property>

    <property name="interceptors">
        <list>
            <!-- the value can be the class name or the ref bean: -->
            <value>jrouter.interceptor.SampleInterceptor</value>
        </list>
    </property>
    <property name="interceptorStacks">
        <list>
            <!-- the value can be the class name or the ref bean: -->
            <value>jrouter.interceptor.DefaultInterceptorStack</value>
        </list>
    </property>
    <property name="resultTypes">
        <list>
            <!-- the value can be the class name or the ref bean: -->
            <value>jrouter.result.DefaultResult</value>
        </list>
    </property>
    <property name="results">
        <list>
            <!-- the value can be the class name or the ref bean: -->
            <value>jrouter.result.DefaultResult</value>
        </list>
    </property>
    <property name="actions">
        <list>
            <!-- the value can be the class name or the ref bean: -->
        </list>
    </property>
    <property name="componentBeanScanProperties">
        <value>
            <!-- required -->
            includeComponentBeanExpression =
            <!-- optional -->
            excludeComponentBeanExpression =
            <!-- optional -->
            includeComponentClassExpression =
            <!-- optional -->
            excludeComponentClassExpression =
        </value>
    </property>

    <property name="aopActions">
        <list>
            <bean class="jrouter.spring.AopActionBean">
                <property name="matches" value="/**"/>
                <property name="interceptorStackNames" value="empty"/>
                <property name="interceptorNames" value=""/>
                <property name="typeName" value="add-before"/>
            </bean>
        </list>
    </property>
</bean>

jrouter's People

Contributors

tripluo avatar

Watchers

James Cloos avatar melbshark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.