public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String pathInfo = request.getPathInfo(); String action = "Path info '" + pathInfo + "' not understood. Did nothing to"; Proxy streamingServerProxy = EndToEndFramework.getInstance().getStreamingServerProxy(); Proxy streamingServerProxyTwo = EndToEndFramework.getInstance().getStreamingServerProxyTwo(); if (pathInfo.contains("startTwo")) { if (streamingServerProxyTwo.isStopped()) { streamingServerProxyTwo.start(); } action = "Started"; } else if (pathInfo.contains("stopTwo")) { if (!streamingServerProxyTwo.isStopped()) { streamingServerProxyTwo.stop(); } action = "Stopped"; } else if (pathInfo.contains("start")) { if (streamingServerProxy.isStopped()) { streamingServerProxy.start(); } action = "Started"; } else if (pathInfo.contains("stop")) { if (!streamingServerProxy.isStopped()) { streamingServerProxy.stop(); } action = "Stopped"; } outputResponse(request, response, action); }
@Override public void destroy() { if (mbean != null) try { ManagementFactory.getPlatformMBeanServer().unregisterMBean(mbean.getObjectName()); } catch (Exception e) { e.printStackTrace(); } if (proxy != null) proxy.stop(); if (dicomConfig != null) dicomConfig.close(); }