com.sun.enterprise.admin.cli.optional
Class DatabaseCommand

java.lang.Object
  extended by com.sun.enterprise.admin.cli.CLICommand
      extended by com.sun.enterprise.admin.cli.optional.DatabaseCommand
All Implemented Interfaces:
org.jvnet.hk2.component.PostConstruct
Direct Known Subclasses:
StartDatabaseCommand, StopDatabaseCommand

public abstract class DatabaseCommand
extends CLICommand

This is an abstract class to be inherited by StartDatabaseCommand and StopDatabaseCommand. This classes prepares the variables that are used to to invoke DerbyControl. It also contains a pingDatabase method that is used by both start/stop database command.

Author:
Jane Young, Bill Shannon

Field Summary
protected static java.lang.String DB_HOST_DEFAULT
           
protected static java.lang.String DB_PASSWORDFILE
           
protected static java.lang.String DB_PORT_DEFAULT
           
protected static java.lang.String DB_USER
           
protected  java.lang.String dbHost
           
protected  java.io.File dbLocation
           
protected  java.lang.String dbPort
           
protected  java.io.File installModules
           
protected  ClassPathBuilder sClasspath
           
protected  ClassPathBuilder sDatabaseClasspath
           
protected  java.io.File sInstallRoot
           
protected  java.io.File sJavaHome
           
 
Fields inherited from class com.sun.enterprise.admin.cli.CLICommand
argv, commandModel, CONNECTION_ERROR, env, ERROR, INVALID_COMMAND_ERROR, logger, metadataErrors, name, operands, options, passwords, programOpts, SUCCESS, WARNING
 
Constructor Summary
DatabaseCommand()
           
 
Method Summary
protected  java.io.File getJavaExe()
          Computes the java executable location from sJavaHome.
protected  java.lang.String[] pingDatabaseCmd(boolean bRedirect)
          Defines the command to ping the derby database.
protected  void prepareProcessExecutor()
          Prepare variables to invoke start/ping database command.
 
Methods inherited from class com.sun.enterprise.admin.cli.CLICommand
checkHelp, execute, executeCommand, getBooleanOption, getCommand, getManPage, getName, getOperandModel, getOption, getPassword, getProgramOptions, getSystemProperties, getSystemProperty, getUsage, initializeLogger, initializePasswords, inject, ok, parse, postConstruct, prepare, prevalidate, printExceptionStackTrace, processProgramOptions, quote, readPassword, toString, usageOptions, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DB_HOST_DEFAULT

protected static final java.lang.String DB_HOST_DEFAULT
See Also:
Constant Field Values

DB_PORT_DEFAULT

protected static final java.lang.String DB_PORT_DEFAULT
See Also:
Constant Field Values

DB_USER

protected static final java.lang.String DB_USER
See Also:
Constant Field Values

DB_PASSWORDFILE

protected static final java.lang.String DB_PASSWORDFILE
See Also:
Constant Field Values

dbHost

protected java.lang.String dbHost

dbPort

protected java.lang.String dbPort

dbLocation

protected java.io.File dbLocation

sJavaHome

protected java.io.File sJavaHome

sInstallRoot

protected java.io.File sInstallRoot

installModules

protected java.io.File installModules

sClasspath

protected final ClassPathBuilder sClasspath

sDatabaseClasspath

protected final ClassPathBuilder sDatabaseClasspath
Constructor Detail

DatabaseCommand

public DatabaseCommand()
Method Detail

prepareProcessExecutor

protected void prepareProcessExecutor()
                               throws java.lang.Exception
Prepare variables to invoke start/ping database command.

Throws:
java.lang.Exception

pingDatabaseCmd

protected java.lang.String[] pingDatabaseCmd(boolean bRedirect)
                                      throws java.lang.Exception
Defines the command to ping the derby database. Note that when using Darwin (Mac), the property, "-Dderby.storage.fileSyncTransactionLog=True" is defined. See: http://www.jasonbrome.com/blog/archives/2004/12/05/apache_derby_on_mac_os_x.html https://issues.apache.org/jira/browse/DERBY-1

Throws:
java.lang.Exception

getJavaExe

protected final java.io.File getJavaExe()
Computes the java executable location from sJavaHome.



Copyright © 2012 GlassFish Community. All Rights Reserved.