How to check if Glassfish DAS is running programmatically even if it is deployed on local machine or remote machine?
Using Java6
This is how you would normally check that glassfish is up and running:
But since you want to run it programmaticaly, what you can do is create an script and execute the script from the code with java.
try{
Runtime.getRuntime().exec("Path to my script");
}
catch(IOException e) {
System.out.println("exception");
}
If you are in linux, you could also create an script to grep for the glassfish process.