Class LocalInstanceCommand

  • All Implemented Interfaces:
    org.glassfish.hk2.api.PostConstruct
    Direct Known Subclasses:
    ChangeNodeMasterPasswordCommand, CreateLocalInstanceFilesystemCommand, DeleteInstanceFilesystem, DeleteLocalInstanceCommand, ImportSyncBundleCommand, StopLocalInstanceCommand, SynchronizeInstanceCommand, ValidateDasOptions

    public abstract class LocalInstanceCommand
    extends LocalServerCommand
    A base class for local commands that manage a local server instance. This base class is used by a LOT of other classes. There is a big comment before each section of the file -- sorted by visibility. If you specifically want a method to be overridden -- make it protected but not final. final protected means -- "call me but don't override me". This convention is to make things less confusing. If you add a method or change whether it is final -- move it to the right section. Default instance file structure.
     ||---- <GlassFish Install Root>
              ||---- nodes (nodeDirRoot, --nodedir)
                      ||---- <node-1> (nodeDirChild, --node)
                              || ---- agent
                                      || ---- config
                                              | ---- das.properties
                              || ---- <instance-1> (instanceDir)
                                      ||---- config
                                      ||---- applications
                                      ||---- java-web-start
                                      ||---- generated
                                      ||---- lib
                                      ||---- docroot
                              || ---- <instance-2> (instanceDir)
                      ||---- <node-2> (nodeDirChild)
     
    Author:
    Byron Nevins
    • Field Detail

      • nodeDir

        protected String nodeDir
      • instanceName

        protected String instanceName
      • nodeDirRoot

        protected File nodeDirRoot
      • nodeDirChild

        protected File nodeDirChild
      • instanceDir

        protected File instanceDir
      • domainName

        protected String domainName
      • isCreateInstanceFilesystem

        protected boolean isCreateInstanceFilesystem
      • checkOneAndOnly

        protected boolean checkOneAndOnly
    • Constructor Detail

      • LocalInstanceCommand

        public LocalInstanceCommand()
    • Method Detail

      • mkdirs

        protected boolean mkdirs​(File f)
        Override this method if your class does NOT want to create directories
        Parameters:
        f - the directory to create
        Returns:
        true iff the directory was created
      • isDirectory

        protected boolean isDirectory​(File f)
        Override this method if your class does NOT want CommandException thrown if directory does not exist.
        Parameters:
        f - directory to check
      • setServerDirs

        protected boolean setServerDirs()
        Override this method if your class does NOT want to set ServerDirs
      • getInstanceDirs

        protected final InstanceDirs getInstanceDirs()
      • getProductRootPath

        protected String getProductRootPath()
                                     throws CommandException
        Gets the GlassFish product installation root (using property com.sun.aas.productRoot), first from asenv.conf. If that's not available, then from java.lang.System. This will typically be the parent of the glassfish install root
        Returns:
        path of GlassFish product install root
        Throws:
        CommandException - if the GlassFish install root is not found
      • getInstanceName

        public String getInstanceName()
        Returns:
        the instanceName
      • setInstanceName

        public void setInstanceName​(String instanceName)
        Parameters:
        instanceName - the instanceName to set