Package java.net

Examples of java.net.URLClassLoader.loadClass()


        //
        try {
            URL jarURL = new URL(jarName);
            URLClassLoader loader = new URLClassLoader(new URL[] { jarURL },
               piClassLoader);
            Class clas = loader.loadClass(piClassImpl);
            Class[] argumentTypes = { org.openoffice.xmerge.util.registry.ConverterInfo.class };
            Constructor construct = clas.getConstructor(argumentTypes);

            Object[] arguments = { this };
            piPluginFactory = ( PluginFactory ) construct.newInstance(arguments);
View Full Code Here


        //
        try {
            URL jarURL = new URL(jarName);
            URLClassLoader loader = new URLClassLoader(new URL[] { jarURL },
               piClassLoader);
            Class clas = loader.loadClass(piClassImpl);
            Class[] argumentTypes = { org.openoffice.xmerge.util.registry.ConverterInfo.class };
            Constructor construct = clas.getConstructor(argumentTypes);

            Object[] arguments = { this };
            piPluginFactory = ( PluginFactory ) construct.newInstance(arguments);
View Full Code Here

                            URI aLocationURI = URI.create(sLocation + "/" + "reportbuilderwizard.jar");

                            URL[] aURLs = new URL[1];
                            aURLs[0] = aLocationURI.toURL();
                            URLClassLoader aClassLoader = new URLClassLoader(aURLs, this.getClass().getClassLoader());
                            Class a = aClassLoader.loadClass("com.sun.star.wizards.reportbuilder.ReportBuilderImplementation");
                            Method aMethod = a.getMethod("create", new Class[]{XMultiServiceFactory.class, Resource.class});
                            CurReportDocument = (IReportDocument) aMethod.invoke(a, new Object[]{xMSF, m_oResource});
                        }
                        catch (Exception e)
                        {
View Full Code Here

        //
        try {
            URL jarURL = new URL(jarName);
            URLClassLoader loader = new URLClassLoader(new URL[] { jarURL },
               piClassLoader);
            Class clas = loader.loadClass(piClassImpl);
            Class[] argumentTypes = { org.openoffice.xmerge.util.registry.ConverterInfo.class };
            Constructor construct = clas.getConstructor(argumentTypes);

            Object[] arguments = { this };
            piPluginFactory = ( PluginFactory ) construct.newInstance(arguments);
View Full Code Here

        //
        try {
            URL jarURL = new URL(jarName);
            URLClassLoader loader = new URLClassLoader(new URL[] { jarURL },
               piClassLoader);
            Class clas = loader.loadClass(piClassImpl);
            Class[] argumentTypes = { org.openoffice.xmerge.util.registry.ConverterInfo.class };
            Constructor construct = clas.getConstructor(argumentTypes);

            Object[] arguments = { this };
            piPluginFactory = ( PluginFactory ) construct.newInstance(arguments);
View Full Code Here

            String serviceUnitAnalyzerClazzName = getServiceUnitAnalyzer();
            // The ServiceUnitAnalyzer should give us the consumes and
            // provides
            if (serviceUnitAnalyzerClazzName != null) {
                ServiceUnitAnalyzer serviceUnitAnalyzer = (ServiceUnitAnalyzer) newClassLoader
                        .loadClass(serviceUnitAnalyzerClazzName).newInstance();
                getLog().info(
                        "Created Service Unit Analyzer " + serviceUnitAnalyzer);
                serviceUnitAnalyzer.init(serviceUnitArtifactsDir);
View Full Code Here

                }
            }
            URLClassLoader loader = new URLClassLoader(list.toArray(new URL[list.size()]),
                    DatabasePoolPortlet.class.getClassLoader());
            try {
                return loader.loadClass(data.driverClass);
            } catch (ClassNotFoundException e) {
                return null;
            }
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

        if (iface instanceof JavaInterface) {
            String curi = domainRegistry.getContainingCompositesContributionURI(endpoint.getComponent().getName());
            if (curi != null) {
                ContributionDescription ic = domainRegistry.getInstalledContribution(curi);
                ClassLoader cl = new URLClassLoader(new URL[]{new URL(ic.getURL())});
                serviceInterface = cl.loadClass(((JavaInterface)iface).getName());
            }
        }
    }

    private RuntimeEndpointReference createEndpointReference(JavaInterfaceFactory javaInterfaceFactory, CompositeContext compositeContext, AssemblyFactory assemblyFactory, Endpoint endpoint, Class<?> businessInterface) throws CloneNotSupportedException, InvalidInterfaceException {
View Full Code Here

        ClassLoader old = t.getContextClassLoader();
        t.setContextClassLoader(ucl);
        try {
            try {
                ucl.loadClass("No such class");
                fail();
            } catch (ClassNotFoundException e) {
                // as expected
            }
View Full Code Here

                fail();
            } catch (ClassNotFoundException e) {
                // as expected
            }

            ucl.loadClass(Hudson.class.getName());
        } finally {
            t.setContextClassLoader(old);
        }
    }
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.