Extension SDK 10.1.2

oracle.ide.net
Class URLClassPathThread

java.lang.Object
  extended byjava.lang.Thread
      extended byoracle.ide.net.URLClassPathThread
All Implemented Interfaces:
java.lang.Runnable

public class URLClassPathThread
extends java.lang.Thread

This is a subclass of Thread that uses a different classpath than its parent thread. The classpath is specified by an instance of URLPath. One example of how this class can be used:

    //  First, create a URLPath object which represents the class path.
    URLPath urlPath = new URLPath();
    try
    {
      //  Add directory to urlPath.
      urlPath.addEntry( URLFactory.newFileURL( "C:\\classes" ) );

      //  Add jar to urlPath.
      urlPath.addEntry( URLFactory.newFileURL( "C:\\lib\\rt.jar" ) );
    }
    catch ( java.net.MalformedURLException e )
    {
      e.printStackTrace();
    }

    //  Second, create a Runnable object.
    Runnable runnable = new Runnable()
    {
      public void run()
      {
        //  The code that runs with the custom classpath goes here.
      }
    };

    //  Now create the ClassPathThread and start it.
    ClassPathThread t = new ClassPathThread( urlPath, runnable );
    t.start();
  


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
URLClassPathThread(URLPath urlPath, java.lang.Runnable target)
          Creates a new URLClassPathThread that runs the given target using the given URLPath as its classpath.
 
Method Summary
 void run()
          Invokes the run method of the target that was specified when the URLClassPathThread object was constructed.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URLClassPathThread

public URLClassPathThread(URLPath urlPath,
                          java.lang.Runnable target)
Creates a new URLClassPathThread that runs the given target using the given URLPath as its classpath. The URLClassPathThread uses only the URLPath as its classpath. Specifically, the URLClassPathThread will not fall back to the JVM's boot classpath if a resource cannot be found on the URLPath.

Method Detail

run

public final void run()
Invokes the run method of the target that was specified when the URLClassPathThread object was constructed.


Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.