Search in sources :

Example 1 with ConduitSelectorHolder

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);
    }
}
Also used : Endpoint(org.apache.cxf.endpoint.Endpoint) ConduitSelectorHolder(org.apache.cxf.endpoint.ConduitSelectorHolder) ConduitSelector(org.apache.cxf.endpoint.ConduitSelector)

Example 2 with ConduitSelectorHolder

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);
}
Also used : ConduitSelectorHolder(org.apache.cxf.endpoint.ConduitSelectorHolder) SLPropertiesMatcher(org.talend.esb.servicelocator.client.SLPropertiesMatcher) ConduitSelector(org.apache.cxf.endpoint.ConduitSelector)

Example 3 with ConduitSelectorHolder

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);
        }
    }
}
Also used : ConduitSelectorHolder(org.apache.cxf.endpoint.ConduitSelectorHolder) BusLifeCycleManager(org.apache.cxf.buslifecycle.BusLifeCycleManager) ConduitSelector(org.apache.cxf.endpoint.ConduitSelector)

Aggregations

ConduitSelector (org.apache.cxf.endpoint.ConduitSelector)3 ConduitSelectorHolder (org.apache.cxf.endpoint.ConduitSelectorHolder)3 BusLifeCycleManager (org.apache.cxf.buslifecycle.BusLifeCycleManager)1 Endpoint (org.apache.cxf.endpoint.Endpoint)1 SLPropertiesMatcher (org.talend.esb.servicelocator.client.SLPropertiesMatcher)1