Package org.apache.activemq.artemis.util
Class ServerUtil
- java.lang.Object
-
- org.apache.activemq.artemis.util.ServerUtil
-
public class ServerUtil extends Object
A tool to let clients start, stop and kill Artemis servers
-
-
Constructor Summary
Constructors Constructor Description ServerUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Processexecute(String artemisInstance, String jobName, String... args)static intgetServer(javax.jms.Connection connection)static javax.jms.ConnectiongetServerConnection(int server, javax.jms.Connection... connections)static voidkillServer(Process server)static voidkillServer(Process server, boolean forcibly)static ProcessstartServer(String artemisInstance, String serverName)static ProcessstartServer(String artemisInstance, String serverName, int id, int timeout)static ProcessstartServer(String artemisInstance, String serverName, int id, int timeout, File brokerProperties)static ProcessstartServer(String artemisInstance, String serverName, String uri, int timeout)static ProcessstartServer(String artemisInstance, String serverName, String uri, int timeout, File propertiesFile)static booleanwaitForServerToStart(int id, int timeout)static booleanwaitForServerToStart(int id, String username, String password, int timeout)static booleanwaitForServerToStart(String uri, long timeout)static booleanwaitForServerToStart(String uri, String username, String password, long timeout)static booleanwaitForServerToStartOnPort(int port, String username, String password, int timeout)
-
-
-
Method Detail
-
startServer
public static Process startServer(String artemisInstance, String serverName) throws Exception
- Throws:
Exception
-
startServer
public static Process startServer(String artemisInstance, String serverName, int id, int timeout) throws Exception
- Parameters:
artemisInstance-serverName- it will be used on logsid- it will be used to add on the porttimeout-- Returns:
- Throws:
Exception
-
startServer
public static Process startServer(String artemisInstance, String serverName, int id, int timeout, File brokerProperties) throws Exception
- Throws:
Exception
-
startServer
public static Process startServer(String artemisInstance, String serverName, String uri, int timeout) throws Exception
- Throws:
Exception
-
startServer
public static Process startServer(String artemisInstance, String serverName, String uri, int timeout, File propertiesFile) throws Exception
- Throws:
Exception
-
execute
public static Process execute(String artemisInstance, String jobName, String... args) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
waitForServerToStart
public static boolean waitForServerToStart(int id, int timeout) throws InterruptedException- Throws:
InterruptedException
-
waitForServerToStart
public static boolean waitForServerToStart(int id, String username, String password, int timeout) throws InterruptedException- Throws:
InterruptedException
-
waitForServerToStartOnPort
public static boolean waitForServerToStartOnPort(int port, String username, String password, int timeout) throws InterruptedException- Throws:
InterruptedException
-
waitForServerToStart
public static boolean waitForServerToStart(String uri, long timeout) throws InterruptedException
- Throws:
InterruptedException
-
waitForServerToStart
public static boolean waitForServerToStart(String uri, String username, String password, long timeout) throws InterruptedException
- Throws:
InterruptedException
-
killServer
public static void killServer(Process server, boolean forcibly) throws Exception
- Throws:
Exception
-
getServer
public static int getServer(javax.jms.Connection connection)
-
getServerConnection
public static javax.jms.Connection getServerConnection(int server, javax.jms.Connection... connections)
-
-