service.setEndpoint(endpoint);
}
void setPolicies() {
// use same WS-policies as for application endpoint
PolicyEngine engine = manager.getBus().getExtension(PolicyEngine.class);
if (null == engine || !engine.isEnabled()) {
return;
}
EndpointInfo ei = getEndpoint().getEndpointInfo();
PolicyInterceptorProviderRegistry reg = manager.getBus()
.getExtension(PolicyInterceptorProviderRegistry.class);
EndpointPolicy ep = null == conduit ? engine.getServerEndpointPolicy(applicationEndpoint
.getEndpointInfo(), null) : engine.getClientEndpointPolicy(applicationEndpoint.getEndpointInfo(),
conduit);
if (conduit != null) {
engine.setClientEndpointPolicy(ei, ep);
} else {
engine.setServerEndpointPolicy(ei, ep);
}
EffectivePolicy effectiveOutbound = new EffectivePolicyImpl(ep, reg, true, false);
EffectivePolicy effectiveInbound = new EffectivePolicyImpl(ep, reg, false, false);
BindingInfo bi = ei.getBinding();
Collection<BindingOperationInfo> bois = bi.getOperations();
for (BindingOperationInfo boi : bois) {
engine.setEffectiveServerRequestPolicy(ei, boi, effectiveInbound);
engine.setEffectiveServerResponsePolicy(ei, boi, effectiveOutbound);
engine.setEffectiveClientRequestPolicy(ei, boi, effectiveOutbound);
engine.setEffectiveClientResponsePolicy(ei, boi, effectiveInbound);
}
// TODO: FaultPolicy (SequenceFault)
}