String clientHost = RemoteServer.getClientHost();
subject = new Subject(false,
subject.getPrincipals(),
subject.getPublicCredentials(),
subject.getPrivateCredentials());
subject.getPrincipals().add(new JMXConnectionPrincipal(clientHost));
subject.setReadOnly();
}
catch(ServerNotActiveException e)
{
}