01: package org.cougaar.mts.std;
02:
03: import javax.servlet.http.HttpServletRequest;
04: import java.io.PrintWriter;
05:
06: import org.cougaar.core.component.ServiceBroker;
07: import org.cougaar.core.mts.BaseServlet;
08: import org.cougaar.mts.base.BoundComponent;
09: import org.cougaar.mts.base.MessageTransportRegistryService;
10:
11: /**
12: * This Component tests the {@link MessageTransportRegistryService} by
13: * invoking its ipAddressChanged method.
14: */
15: public class AddressChangeServletComponent extends BoundComponent {
16: public void start() {
17: super .start();
18: ServiceBroker sb = getServiceBroker();
19: new AddressChangeServlet(sb);
20: }
21:
22: private static class AddressChangeServlet extends BaseServlet {
23: MessageTransportRegistryService svc;
24:
25: AddressChangeServlet(ServiceBroker sb) {
26: super (sb);
27: svc = (MessageTransportRegistryService) sb.getService(this ,
28: MessageTransportRegistryService.class, null);
29: }
30:
31: protected String getPath() {
32: return "/mts/address-changed-test";
33: }
34:
35: protected String getTitle() {
36: return "Address Change Test";
37: }
38:
39: protected void printPage(HttpServletRequest request,
40: PrintWriter out) {
41: svc.ipAddressChanged();
42: out.println("Link Protocols have been reset");
43: }
44:
45: }
46:
47: }
|