Package com.alibaba.dubbo.validation

Examples of com.alibaba.dubbo.validation.Validator


    }

    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        if (validation != null && ! invocation.getMethodName().startsWith("$")
                && ConfigUtils.isNotEmpty(invoker.getUrl().getMethodParameter(invocation.getMethodName(), Constants.VALIDATION_KEY))) {
            Validator validator = validation.getValidator(invoker.getUrl());
            if (validator != null) {
                try {
                validator.validate(invocation);
                } catch (RpcException e) {
                    throw e;
                } catch (Throwable t) {
                    throw new RpcException(t.getMessage(), t);
                }
View Full Code Here


    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        if (validation != null && ! invocation.getMethodName().startsWith("$")
                && ConfigUtils.isNotEmpty(invoker.getUrl().getMethodParameter(invocation.getMethodName(), Constants.VALIDATION_KEY))) {
            try {
                Validator validator = validation.getValidator(invoker.getUrl());
                if (validator != null) {
                    validator.validate(invocation.getMethodName(), invocation.getParameterTypes(), invocation.getArguments());
                }
            } catch (RpcException e) {
                throw e;
            } catch (Throwable t) {
                throw new RpcException(t.getMessage(), t);
View Full Code Here

    private final ConcurrentMap<String, Validator> validators = new ConcurrentHashMap<String, Validator>();

    public Validator getValidator(URL url) {
        String key = url.toFullString();
        Validator validator = validators.get(key);
        if (validator == null) {
            validators.put(key, createValidator(url));
            validator = validators.get(key);
        }
        return validator;
View Full Code Here

        this.validation = validation;
    }

    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        if (validation != null && ConfigUtils.isNotEmpty(invoker.getUrl().getMethodParameter(invocation.getMethodName(), Constants.VALIDATION_KEY))) {
            Validator validator = validation.getValidator(invoker.getUrl());
            if (validator != null) {
                try {
                    validator.validate(invocation);
                } catch (RpcException e) {
                    throw e;
                } catch (Throwable t) {
                    throw new RpcException(t.getMessage(), t);
                }
View Full Code Here

TOP

Related Classes of com.alibaba.dubbo.validation.Validator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.