edu.stanford.ejalbert
Class BrowserLauncherRunner

    java.lang.Object
    extended byedu.stanford.ejalbert.BrowserLauncherRunner
All Implemented Interfaces:
Runnable

public class BrowserLauncherRunner
extends Object
implements Runnable

This is a convenience class to facilitate executing the browser launch in a separate thread. Applications will need to create a thread passing an instance of this class, then call start() on the thread created.

Author:
Jeff Chapman

Constructor Summary
BrowserLauncherRunner(BrowserLauncher launcher, String url, BrowserLauncherErrorHandler errorHandler)
          Takes the items necessary for launching a browser and handling any exceptions.
BrowserLauncherRunner(BrowserLauncher launcher, String browserName, String url, BrowserLauncherErrorHandler errorHandler)
          Takes the items necessary for launching a browser and handling any exceptions.
 
Method Summary
 void run()
          When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserLauncherRunner

    public BrowserLauncherRunner(BrowserLauncher launcher,
    String url,
    BrowserLauncherErrorHandler errorHandler)
Takes the items necessary for launching a browser and handling any exceptions.

If the errorHandler is null, an instance of the BrowserLauncherDefaultErrorHandler will be used.

Parameters:
launcher - BrowserLauncher
url - String
errorHandler - BrowserLauncherErrorHandler
See Also:
BrowserLauncherDefaultErrorHandler

BrowserLauncherRunner

    public BrowserLauncherRunner(BrowserLauncher launcher,
    String browserName,
    String url,
    BrowserLauncherErrorHandler errorHandler)
Takes the items necessary for launching a browser and handling any exceptions.

If the errorHandler is null, an instance of the BrowserLauncherDefaultErrorHandler will be used.

Parameters:
launcher - BrowserLauncher
browserName - String
url - String
errorHandler - BrowserLauncherErrorHandler
See Also:
BrowserLauncherDefaultErrorHandler
Method Detail

run

    public void run()
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.

This method will make the call to open the browser and display the url. If an exception occurs, it will be passed to the instance of BrowserLauncherErrorHandler that has been passed into the constructor. If no error handler is available, an instance of the default error handler will be used.

Specified by:
run in interface Runnable