com.opera.core.systems.runner
Class OperaRunner

java.lang.Object
  extended by com.opera.core.systems.runner.OperaRunner
All Implemented Interfaces:
OperaRunner
Direct Known Subclasses:
OperaLauncherRunner

public class OperaRunner
extends Object
implements OperaRunner

OperaRunner implements a pure-Java process manager for controlling the Opera binary.

Author:
Andreas Tolf Tolfsen

Field Summary
protected  Logger logger
           
protected  OperaSettings settings
           
 
Constructor Summary
OperaRunner()
           
OperaRunner(OperaSettings s)
           
 
Method Summary
 String getOperaCrashlog()
          If Opera crashed there should be a crashlog.
 boolean hasOperaCrashed()
          Did Opera crash? This is reset on next call, so if you don't check you won't know.
 boolean isOperaRunning()
          Is Opera running?
 boolean isOperaRunning(int processID)
           
 ScreenShotReply saveScreenshot(long timeout, String... hashes)
          Take a screenshot of the full screen.
 void shutdown()
          Handles safe shutdown of the OperaRunner class.
 void startOpera()
          Start Opera, does nothing if Opera is already started.
 void stopOpera()
          Stops Opera, does nothing if Opera isn't running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Logger logger

settings

protected final OperaSettings settings
Constructor Detail

OperaRunner

public OperaRunner()

OperaRunner

public OperaRunner(OperaSettings s)
Method Detail

startOpera

public void startOpera()
Description copied from interface: OperaRunner
Start Opera, does nothing if Opera is already started.

Specified by:
startOpera in interface OperaRunner

stopOpera

public void stopOpera()
Description copied from interface: OperaRunner
Stops Opera, does nothing if Opera isn't running. Typically we'll use the exec service to stop Opera, but this method will _ensure_ that Opera is quit from an external process controller.

Specified by:
stopOpera in interface OperaRunner

isOperaRunning

public boolean isOperaRunning()
Description copied from interface: OperaRunner
Is Opera running?

Specified by:
isOperaRunning in interface OperaRunner
Returns:
true if running, false if not running or crashed

isOperaRunning

public boolean isOperaRunning(int processID)
Specified by:
isOperaRunning in interface OperaRunner

hasOperaCrashed

public boolean hasOperaCrashed()
Description copied from interface: OperaRunner
Did Opera crash? This is reset on next call, so if you don't check you won't know.

Specified by:
hasOperaCrashed in interface OperaRunner
Returns:
true if opera has crashed

getOperaCrashlog

public String getOperaCrashlog()
Description copied from interface: OperaRunner
If Opera crashed there should be a crashlog.

Specified by:
getOperaCrashlog in interface OperaRunner
Returns:
the crashlog, or null if it does not exist

shutdown

public void shutdown()
Handles safe shutdown of the OperaRunner class.

Specified by:
shutdown in interface OperaRunner

saveScreenshot

public ScreenShotReply saveScreenshot(long timeout,
                                      String... hashes)
Description copied from interface: OperaRunner
Take a screenshot of the full screen.

Specified by:
saveScreenshot in interface OperaRunner
Parameters:
timeout - attempt to take the screenshot until the timeout is reached
hashes - an arbitrary list of hashes to compare with
Returns:
a ScreenshotReply object containing MD5 hash sums and bytes


Copyright © 2012. All Rights Reserved.