Examples of AxisClassLoader


Examples of org.apache.axis.utils.AxisClassLoader

     */
    protected Object getNewServiceObject(MessageContext msgContext,
                                             String clsName)
        throws Exception
    {
        AxisClassLoader cl     = msgContext.getClassLoader();
        JavaClass       jc     = cl.lookup(clsName);

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

Examples of org.apache.axis.utils.AxisClassLoader

            setCurrentMessageContext(msgContext);

            hName = msgContext.getStrProp( MessageContext.ENGINE_HANDLER );
            if ( hName != null ) {
                if ( (h = getHandler(hName)) == null ) {
                    AxisClassLoader cl = msgContext.getClassLoader();
                    try {
                        category.debug( JavaUtils.getMessage("tryingLoad00", hName) );
                        Class cls = cl.loadClass( hName );
                        h = (Handler) cls.newInstance();
                    }
                    catch( Exception e ) {
                        h = null ;
                    }
View Full Code Here

Examples of org.apache.axis.utils.AxisClassLoader

        try {
            hName = msgContext.getStrProp( MessageContext.ENGINE_HANDLER );
            if ( hName != null ) {
                if ( (h = getHandler(hName)) == null ) {
                    AxisClassLoader cl = msgContext.getClassLoader();
                    try {
                        category.debug( JavaUtils.getMessage("tryingLoad00", hName) );
                        Class cls = cl.loadClass( hName );
                        h = (Handler) cls.newInstance();
                    }
                    catch( Exception e ) {
                        throw new AxisFault(
                                "Server.error",
View Full Code Here

Examples of org.apache.axis.utils.AxisClassLoader

        if (service == null) return;

        String  clsName    = (String) service.getOption( "className" );

        try {
            AxisClassLoader cl     = msgContext.getClassLoader();
            JavaClass       jc     = cl.lookup(clsName);
            Class           cls    = jc.getJavaClass();
           
            if (category.isDebugEnabled()) {
                category.debug(JavaUtils.getMessage(
                        "lookup00", methodName, clsName));
View Full Code Here

Examples of org.apache.axis.utils.AxisClassLoader

    protected void setup() {
    }
   
    public void testGetClassLoaderNoArg()
    {
  AxisClassLoader expect = AxisClassLoader.getClassLoader();
  AxisClassLoader actual = AxisClassLoader.getClassLoader();
        assertTrue("Did not get AxisClassLoader", expect instanceof AxisClassLoader);
        assertEquals("AxisClassLoader returned two different instances.", expect, actual);
    }
View Full Code Here

Examples of org.apache.axis.utils.AxisClassLoader

        assertEquals("AxisClassLoader returned two different instances.", expect, actual);
    }

    public void testRegisterClassNameClass()
    {
  AxisClassLoader acl = AxisClassLoader.getClassLoader();
        java.util.Stack stack = new java.util.Stack(); //Stack was chosen arbitrarily
        Class clazz = stack.getClass();
        acl.registerClass("myStack",clazz);
        assertTrue("myStack is not registered properly", acl.isClassRegistered("myStack"));
    }
View Full Code Here

Examples of org.apache.axis.utils.AxisClassLoader

        assertTrue("myStack is not registered properly", acl.isClassRegistered("myStack"));
    }

    public void testIsClassRegistered()
    {
  AxisClassLoader acl = AxisClassLoader.getClassLoader();
        java.util.Stack stack = new java.util.Stack(); //Stack was chosen arbitrarily
        Class clazz = stack.getClass();
        acl.registerClass("anotherStack",clazz);
        if (acl.isClassRegistered("noStack"))
        {
            fail("Nonce class name should not be registered.");
        }
        assertTrue("anotherStack was not properly registered.", acl.isClassRegistered("anotherStack"));
    }
View Full Code Here

Examples of org.apache.axis.utils.AxisClassLoader

        assertTrue("anotherStack was not properly registered.", acl.isClassRegistered("anotherStack"));
    }

    public void testDeregisterClass()
    {
  AxisClassLoader acl = AxisClassLoader.getClassLoader();
        java.util.Stack stack = new java.util.Stack(); //Stack was chosen arbitrarily
        Class clazz = stack.getClass();
        acl.registerClass("myStack",clazz);
        assertTrue("myStack was not properly registered.", acl.isClassRegistered("myStack"));
        acl.deregisterClass("myStack");
        if (acl.isClassRegistered("myStack"))
        {
            fail("myStack class should have been deregistered.");
        }
    }
View Full Code Here

Examples of org.apache.axis.utils.AxisClassLoader

        }
    }

    public void testLoadClass() throws ClassNotFoundException
    {
  AxisClassLoader acl = AxisClassLoader.getClassLoader();
        Class clazz = acl.loadClass("java.util.BitSet"); //BitSet was chosen arbitrarily
        assertTrue("Could not properly load the class \"java.util.BitSet\"", clazz.getName().equals("java.util.BitSet"));

        java.util.Stack stack = new java.util.Stack(); //Stack was chosen arbitrarily
        Class clazz1 = stack.getClass();
        acl.registerClass("myStack",clazz1);
        Class klass = acl.loadClass("myStack");
        assertTrue("The myStack class was not \"java.util.Stack\"", klass.getName().equals("java.util.Stack"));
    }
View Full Code Here

Examples of org.apache.axis.utils.AxisClassLoader

        assertTrue("The myStack class was not \"java.util.Stack\"", klass.getName().equals("java.util.Stack"));
    }

    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("The class is not the expected \"java.util.BitSet\", instead it was \"" + c.getName() + "\"",
                   c.getName().equals("java.util.BitSet"));
    }
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.