org.apache.cxf.endpoint.Client.getConduitSelector()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(220)

本文整理了Java中org.apache.cxf.endpoint.Client.getConduitSelector()方法的一些代码示例,展示了Client.getConduitSelector()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Client.getConduitSelector()方法的具体详情如下:
包路径:org.apache.cxf.endpoint.Client
类名称:Client
方法名:getConduitSelector

Client.getConduitSelector介绍

[英]Get the ConduitSelector responsible for retreiving the Conduit.
[中]让导管选择器负责回收导管。

代码示例

代码示例来源:origin: apache/cxf

@Override
public void initialize(Client client, Bus bus) {
  ConduitSelector selector = initTargetSelector(client.getConduitSelector().getEndpoint());
  client.setConduitSelector(selector);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-features-clustering

@Override
public void initialize(Client client, Bus bus) {
  ConduitSelector selector = initTargetSelector(client.getConduitSelector().getEndpoint());
  client.setConduitSelector(selector);
}

代码示例来源:origin: apache/cxf

protected void verifyConduitSelector(Greeter g) {
  assertTrue("unexpected conduit slector",
        ClientProxy.getClient(g).getConduitSelector()
        instanceof FailoverTargetSelector);
}

代码示例来源:origin: apache/cxf

protected void verifyStrategy(Object proxy, Class<?> clz) {
  ConduitSelector conduitSelector =
    ClientProxy.getClient(proxy).getConduitSelector();
  if (conduitSelector instanceof FailoverTargetSelector) {
    Object strategy =
      ((FailoverTargetSelector)conduitSelector).getStrategy();
    assertTrue("unexpected strategy", clz.isInstance(strategy));
  } else {
    fail("unexpected conduit selector: " + conduitSelector);
  }
}

代码示例来源:origin: apache/cxf

protected void setupGreeter() throws Exception {
  ClusteredGreeterService cs = new ClusteredGreeterService();
  // REVISIT: why doesn't the generic (i.e. non-Port-specific)
  // Service.getPort() load the <jaxws:client> configuration?
  greeter = cs.getReplicatedPortA();
  updateAddressPort(greeter, PORT_A);
  assertTrue("unexpected conduit selector: "
        + ClientProxy.getClient(greeter).getConduitSelector().getClass().getName(),
        ClientProxy.getClient(greeter).getConduitSelector()
        instanceof FailoverTargetSelector);
  updateWsdlExtensors("9051", PORT_A);
  updateWsdlExtensors("9052", PORT_B);
  updateWsdlExtensors("9053", PORT_C);
  updateWsdlExtensors("9055", PORT_E);
}

代码示例来源:origin: apache/cxf

protected void verifyStrategy(Object proxy, Class<?> clz, int count) {
  ConduitSelector conduitSelector =
    ClientProxy.getClient(proxy).getConduitSelector();
  if (conduitSelector instanceof FailoverTargetSelector) {
    AbstractStaticFailoverStrategy strategy =
      (AbstractStaticFailoverStrategy)
        ((FailoverTargetSelector)conduitSelector).getStrategy();
    assertTrue("unexpected strategy", clz.isInstance(strategy));
    List<String> alternates = strategy.getAlternateAddresses(null);
    assertNotNull("expected alternate addresses", alternates);
    assertEquals("unexpected alternate addresses", count, alternates.size());
  } else {
    fail("unexpected conduit selector: " + conduitSelector);
  }
}

代码示例来源:origin: apache/cxf

@Test
public void testDistributedSequentialStrategyWithFailover() throws Exception {
  startTarget(REPLICA_A);
  startTarget(REPLICA_B);
  startTarget(REPLICA_C);
  setupGreeter();
  stopTarget(REPLICA_B);
  ConduitSelector conduitSelector =
    ClientProxy.getClient(greeter).getConduitSelector();
  if (conduitSelector instanceof LoadDistributorTargetSelector) {
    ((LoadDistributorTargetSelector)conduitSelector).setStrategy(
        new LoadDistributorStaticStrategy());
  } else {
    fail("unexpected conduit selector: " + conduitSelector);
  }
  Map< String, Integer > responseCounts = new HashMap<>();
  for (int i = 0; i < 12; ++i) {
    String response = greeter.greetMe("fred");
    assertNotNull("expected non-null response", response);
    incrementResponseCount(responseCounts, response);
  }
  assertTrue((long)responseCounts.get(REPLICA_A) > 0);
  assertTrue((long)responseCounts.get(REPLICA_C) > 0);
  assertEquals(12, responseCounts.get(REPLICA_A) + responseCounts.get(REPLICA_C));
  stopTarget(REPLICA_A);
  stopTarget(REPLICA_C);
}

代码示例来源:origin: apache/cxf

verifyStrategy(greeter, SequentialStrategy.class, 3);
ConduitSelector conduitSelector =
  ClientProxy.getClient(greeter).getConduitSelector();
if (conduitSelector instanceof LoadDistributorTargetSelector) {
  ((LoadDistributorTargetSelector)conduitSelector).setFailover(false);

代码示例来源:origin: apache/cxf

ClientProxy.getClient(greeter).getConduitSelector();
if (conduitSelector instanceof LoadDistributorTargetSelector) {
  ((LoadDistributorTargetSelector)conduitSelector).setStrategy(

代码示例来源:origin: apache/cxf

stopTarget(REPLICA_B);
ConduitSelector conduitSelector =
  ClientProxy.getClient(greeter).getConduitSelector();
if (conduitSelector instanceof LoadDistributorTargetSelector) {
  ((LoadDistributorTargetSelector)conduitSelector).setStrategy(

相关文章