edu.stanford.ejalbert
Class BrowserLauncherRunner

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

public class BrowserLauncherRunner
extends java.lang.Object
implements java.lang.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

Field Summary
private  BrowserLauncherErrorHandler errorHandler
           
private  BrowserLauncher launcher
           
private  java.lang.String targetBrowser
           
private  java.lang.String url
           
 
Constructor Summary
BrowserLauncherRunner(BrowserLauncher launcher, java.lang.String url, BrowserLauncherErrorHandler errorHandler)
          Takes the items necessary for launching a browser and handling any exceptions.
BrowserLauncherRunner(BrowserLauncher launcher, java.lang.String browserName, java.lang.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
 

Field Detail

targetBrowser

private java.lang.String targetBrowser

url

private java.lang.String url

errorHandler

private BrowserLauncherErrorHandler errorHandler

launcher

private BrowserLauncher launcher
Constructor Detail

BrowserLauncherRunner

public BrowserLauncherRunner(BrowserLauncher launcher,
                             java.lang.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,
                             java.lang.String browserName,
                             java.lang.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 java.lang.Runnable