Package org.rioproject.loader

Examples of org.rioproject.loader.ServiceClassLoader


        this.sharedConfig = sharedConfig;
        watchRegistry = new WatchDataSourceRegistry();
        watchRegistry.setServiceBeanContext(this);
        ClassLoader cCL = Thread.currentThread().getContextClassLoader();
        if(cCL instanceof ServiceClassLoader) {
            ServiceClassLoader scl = (ServiceClassLoader)cCL;
            URL urls[] = scl.getURLs();
            if(urls!=null && urls.length>0) {
                if(urls[0].getProtocol().equals("artifact"))
                    exportCodebase = urls[0].toExternalForm();
                else
                    exportCodebase = urls[0].getProtocol()+"://"+urls[0].getHost()+":"+urls[0].getPort()+"/";
View Full Code Here


        final Thread currentThread = Thread.currentThread();
        ClassLoader currentClassLoader = currentThread.getContextClassLoader();

        ClassAnnotator annotator = new ClassAnnotator(ClassLoaderUtil.getCodebaseURLs(getCodebase()));

        ServiceClassLoader serviceCL =
            new ServiceClassLoader(ServiceClassLoader.getURIs(ClassLoaderUtil.getClasspathURLs(getClasspath())),
                                   annotator,
                                   commonCL);
        if(logger.isDebugEnabled())
            logger.debug("Created {}", serviceCL);
        if(logger.isTraceEnabled())
View Full Code Here

            for (int i = 0; i < classPath.length; i++) {
                urls[i] = new URL(classPath[i]);
            }
            URLClassLoader loader;
            if(annotator!=null) {
                loader = new ServiceClassLoader(ServiceClassLoader.getURIs(urls), annotator, Thread.currentThread().getContextClassLoader());
            } else {
                loader = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader());
            }
            for (String className : classNames) {
                Class<?> cl = loader.loadClass(className);
View Full Code Here

            URL[] classpath = urlList.toArray(new URL[urlList.size()]);
            Properties metaData = new Properties();
            metaData.setProperty("opStringName", sElem.getOperationalStringName());
            metaData.setProperty("serviceName", sElem.getName());
            ServiceClassLoader jsbCL = new ServiceClassLoader(ServiceClassLoader.getURIs(classpath),
                                                              new ClassAnnotator(exports),
                                                              commonCL,
                                                              metaData);

            /*
            ServiceClassLoader jsbCL =
                new ServiceClassLoader(classpath, annotator, commonCL);
                */
            currentThread.setContextClassLoader(jsbCL);
            if(logger.isDebugEnabled()) {
                StringBuilder buffer = new StringBuilder();
                if(implJARs.length==0) {
                    buffer.append("<empty>");
                } else {
                    for(int i=0; i<implJARs.length; i++) {
                        if(i>0)
                            buffer.append(", ");
                        buffer.append(implJARs[i].toExternalForm());
                    }
                }
                String className = (jsbBundle==null?"<not defined>": jsbBundle.getClassName());
                if(logger.isDebugEnabled()) {
                    logger.debug("Create ServiceClassLoader for {}, classpath {}, codebase {}",
                                 className, buffer.toString(), jsbCL.getClassAnnotation());
                }
            }

            /* Get the servicePolicyFile from the environment. If the
             * property has not been set use the policy set for the VM */
 
View Full Code Here

TOP

Related Classes of org.rioproject.loader.ServiceClassLoader

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.