com.sun.faban.harness.engine
Class GlassfishService

java.lang.Object
  extended by com.sun.faban.harness.engine.GlassfishService
All Implemented Interfaces:
WebServerService

Deprecated.

@Deprecated
public final class GlassfishService
extends Object
implements WebServerService

This class implements the service to start/stop GlassFish instances. It also provides functionality to transfer the portion of the glassfish error_log for a run to the run output directory. It can be used by any benchmark to GlassFish servers and perform these operations remotely using this Service.

Author:
Akara Sucharitakul

Method Summary
 boolean clearLogs()
          Deprecated. Clears glassfish logs and session files.
static GregorianCalendar getGregorianCalendar(String hostName)
          Deprecated. Obtains the gregorian calendar representing the current time.
static GlassfishService getHandle()
          Deprecated. Get the reference to the singleton object.
 void kill()
          Deprecated. Kill all glassfish servers.
 boolean restartServers()
          Deprecated. Restart all servers.
 void setup(String[] serverMachines, String binDir, String logsDir, String confDir, String pidDir)
          Deprecated. The setup method is called to set up a benchmark run.
 boolean startServers()
          Deprecated. Start all glassfish servers on configured hosts.
 boolean stopServers()
          Deprecated. Stop servers.
 void xferLogs(int totalRunTime)
          Deprecated. Transfer log files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHandle

public static GlassfishService getHandle()
Deprecated. 
Get the reference to the singleton object. Use this method to get access to the service.

Returns:
GlassfishService - service object handle

setup

public void setup(String[] serverMachines,
                  String binDir,
                  String logsDir,
                  String confDir,
                  String pidDir)
Deprecated. 
The setup method is called to set up a benchmark run. It is assumed that all servers have the same installation directory

Specified by:
setup in interface WebServerService
Parameters:
serverMachines - - array specifying the glassfish server machines.
binDir - - glassfish binaries location
logsDir - - glassfish logs location
confDir - - glassfish httpd.conf file location
pidDir - - glassfish httpd.pid file location

startServers

public boolean startServers()
Deprecated. 
Start all glassfish servers on configured hosts.

Specified by:
startServers in interface WebServerService
Returns:
boolean true if start succeeded on all machines, else false

restartServers

public boolean restartServers()
Deprecated. 
Restart all servers. It first stops servers, clear logs and then attempts to start them up again. If startup fails on any server, it will stop all servers and cleanup.

Specified by:
restartServers in interface WebServerService
Returns:
true if all servers restarted successfully, otherwise false

stopServers

public boolean stopServers()
Deprecated. 
Stop servers.

Specified by:
stopServers in interface WebServerService
Returns:
true if stop succeeded on all machines, else false

clearLogs

public boolean clearLogs()
Deprecated. 
Clears glassfish logs and session files. It assumes that session files are in /tmp/sess*.

Specified by:
clearLogs in interface WebServerService
Returns:
true if operation succeeded, else fail

xferLogs

public void xferLogs(int totalRunTime)
Deprecated. 
Transfer log files. This method copies over the error_log to the run output directory and keeps only the portion of the log relevant for this run.

Specified by:
xferLogs in interface WebServerService
Parameters:
totalRunTime - - the time in seconds for this run

kill

public void kill()
Deprecated. 
Kill all glassfish servers. We simply stop them instead of doing a hard kill.

Specified by:
kill in interface WebServerService

getGregorianCalendar

public static GregorianCalendar getGregorianCalendar(String hostName)
                                              throws Exception
Deprecated. 
Obtains the gregorian calendar representing the current time.

Parameters:
hostName - The host name to get the calendar from
Returns:
The calendar
Throws:
Exception - Error obtaining calendar