Examples of ClassCache


Examples of io.apigee.trireme.core.ClassCache

        }

        private static Script getCompiledScript(Context cx, String code, String fileName)
        {
            ScriptRunner runner = (ScriptRunner)cx.getThreadLocal(ScriptRunner.RUNNER);
            ClassCache cache = runner.getEnvironment().getClassCache();

            if (cache == null) {
                return compileScript(cx, code, fileName);
            }

            String cacheKey = makeCacheKey(code);
            Script compiled = cache.getCachedScript(cacheKey);
            if (compiled == null) {
                compiled = compileScript(cx, code, fileName);
                if (compiled != null) {
                    cache.putCachedScript(cacheKey, compiled);
                }
            }
            // Still may be null at this point...
            return compiled;
        }
View Full Code Here

Examples of ognl.internal.ClassCache

        return result;
    }

    public static Map getMethods(Class targetClass, boolean staticMethods)
    {
        ClassCache cache = (staticMethods ? _staticMethodCache : _instanceMethodCache);
        Map result;

        synchronized (cache)
        {
            if ((result = (Map) cache.get(targetClass)) == null)
            {
                cache.put(targetClass, result = new HashMap(23));

                for (Class c = targetClass; c != null; c = c.getSuperclass())
                {
                    Method[] ma = c.getDeclaredMethods();
View Full Code Here

Examples of ognl.internal.ClassCache

    }

    public static List getDeclaredMethods(Class targetClass, String propertyName, boolean findSets)
    {
        List result = null;
        ClassCache cache = _declaredMethods[findSets ? 0 : 1];

        synchronized (cache) {
            Map propertyCache = (Map) cache.get(targetClass);

            if ((propertyCache == null) || ((result = (List) propertyCache.get(propertyName)) == null)) {

                String baseName = Character.toUpperCase(propertyName.charAt(0)) + propertyName.substring(1);

                for (Class c = targetClass; c != null; c = c.getSuperclass()) {
                    Method[] methods = c.getDeclaredMethods();

                    for (int i = 0; i < methods.length; i++) {

                        if (!isMethodCallable(methods[i]))
                            continue;

                        String ms = methods[i].getName();

                        if (ms.endsWith(baseName)) {
                            boolean isSet = false, isIs = false;

                            if ((isSet = ms.startsWith(SET_PREFIX)) || ms.startsWith(GET_PREFIX)
                                || (isIs = ms.startsWith(IS_PREFIX))) {
                                int prefixLength = (isIs ? 2 : 3);

                                if (isSet == findSets) {
                                    if (baseName.length() == (ms.length() - prefixLength)) {
                                        if (result == null) {
                                            result = new ArrayList();
                                        }
                                        result.add(methods[i]);
                                    }
                                }
                            }
                        }
                    }
                }
                if (propertyCache == null) {
                    cache.put(targetClass, propertyCache = new HashMap(101));
                }

                propertyCache.put(propertyName, (result == null) ? NotFoundList : result);
            }
            return (result == NotFoundList) ? null : result;
View Full Code Here

Examples of org.apache.axis.utils.cache.ClassCache

    protected Object makeNewServiceObject(MessageContext msgContext,
                                             String clsName)
        throws Exception
    {
        ClassLoader cl     = msgContext.getClassLoader();
        ClassCache cache   = msgContext.getAxisEngine().getClassCache();
        JavaClass  jc      = cache.lookup(clsName, cl);

        return jc.getJavaClass().newInstance();
    }
View Full Code Here

Examples of org.apache.axis.utils.cache.ClassCache

        // otherwise get the current threads classloader
        cl = Thread.currentThread().getContextClassLoader();

        // If we have an engine, use its class cache
        if (engine != null) {
            ClassCache cache     = engine.getClassCache();
            try {
                JavaClass jc = cache.lookup(clsName, cl);
                serviceClass = jc.getJavaClass();
            } catch (ClassNotFoundException e) {
                log.error(Messages.getMessage("exception00"), e);
                throw new AxisFault(Messages.getMessage("noClassForService00", clsName), e);
            }
View Full Code Here

Examples of org.apache.axis.utils.cache.ClassCache

    protected Object makeNewServiceObject(MessageContext msgContext,
                                             String clsName)
        throws Exception
    {
        ClassLoader cl     = msgContext.getClassLoader();
        ClassCache cache   = msgContext.getAxisEngine().getClassCache();
        JavaClass  jc      = cache.lookup(clsName, cl);

        return jc.getJavaClass().newInstance();
    }
View Full Code Here

Examples of org.apache.axis.utils.cache.ClassCache

        // otherwise get the current threads classloader
        cl = Thread.currentThread().getContextClassLoader();

        // If we have an engine, use its class cache
        if (engine != null) {
            ClassCache cache     = engine.getClassCache();
            try {
                JavaClass jc = cache.lookup(clsName, cl);
                serviceClass = jc.getJavaClass();
            } catch (ClassNotFoundException e) {
                log.error(JavaUtils.getMessage("exception00"), e);
                throw new AxisFault(JavaUtils.getMessage("noClassForService00", clsName), e);
            }
View Full Code Here

Examples of org.apache.axis.utils.cache.ClassCache

    protected Object getNewServiceObject(MessageContext msgContext,
                                             String clsName)
        throws Exception
    {
        ClassLoader cl     = msgContext.getClassLoader();
        ClassCache cache   = msgContext.getAxisEngine().getClassCache();
        JavaClass  jc      = cache.lookup(clsName, cl);

        return jc.getJavaClass().newInstance();
    }
View Full Code Here

Examples of org.apache.axis.utils.cache.ClassCache

                    cl = Thread.currentThread().getContextClassLoader();
                } else {
                    cl = msgContext.getClassLoader();
                }
                if (engine != null) {
                    ClassCache cache     = engine.getClassCache();
                    JavaClass       jc   = null;
                    try {
                        jc = cache.lookup(clsName, cl);
                        serviceDescription.setImplClass(jc.getJavaClass());
                    } catch (ClassNotFoundException e) {
                        return null;
                    }
                } else {
View Full Code Here

Examples of org.apache.axis.utils.cache.ClassCache

    protected Object makeNewServiceObject(MessageContext msgContext,
                                          String clsName)
            throws Exception {

        ClassLoader cl = msgContext.getClassLoader();
        ClassCache cache = msgContext.getAxisEngine().getClassCache();
        Class svcClass = cache.lookup(clsName, cl).getJavaClass();

        return instantiateService(svcClass, msgContext);

    }
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.