Package org.sf.bee.commons.remoting.jrpc.reflect

Examples of org.sf.bee.commons.remoting.jrpc.reflect.ClassData


            throws NoSuchMethodException {
        final Map result = new HashMap();
        // if it is not an object
        if (objectID == 0) {
            final ObjectInstance instance = this.resolveObject(className);
            final ClassData classData = this.resolveClass(className);

            if (null == instance && null == classData) {
                throw new NoSuchMethodException(JSONRPCResult.MSG_ERR_NOMETHOD);
            }

            // Look up the class, object instance and method objects
            if (instance != null) {
                final ClassData cd = ClassAnalyzer.getInstance().getClassData(
                        instance.getClazz());
                result.putAll(cd.getMethodMap());
            } else if (methodName.equals(CONSTRUCTOR_FLAG)) {
                // try to get the constructor data
                try {
                    final ClassData cd = ClassAnalyzer.getInstance().getClassData(
                            this.lookupClass(className));
                    result.putAll(cd.getConstructorMap());
                } catch (Exception e) {
                    throw new NoSuchMethodException(JSONRPCResult.MSG_ERR_NOCONSTRUCTOR);
                }
            } else if (classData != null) {
                // else it must be static
                result.putAll(classData.getStaticMethodMap());
            }
        } else {
            // else it is an object, so we can get the member methods
            final ObjectInstance oi = this.resolveObject(objectID);
            if (oi == null) {
                throw new NoSuchMethodException();
            }
            ClassData cd = ClassAnalyzer.getInstance().getClassData(oi.getClazz());
            result.putAll(cd.getMethodMap());
        }
        return result;
    }
View Full Code Here


     * @return The data associated with the className
     */
    private ClassData resolveClass(final String className) {
        final Logger logger = this.getLogger();
        Class clazz;
        ClassData cd = null;

        synchronized (_classMap) {
            clazz = (Class) _classMap.get(className);
        }

        if (clazz != null) {
            cd = ClassAnalyzer.getInstance().getClassData(clazz);
        }

        if (cd != null) {
            if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.FINE,
                        "found class {0} named {1}",
                        new Object[]{
                            cd.getClazz().getName(),
                            className});
            }
            return cd;
        }

View Full Code Here

TOP

Related Classes of org.sf.bee.commons.remoting.jrpc.reflect.ClassData

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.