Package org.apache.axis2.deployment

Examples of org.apache.axis2.deployment.DeploymentClassLoader


                    if (!file.exists()) {
                        throw new AxisFault(Messages.getMessage(DeploymentErrorMsgs.FILE_NOT_FOUND,
                                file.getAbsolutePath()));
                    }
                    urlsToLoadFrom = new URL[]{file.toURL()};
                    classLoader = new DeploymentClassLoader(urlsToLoadFrom, parent, lock);
                } catch (Exception e) {
                    throw new AxisFault(e);
                }
            }
        } else {
View Full Code Here


      final URL[] urls, final ClassLoader serviceClassLoader,
      final List embeddedJars) {
    return (DeploymentClassLoader) AccessController
        .doPrivileged(new PrivilegedAction() {
          public Object run() {
            return new DeploymentClassLoader(urls, embeddedJars,
                serviceClassLoader);
          }
        });
  }
View Full Code Here

                    .doPrivileged(new PrivilegedAction() {
                        public Object run() {
                            if (useJarFileClassLoader()) {
                                return new JarFileClassLoader(urllist, parent);
                            } else {
                                return new DeploymentClassLoader(urllist, null, parent, isChildFirstClassLoading);
                            }
                        }
                    });
            return classLoader;
        } catch (MalformedURLException e) {
View Full Code Here

            final URL[] urls, final ClassLoader serviceClassLoader,
            final List embeddedJars, final boolean isChildFirstClassLoading) {
        return (DeploymentClassLoader)AccessController
                .doPrivileged(new PrivilegedAction() {
                    public Object run() {
                        return new DeploymentClassLoader(urls, embeddedJars,
                                                         serviceClassLoader, isChildFirstClassLoading);
                    }
                });
    }
View Full Code Here

                    throw new RuntimeException("file not found !!!!!!!!!!!!!!!");
                }
                URLs.add(file.toURL());
                urlsToLoadFrom = new URL[]{file.toURL()};
                classLoader =
                        new DeploymentClassLoader(urlsToLoadFrom, parent);
//                classLoader = new URLClassLoader(urlsToLoadFrom, parent);
            } catch (Exception e) {
                throw new AxisFault(e);
            }
        }
View Full Code Here

        // get the context class loader for the later restore of the context class loader
        ClassLoader prevCl = Thread.currentThread().getContextClassLoader();

        try {

            DeploymentClassLoader urlCl = new DeploymentClassLoader(
                    new URL[]{deploymentFileData.getFile().toURL()}, null, prevCl);
            Thread.currentThread().setContextClassLoader(urlCl);

            // MediatorFactory registration
            URL facURL = urlCl.findResource(
                    "META-INF/services/org.apache.synapse.config.xml.MediatorFactory");
            if (facURL != null) {
                InputStream facStream = facURL.openStream();
                InputStreamReader facreader = new InputStreamReader(facStream);

                StringBuffer facSB = new StringBuffer();
                int c;
                while ((c = facreader.read()) != -1) {
                    facSB.append((char) c);
                }

                String[] facClassNames = facSB.toString().split("\n");
                for (String facClassName : facClassNames) {
                    log.info("Registering the Mediator factory: " + facClassName);
                    Class facClass = urlCl.loadClass(facClassName);
                    MediatorFactory facInst = (MediatorFactory) facClass.newInstance();
                    MediatorFactoryFinder.getInstance()
                            .getFactoryMap().put(facInst.getTagQName(), facClass);
                    log.info("Mediator loaded and registered for " +
                            "the tag name: " + facInst.getTagQName());
                }
            } else {
                handleException("Unable to find the MediatorFactory implementation. " +
                        "Unable to register the MediatorFactory with the FactoryFinder");
            }

            // MediatorSerializer registration
            URL serURL = urlCl.findResource(
                    "META-INF/services/org.apache.synapse.config.xml.MediatorSerializer");
            if (serURL != null) {
                InputStream serStream = serURL.openStream();
                InputStreamReader serReader = new InputStreamReader(serStream);

                StringBuffer serSB = new StringBuffer();
                int c;
                while ((c = serReader.read()) != -1) {
                    serSB.append((char) c);
                }

                String[] serClassNames = serSB.toString().split("\n");
                for (String serClassName : serClassNames) {
                    log.info("Registering the Mediator serializer: " + serClassName);
                    Class serClass = urlCl.loadClass(serClassName);
                    MediatorSerializer serInst = (MediatorSerializer) serClass.newInstance();
                    MediatorSerializerFinder.getInstance()
                            .getSerializerMap().put(serInst.getMediatorClassName(), serInst);
                    log.info("Mediator loaded and registered for " +
                            "the serialization as: " + serInst.getMediatorClassName());
View Full Code Here

    public static ClassLoader createClassLoader(URL[] urls, ClassLoader serviceClassLoader,
                                                boolean extractJars, File tmpDir) {
        if(extractJars) {
            URL[] urls1 = Utils.getURLsForAllJars(urls[0], tmpDir);
            return new DeploymentClassLoader(urls1, null, serviceClassLoader);
        } else {
            List embedded_jars = Utils.findLibJars(urls[0]);
            return new DeploymentClassLoader(urls, embedded_jars, serviceClassLoader);
        }
    }
View Full Code Here

    private void handleException(String message, Exception e) throws DeploymentException {
        if (log.isDebugEnabled()) {
            log.debug(message, e);
        }
        throw new DeploymentException(message, e);
    }
View Full Code Here

    private void handleException(String message, Throwable t) throws DeploymentException {
        if (log.isDebugEnabled()) {
            log.debug(message, t);
        }
        throw new DeploymentException(message, t);
    }
View Full Code Here

            }
        } else {
            String msg = "Artifact representing the filename "
                    + fileName + " is not deployed on Synapse";
            log.error(msg);
            throw new DeploymentException(msg);
        }

        if (log.isDebugEnabled()) {
            log.debug("UnDeployment of the synapse artifact from file : "
                    + fileName + " : COMPLETED");
View Full Code Here

TOP

Related Classes of org.apache.axis2.deployment.DeploymentClassLoader

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.