(1) look at
com.sun.enterprise.util.net.NetUtils.isRunning(port number)
That won't tell you if it really is DAS but well tell you if the port
is in use.
(2) To absolutely positively confirm that it is a DAS (not an instance)
and it is the CORRECT DAS -- AND if you happen to be on the same
machine as DAS
call the remote command named "__locations". All V3+ servers will
return their root directory. Compare with the directory you are
expecting. That's how you can tell if it's the "wrong" DAS or if it's
an instance
(3) If you are not on the same machine you can't use (2) to confirm but
you can still use it to confirm that you are talking to some sort of V3
server and then look for the domain name of interest in the path it
returns.
(4) Recommended. You can write a new RemoteCommand -- say "Identify"
and have it return a simple string like: "DAS, domain1" or "INSTANCE,
in1". THis would be generally useful and trivial to implement (make a
copy of UptimeCommand and modify)
============
How to call these remote commands?
Look in [admin/cli]
com.sun.enterprise.admin.cli.LocalServerCommand.isThisServer()
On 6/3/2010 3:05 AM, Yamini K B wrote:
I'm trying to find out what is the simplest way to check/get the status
of DAS? I saw ListDomainsCommand's getStatus() method but the comment
from Kedar says it needs to be redone. The comment itself is quite old
(2008) so I guess things must've changed now.
It would help if I can get some pointers on which class(es) to look at.
Um, what are you trying to accomplish? What kind of status are you
looking for and what are you going to do with the results?
I just need to know if DAS running/not running. This is needed for the
backup commands (currently the code for this is commented out):
private boolean isNotRunning() throws
CommandValidationException {
// TODO no status available in V3 yet.
return true;
/**
try {
ClientPluggableFeatureFactory cpff = getFeatureFactory();
DomainsManager dm =
cpff.getDomainsManager();
DomainConfig dc =
getDomainConfig(domainName);
InstancesManager im =
dm.getInstancesManager(dc);
final int state =
im.getInstanceStatus();
return state == Status.kInstanceNotRunningCode;
} catch (Exception e) {
throw new CommandValidationException(e);
}
*/
}
Thanks,
-Yamini
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: dev-help@glassfish.dev.java.net
--
Byron Nevins - Oracle Corporation
Home: 650-359-1290
Cell: 650-784-4123
Sierra: 209-295-2188