HashMap propBag = new HashMap();
propBag.put(PipeConstants.POLICY, map);
propBag.put(PipeConstants.WSDL_MODEL, ctxt.getWsdlModel());
propBag.put(PipeConstants.SERVICE, ctxt.getService());
propBag.put(PipeConstants.BINDING, ctxt.getBinding());
propBag.put(PipeConstants.ENDPOINT_ADDRESS, ctxt.getAddress());
propBag.put(PipeConstants.SERVICE_REF, svcRef);
propBag.put(PipeConstants.NEXT_PIPE,tail);
ClientSecurityPipe ret = new ClientSecurityPipe(propBag, tail);
AuthConfigRegistrationWrapper listenerWrapper = ClientPipeCloser.getInstance().lookupListenerWrapper(svcRef);
//there is a 1-1 mapping between Service_Ref and a ListenerWrapper
if (listenerWrapper != null) {
//override the listener that was created by the ConfigHelper CTOR :if one was already registered
listenerWrapper.incrementReference();
ret.getPipeHelper().setRegistrationWrapper(listenerWrapper);
} else {
//register a new listener
ClientPipeCloser.getInstance().registerListenerWrapper(
svcRef, ret.getPipeHelper().getRegistrationWrapper());
}
return ret;