Package org.apache.axis.utils.cache

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


    }

    public synchronized void registerClass( String name, Class cls ) {
        /* And finally register it */
        /***************************/
        JavaClass oldClass = (JavaClass)classCache.get(name);
        if (oldClass!=null && oldClass.getJavaClass()==cls) return;
        classCache.put( name, new JavaClass(cls) );
    }
View Full Code Here


     * if necessary.
     * @param className name of the class desired
     * @return JavaClass entry
     */
    public JavaClass lookup(String className) throws ClassNotFoundException {
        JavaClass jc = (JavaClass) classCache.get( className );
        if ( jc == null ) {
            loadClass( className );
            jc = (JavaClass) classCache.get( className );
        }

View Full Code Here

    }

    public void testGetJavaClass()
    {
        Class c = new java.util.Date().getClass();
        JavaClass jc = new JavaClass(c);
        assertNotNull(jc);
        assertTrue(jc.getJavaClass().getName().equals("java.util.Date"));
        assertTrue(!jc.getJavaClass().getName().equals("java.util.D"));
    }
View Full Code Here

    public void testGetMethod()
    {
        Class v = new java.util.Vector().getClass();
        Class st = new java.util.StringTokenizer("some string").getClass();
        JavaClass jcVec = new JavaClass(v);
        JavaClass jcST = new JavaClass(st);

        Method countTkns = jcST.getMethod("countTokens", 0);
        Method nextTkn = jcST.getMethod("nextToken", 1);

        Method add1 = jcVec.getMethod("add", 1);
        Method add2 = jcVec.getMethod("add", 2);

        assertEquals("countTokens", countTkns.getName());
View Full Code Here

    }

    public void testNoSuchMethod()
    {
        Class v = new java.util.Vector().getClass();
        JavaClass jcVec = new JavaClass(v);

        Method add7 = jcVec.getMethod("add", 7);
        assertNull(add7);
    }
View Full Code Here

    }

    public void testUnknownNumberOfArgs()
    {
        Class v = new java.util.Vector().getClass();
        JavaClass jcVec = new JavaClass(v);

        Method add7 = jcVec.getMethod("add", -1);
        assertNull(add7);

        Method insertElementAt = jcVec.getMethod("insertElementAt", -1);
        assertEquals(2, insertElementAt.getParameterTypes().length);
        assertEquals("void", insertElementAt.getReturnType().getName());
    }
View Full Code Here

    }

    public void testLookup() throws ClassNotFoundException
    {
  AxisClassLoader acl = AxisClassLoader.getClassLoader();
        JavaClass jc = acl.lookup("java.util.BitSet"); //BitSet was chosen arbitrarily
        Class c = jc.getJavaClass();
        assertTrue(c.getName().equals("java.util.BitSet"));
    }
View Full Code Here

        // 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);
            }
        } else {
View Full Code Here

                                             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

                                             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

TOP

Related Classes of org.apache.axis.utils.cache.JavaClass

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.