1 55 56 package org.jboss.axis; 57 58 import org.jboss.axis.handlers.BasicHandler; 59 import org.jboss.logging.Logger; 60 61 68 public class SimpleTargetedChain extends SimpleChain implements TargetedChain 69 { 70 private static Logger log = Logger.getLogger(SimpleTargetedChain.class.getName()); 71 72 protected Handler requestHandler; 73 protected Handler pivotHandler; 74 protected Handler responseHandler; 75 76 81 private class PivotIndicator extends BasicHandler 82 { 83 public PivotIndicator() 84 { 85 } 86 87 public void invoke(MessageContext msgContext) throws AxisFault 88 { 89 msgContext.setPastPivot(true); 90 } 91 } 92 93 96 public SimpleTargetedChain() 97 { 98 } 99 100 103 public SimpleTargetedChain(Handler handler) 104 { 105 pivotHandler = handler; 106 if (pivotHandler != null) 107 { 108 addHandler(pivotHandler); 109 addHandler(new PivotIndicator()); 110 } 111 } 112 113 117 public SimpleTargetedChain(Handler reqHandler, Handler pivHandler, 118 Handler respHandler) 119 { 120 init(reqHandler, null, pivHandler, null, respHandler); 121 } 122 123 128 protected void init(Handler reqHandler, Handler specialReqHandler, 129 Handler pivHandler, Handler specialRespHandler, 130 Handler respHandler) 131 { 132 133 requestHandler = reqHandler; 134 if (requestHandler != null) 135 addHandler(requestHandler); 136 137 if (specialReqHandler != null) 138 addHandler(specialReqHandler); 139 140 pivotHandler = pivHandler; 141 if (pivotHandler != null) 142 { 143 addHandler(pivotHandler); 144 addHandler(new PivotIndicator()); 145 } 146 147 if (specialRespHandler != null) 148 addHandler(specialRespHandler); 149 150 responseHandler = respHandler; 151 if (responseHandler != null) 152 addHandler(responseHandler); 153 } 154 155 public Handler getRequestHandler() 156 { 157 return (requestHandler); 158 } 159 160 public Handler getPivotHandler() 161 { 162 return (pivotHandler); 163 } 164 165 public Handler getResponseHandler() 166 { 167 return (responseHandler); 168 } 169 } 170 171 ; 172 | Popular Tags |