Class XWikiExecutor


  • public class XWikiExecutor
    extends Object
    Start and stop an XWiki instance.
    Since:
    2.0RC1
    Version:
    $Id: 61145a9ebd8e77403636435b25c940599492ffd4 $
    • Field Detail

      • LOGGER

        protected static final org.slf4j.Logger LOGGER
      • VERIFY_RUNNING_XWIKI_AT_START

        public static final String VERIFY_RUNNING_XWIKI_AT_START
        If defined then we check for an existing running XWiki instance before trying to start XWiki.
      • BASEDIR

        public static final String BASEDIR
      • URL

        public static final String URL
      • DEFAULT_CONTEXT

        public static final String DEFAULT_CONTEXT
        By default assume that XWiki is deployed under the "xwiki" Servlet context. Pass an empty string to singify the root context. Note the "/" suffix which is required.
      • DEFAULT_PORT

        public static final String DEFAULT_PORT
      • DEFAULT_STOPPORT

        public static final String DEFAULT_STOPPORT
      • DEFAULT_RMIPORT

        public static final String DEFAULT_RMIPORT
    • Constructor Detail

      • XWikiExecutor

        public XWikiExecutor​(int index)
    • Method Detail

      • getPort

        public int getPort()
      • getStopPort

        public int getStopPort()
      • getRMIPort

        public int getRMIPort()
      • getDebugPort

        public int getDebugPort()
      • getExecutionDirectory

        public String getExecutionDirectory()
      • setXWikiOpts

        public void setXWikiOpts​(String opts)
      • setTimeoutSeconds

        public void setTimeoutSeconds​(long timeoutSeconds)
        Change the timeout checked when starting and initializing XWiki.
        Since:
        10.11RC1
      • addEnvironmentVariable

        public void addEnvironmentVariable​(String key,
                                           String value)
      • isManaged

        public boolean isManaged()
        Returns:
        true the XWiki instance was (successfully) started by the executor itself (other possibilities being failed startup or already running instance).
        Since:
        9.7RC1
      • start

        public void start()
                   throws Exception
        Start XWiki using the following strategy:
        • If the xwiki.test.startXWiki system property is set to "false" then don't start/stop XWiki
        • If the VERIFY_RUNNING_XWIKI_AT_START property is set then checks if an XWiki instance is already running before trying to start XWiki and if so, reuse it and don't start XWiki
        • If the VERIFY_RUNNING_XWIKI_AT_START property is set to false then verify if some XWiki instance is already running by verifying if the port is free and fail if so. Otherwise start XWiki.
        Throws:
        Exception - when failing to start XWiki
      • getWebInfDirectory

        public String getWebInfDirectory()
      • getXWikiCfgPath

        public String getXWikiCfgPath()
      • getXWikiPropertiesPath

        public String getXWikiPropertiesPath()
      • loadXWikiPropertiesConfiguration

        public org.apache.commons.configuration2.PropertiesConfiguration loadXWikiPropertiesConfiguration()
                                                                                                   throws Exception
        Throws:
        Exception
      • saveXWikiProperties

        public void saveXWikiProperties()
                                 throws Exception
        Throws:
        Exception
        Since:
        4.2M1
      • getURL

        public String getURL()