Examples of HproseMethods


Examples of hprose.common.HproseMethods

    protected HproseMethods globalMethods = null;
    private HproseFilter filter = null;

    public HproseMethods getGlobalMethods() {
        if (globalMethods == null) {
            globalMethods = new HproseMethods();
        }
        return globalMethods;
    }
View Full Code Here

Examples of hprose.common.HproseMethods

            }
            catch (Exception ex) {
                throw new ServletException(ex);
            }
        }
        HproseMethods methods = service.getGlobalMethods();
        param = config.getInitParameter("class");
        if (param != null) {
            try {
                String[] classNames = HproseHelper.split(param, ',', 0);
                for (int i = 0, n = classNames.length; i < n; i++) {
                    String[] name = HproseHelper.split(classNames[i], '|', 3);
                    Class type = Class.forName(name[0]);
                    Object obj = type.newInstance();
                    Class ancestorType;
                    if (name.length == 1) {
                        methods.addInstanceMethods(obj, type);
                    }
                    else if (name.length == 2) {
                        for (ancestorType = Class.forName(name[1]);
                             ancestorType.isAssignableFrom(type);
                             type = type.getSuperclass()) {
                            methods.addInstanceMethods(obj, type);
                        }
                    }
                    else if (name.length == 3) {
                        if (name[1].equals("")) {
                            methods.addInstanceMethods(obj, type, name[2]);
                        }
                        else {
                            for (ancestorType = Class.forName(name[1]);
                                 ancestorType.isAssignableFrom(type);
                                 type = type.getSuperclass()) {
                                methods.addInstanceMethods(obj, type, name[2]);
                            }
                        }
                    }
                }
            }
            catch (Exception ex) {
                throw new ServletException(ex);
            }
        }
        param = config.getInitParameter("staticClass");
        if (param != null) {
            try {
                String[] classNames = HproseHelper.split(param, ',', 0);
                for (int i = 0, n = classNames.length; i < n; i++) {
                    String[] name = HproseHelper.split(classNames[i], '|', 2);
                    Class type = Class.forName(name[0]);
                    if (name.length == 1) {
                        methods.addStaticMethods(type);
                    }
                    else {
                        methods.addStaticMethods(type, name[1]);
                    }
                }
            }
            catch (Exception ex) {
                throw new ServletException(ex);
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.