use of org.apache.cxf.endpoint.ConduitSelectorHolder in project cxf by apache.
the class FailoverFeature method initializeProvider.
@Override
protected void initializeProvider(InterceptorProvider provider, Bus bus) {
if (provider instanceof ConduitSelectorHolder) {
ConduitSelectorHolder csHolder = (ConduitSelectorHolder) provider;
Endpoint endpoint = csHolder.getConduitSelector().getEndpoint();
ConduitSelector conduitSelector = initTargetSelector(endpoint);
csHolder.setConduitSelector(conduitSelector);
}
}
use of org.apache.cxf.endpoint.ConduitSelectorHolder in project tesb-rt-se by Talend.
the class LocatorFeatureImpl method initialize.
public void initialize(ConduitSelectorHolder conduitSelectorHolder, Bus bus) {
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "Initializing locator feature for bus " + bus + " and client configuration" + conduitSelectorHolder);
}
ConduitSelector conduitSelector = conduitSelectorHolder.getConduitSelector();
String selectionStrategy = (String) conduitSelector.getEndpoint().get(KEY_STRATEGY);
Map<String, String> endpointProps = getEndpointLocatorProperties(conduitSelector.getEndpoint());
SLPropertiesMatcher slPropsMatcher = createMatcher(endpointProps);
final ConduitSelectorHolder conduitSelectorHolder1 = conduitSelectorHolder;
clientEnabler.enable(conduitSelectorHolder1, slPropsMatcher, selectionStrategy);
}
use of org.apache.cxf.endpoint.ConduitSelectorHolder in project fabric8 by jboss-fuse.
the class FabricLoadBalancerFeature method initialize.
// this method will be used for JAXRS client
public void initialize(InterceptorProvider interceptorProvider, Bus bus) {
// try to find if the InterceptorProvider is a ConduitSelectorHolder
if (interceptorProvider instanceof ConduitSelectorHolder) {
ConduitSelectorHolder holder = (ConduitSelectorHolder) interceptorProvider;
// get the endpoint of the original ConduitSelector
ConduitSelector oldSelector = holder.getConduitSelector();
LoadBalanceTargetSelector selector = getDefaultLoadBalanceTargetSelector();
selector.setEndpoint(oldSelector.getEndpoint());
try {
selector.setLoadBalanceStrategy(getLoadBalanceStrategy());
holder.setConduitSelector(selector);
} catch (Exception e) {
LOG.error("Cannot setup the LoadBalanceStrategy due to " + e);
}
// setup the BusLifeCycleListener
BusLifeCycleManager manager = bus.getExtension(BusLifeCycleManager.class);
manager.registerLifeCycleListener(this);
try {
Thread.sleep(getWaitingForGroupEvent());
} catch (InterruptedException e) {
LOG.warn("InterruptedException when wait for the GroupEvent notification " + e);
}
}
}
Aggregations