1 23 24 package com.sun.enterprise.deployment; 25 26 import java.util.LinkedList ; 27 import java.util.Iterator ; 28 import java.util.List ; 29 30 33 public class WebServiceHandlerChain extends Descriptor { 34 35 private LinkedList <WebServiceHandler> handlers; 38 39 private String protocolBinding = null; 40 private String serviceNamePattern = null; 41 private String portNamePattern = null; 42 43 public WebServiceHandlerChain(WebServiceHandlerChain other) { 45 super(other); 46 this.protocolBinding = other.protocolBinding; 47 this.serviceNamePattern = other.serviceNamePattern; 48 this.portNamePattern = other.portNamePattern; 49 if (other.handlers != null) { 50 handlers = new LinkedList (); 51 for (Iterator i = other.handlers.iterator(); i.hasNext();) { 52 WebServiceHandler wsh = (WebServiceHandler)i.next(); 53 handlers.addLast(new WebServiceHandler(wsh)); 54 } 55 } else { 56 handlers = null; 57 } 58 } 59 60 public WebServiceHandlerChain() { 61 handlers = new LinkedList (); 62 } 63 64 public void setProtocolBindings(String bindingId) { 65 protocolBinding = bindingId; 66 super.changed(); 67 } 68 69 public String getProtocolBindings() { 70 return protocolBinding; 71 } 72 73 public void setServiceNamePattern(String pattern) { 74 serviceNamePattern = pattern; 75 super.changed(); 76 } 77 78 public String getServiceNamePattern() { 79 return serviceNamePattern; 80 } 81 82 public void setPortNamePattern(String pattern) { 83 portNamePattern = pattern; 84 super.changed(); 85 } 86 87 public String getPortNamePattern() { 88 return portNamePattern; 89 } 90 91 95 public boolean hasHandlers() { 96 return ( handlers.size() > 0 ); 97 } 98 99 102 public void addHandler(WebServiceHandler handler) { 103 handlers.addLast(handler); 104 super.changed(); 105 } 106 107 public void removeHandler(WebServiceHandler handler) { 108 handlers.remove(handler); 109 super.changed(); 110 } 111 112 public void removeHandlerByName(String handlerName) { 113 for(Iterator iter = handlers.iterator(); iter.hasNext();) { 114 WebServiceHandler next = (WebServiceHandler) iter.next(); 115 if( next.getHandlerName().equals(handlerName) ) { 116 iter.remove(); 117 super.changed(); 118 break; 119 } 120 } 121 } 122 123 126 public List <WebServiceHandler> getHandlers() { 127 return handlers; 128 } 129 } 130 | Popular Tags |