Package java.net

Examples of java.net.URLClassLoader$SubURLClassLoader


         URL[] urls = new URL[clientJars.size()];
         for (int i = 0; i < clientJars.size(); i++)
         {
            urls[i] = clientJars.get(i);
         }
         URLClassLoader cl = new URLClassLoader(urls, parent);
         Thread.currentThread().setContextClassLoader(cl);
      }
     
    try {
      String testDelayStr=System.getProperty("test.delay","20000");
View Full Code Here


        }else{

          if ( plugin_class_loader instanceof URLClassLoader ){

            URLClassLoader  current = (URLClassLoader)plugin_class_loader;

            URL url = current.findResource("plugin.properties");

            if ( url != null ){
              URLConnection connection = url.openConnection();

              InputStream is = connection.getInputStream();
View Full Code Here

   */
  public void initializeStack(QName serviceName, QName portName, java.net.URI baseURI) {
    try {
      SpringBusFactory bf = new SpringBusFactory();
         
      URLClassLoader urlcl=new URLClassLoader(new URL[]{baseURI.toURL()});
     
      String filename="jbossws-cxf-"+portName.getLocalPart()+".xml";
         
      URL busFile = urlcl.getResource(filename);
     
      log.debug("Web Stack initialization file: name="+filename+" file="+busFile);
     
      if (busFile != null) {
        Bus bus = bf.createBus(busFile.toString());
View Full Code Here

  static Properties loadProperties(String propertiesName, Logger log) throws IOException {
    ClassLoader loader = ResourceActions.getContextClassLoader();
    URL url = null;
    // First check for local visibility via a URLClassLoader.findResource
    if (loader instanceof URLClassLoader) {
      URLClassLoader ucl = (URLClassLoader) loader;
      url = ResourceActions.findResource(ucl, propertiesName);
      log.trace("findResource: " + url); //$NON-NLS-1$
    }
    if (url == null)
      url = loader.getResource(propertiesName);
View Full Code Here

        String excludeSystemClasses = System.getProperty("helma.excludeSystemClasses");

        ClassLoader loader;

        if ("true".equalsIgnoreCase(excludeSystemClasses)) {
            loader = new URLClassLoader(urls, null);
        } else {
            loader = new URLClassLoader(urls);
        }

        // set the new class loader as context class loader
        Thread.currentThread().setContextClassLoader(loader);
        return loader;
View Full Code Here

            if (args[i].equals("-i") && ((i + 1) < args.length)) {
                installDir = args[i + 1];
            }
        }

        URLClassLoader apploader = (URLClassLoader)
                                   ClassLoader.getSystemClassLoader();

        // try to get Helma installation directory
        if (installDir == null) {
            URL launcherUrl = apploader.findResource("helma/main/launcher/Main.class");

            // this is a  JAR URL of the form
            //    jar:<url>!/{entry}
            // we strip away the jar: prefix and the !/{entry} suffix
            // to get the original jar file URL
View Full Code Here

            }
        }
        */
       
        newResourceBundle = getResourceBundle("MessagesBundle", newLocale,
                                                      new URLClassLoader(urls));
        // do more searches if getBundle failed, or if the language is not the
        // same and the user wanted a specific country
        if ((!newResourceBundle.getLocale().getLanguage().equals(newLocale.getLanguage()) &&
             !newLocale.getCountry().equals(""))) {
         
          Locale foundLocale = newResourceBundle.getLocale();
          System.out.println("changeLocale: "+
                             (foundLocale.toString().equals("") ? "*Default Language*" : foundLocale.getDisplayLanguage()) +
                             " != "+newLocale.getDisplayName()+". Searching without country..");
          // try it without the country
          Locale localeJustLang = new Locale(newLocale.getLanguage());
          newResourceBundle = getResourceBundle("MessagesBundle", localeJustLang,
                                                        new URLClassLoader(urls));
         
          if (newResourceBundle == null ||
              !newResourceBundle.getLocale().getLanguage().equals(localeJustLang.getLanguage())) {
            // find first language we have in our list
            System.out.println("changeLocale: Searching for language " + newLocale.getDisplayLanguage() + " in *any* country..");
            Locale[] locales = getLocales(false);
            for (int i = 0; i < locales.length; i++) {
              if (locales[i].getLanguage() == newLocale.getLanguage()) {
                newResourceBundle = getResourceBundle("MessagesBundle", locales[i],
                                                              new URLClassLoader(urls));
                break;
              }
            }
          }
        }
View Full Code Here

   public void testClassCastException() throws Exception
   {
      cache.start();

      URLClassLoader ucl1 = createOrphanClassLoader();
      Thread.currentThread().setContextClassLoader(ucl1);

      Class clazz1 = ucl1.loadClass(INSTANCE_CLASS_NAME);
      cache.put(fqn("/a"), "key", clazz1.newInstance());

      Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
      try
      {
View Full Code Here

   public void testRegisterUnregister() throws Exception
   {
      cache.start();

      URLClassLoader ucl1 = createOrphanClassLoader();
      Thread.currentThread().setContextClassLoader(ucl1);

      Region region = cache.getRegion(fqn("/"), true);
      region.registerContextClassLoader(Thread.currentThread().getContextClassLoader());
      region.activate();

      Class clazz1 = ucl1.loadClass(INSTANCE_CLASS_NAME);
      cache.put(fqn("/a"), "key", clazz1.newInstance());

      region.deactivate();
      region.unregisterContextClassLoader();
View Full Code Here

         f = new File(LIB_DIR_SP);
      }

      URL context = f.toURL();
      URL jar = new URL(context, INSTANCE_LIBRARY);
      URLClassLoader ucl1 = new URLClassLoader(new URL[]{jar}, null);

      return ucl1;
   }
View Full Code Here

TOP

Related Classes of java.net.URLClassLoader$SubURLClassLoader

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.