Package com.gemstone.gemfire.cache.util

Examples of com.gemstone.gemfire.cache.util.Gateway


    this.gateways = gateways;
  }
 
  private void configureGateways() {
    for (GatewayProxy gateway : gateways) {
      Gateway gw = gatewayHub.addGateway(
          gateway.getId(),
          gateway.getConcurrencyLevel() == null ? Gateway.DEFAULT_CONCURRENCY_LEVEL : gateway
              .getConcurrencyLevel());
      if (!CollectionUtils.isEmpty(gateway.getEndpoints())) {
        for (GatewayProxy.GatewayEndpoint endpoint : gateway.getEndpoints()) {
          gw.addEndpoint(endpoint.getId(), endpoint.getHost(), endpoint.getPort());
        }
      }
      if (!CollectionUtils.isEmpty(gateway.getListeners())) {
        for (GatewayEventListener listener : gateway.getListeners()) {
          gw.addListener(listener);
        }
      }
      if (gateway.getOrderPolicy() != null) {
        Assert.isTrue(validOrderPolicyValues.contains(gateway.getOrderPolicy()),
            "The value of order policy:'" + gateway.getOrderPolicy() + "' is invalid");
        gw.setOrderPolicy(OrderPolicy.valueOf(gateway.getOrderPolicy()));
      }
      if (gateway.getSocketBufferSize() != null) {
        gw.setSocketBufferSize(gateway.getSocketBufferSize());
      }

      if (gateway.getQueue() != null) {
        GatewayQueue queue = gateway.getQueue();
        GatewayQueueAttributes queueAttributes = gw.getQueueAttributes();
        if (queue.getAlertThreshold() != null) {
          queueAttributes.setAlertThreshold(queue.getAlertThreshold());
        }
        if (queue.getEnableBatchConflation() != null) {
          queueAttributes.setBatchConflation(queue.getEnableBatchConflation());
View Full Code Here


  CacheServer mockCacheServer() {
    return new StubCacheServer();
  }

  GatewayHub mockGatewayHub() {
    final Gateway gateway = mock(Gateway.class);

      when(gateway.getQueueAttributes()).thenReturn(mock(GatewayQueueAttributes.class));

    GatewayHub gatewayHub = mock(GatewayHub.class);

    when(gatewayHub.addGateway(anyString(),anyInt())).thenAnswer(new Answer<Gateway>() {
      @Override
View Full Code Here

TOP

Related Classes of com.gemstone.gemfire.cache.util.Gateway

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.