Examples of RsfException


Examples of net.hasor.rsf.general.RsfException

        //
        String[] paramTypes = this.getParameterTypes();
        Object[] paramObject = new Object[paramTypes.length];
        //
        if (decoder == null && (paramTypes.length > 0)) {
            throw new RsfException(ProtocolStatus.SerializeError,//
                    "Undefined ‘" + codeName + "’ serialize decoder ");
        }
        //
        for (int i = 0; i < paramTypes.length; i++) {
            byte[] paramData = this.paramDatas.get(i);
View Full Code Here

Examples of net.hasor.rsf.general.RsfException

    //
    public void init() throws RsfException {
        //1.获取MetaData
        this.metaData = this.rsfContext.getService(requestMsg.getServiceName());
        if (this.metaData == null) {
            throw new RsfException(ProtocolStatus.NotFound, "service was not found.");
        }
        //2.反序列化
        String[] pTypes = this.requestMsg.getParameterTypes();
        try {
            SerializeFactory serializeFactory = this.rsfContext.getSerializeFactory();
            this.parameterObjects = this.requestMsg.toParameters(serializeFactory);
            //
            this.parameterTypes = new Class<?>[pTypes.length];
            for (int i = 0; i < pTypes.length; i++) {
                this.parameterTypes[i] = ProtocolUtils.toJavaType(pTypes[i], Thread.currentThread().getContextClassLoader());
            }
        } catch (RsfException e) {
            throw e;
        } catch (Throwable e) {
            throw new RsfException(ProtocolStatus.SerializeError, e);
        }
        //3.check Forbidden
        this.targetMethod = this.metaData.getServiceMethod(this.requestMsg.getTargetMethod(), pTypes, this.parameterTypes);
        if (this.targetMethod == null) {
            throw new RsfException(ProtocolStatus.Forbidden, "undefined service.");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.