catch(Exception e){LogSupport.ignore(log,e);}
log.info("Stopping All servers");
Iterator s=_servers.iterator();
while(s.hasNext())
{
HttpServer server=(HttpServer)s.next();
try{server.stop();}
catch(Exception e){LogSupport.ignore(log,e);}
}
log.info("Exiting JVM");
System.exit(1);
}
}).start();
throw new HttpException(HttpResponse.__503_Service_Unavailable);
}
boolean start="start".equalsIgnoreCase(action);
String id=request.getParameter("ID");
StringTokenizer tok=new StringTokenizer(id,":");
int tokens=tok.countTokens();
String target=null;
try{
target=tok.nextToken();
int t=Integer.parseInt(target);
Iterator s=_servers.iterator();
HttpServer server=null;
while(s.hasNext() && t>=0)
if (t--==0)
server=(HttpServer)s.next();
else
s.next();
if (tokens==1)
{
// Server stop/start
if (start) server.start();
else server.stop();
}
else if (tokens==3)
{
// Listener stop/start
String l=tok.nextToken()+":"+tok.nextToken();
HttpListener[] listeners=server.getListeners();
for (int i2=0;i2<listeners.length;i2++)
{
HttpListener listener = listeners[i2];
if (listener.toString().indexOf(l)>=0)
{
if (start) listener.start();
else listener.stop();
}
}
}
else
{
String host=tok.nextToken();
if ("null".equals(host))
host=null;
String contextPath=tok.nextToken();
target+=":"+host+":"+contextPath;
if (contextPath.length()>1)
contextPath+="/*";
int contextIndex=Integer.parseInt(tok.nextToken());
target+=":"+contextIndex;
HttpContext
context=server.getContext(host,contextPath,contextIndex);
if (tokens==4)
{
// Context stop/start
if (start) context.start();