Package com.proofpoint.http.client.balancing

Examples of com.proofpoint.http.client.balancing.HttpServiceBalancerImpl


    @BeforeMethod
    public void setup()
            throws Exception
    {
        balancer = new HttpServiceBalancerImpl("test collector balancer", new TestingReportCollectionFactory().createReportCollection(HttpServiceBalancerStats.class));

        httpClient = new BalancingHttpClient(balancer,
                new JettyHttpClient(new HttpClientConfig().setConnectTimeout(new Duration(10, SECONDS))),
                new BalancingHttpClientConfig());
        servlet = new DummyServlet();
View Full Code Here


        if (discoveryBalancer == null) {
            String name = new ObjectNameBuilder(HttpServiceBalancerStats.class.getPackage().getName())
                    .withProperty("type", "ServiceClient")
                    .withProperty("serviceType", "discovery")
                    .build();
            discoveryBalancer = new HttpServiceBalancerImpl("discovery", reportCollectionFactory.createReportCollection(HttpServiceBalancerStats.class, name));
        }
        return discoveryBalancer;
    }
View Full Code Here

        String name = new ObjectNameBuilder(HttpServiceBalancerStats.class.getPackage().getName())
                .withProperty("type", "ServiceClient")
                .withProperty("serviceType", type)
                .build();
        HttpServiceBalancerStats httpServiceBalancerStats = reportCollectionFactory.createReportCollection(HttpServiceBalancerStats.class, name);
        HttpServiceBalancerImpl balancer = new HttpServiceBalancerImpl(format("type=[%s], pool=[%s]", type, pool), httpServiceBalancerStats);
        ServiceDescriptorsUpdater updater = new ServiceDescriptorsUpdater(new HttpServiceBalancerListenerAdapter(balancer), type, selectorConfig, nodeInfo, lookupClient, executor);
        updater.start();

        return balancer;
    }
View Full Code Here

{
    @Test
    public void testNullServiceInventory()
            throws Exception
    {
        HttpServiceBalancerImpl balancer = mock(HttpServiceBalancerImpl.class);
        ServiceInventory serviceInventory = new ServiceInventory(new ServiceInventoryConfig(),
                new DiscoveryClientConfig(), new NodeInfo("test"),
                JsonCodec.jsonCodec(ServiceDescriptorsRepresentation.class),
                balancer);
View Full Code Here

    @Test
    public void testDeprecatedServiceInventory()
            throws Exception
    {
        HttpServiceBalancerImpl balancer = mock(HttpServiceBalancerImpl.class);
        ServiceInventory serviceInventory = new ServiceInventory(new ServiceInventoryConfig(),
                new DiscoveryClientConfig().setDiscoveryServiceURI(URI.create("https://example.com:4111")),
                new NodeInfo("test"),
                JsonCodec.jsonCodec(ServiceDescriptorsRepresentation.class),
                balancer);
View Full Code Here

    @Test
    public void testFileServiceInventory()
            throws Exception
    {
        HttpServiceBalancerImpl balancer = mock(HttpServiceBalancerImpl.class);
        ServiceInventoryConfig serviceInventoryConfig = new ServiceInventoryConfig()
                .setServiceInventoryUri(Resources.getResource("service-inventory.json").toURI());

        ServiceInventory serviceInventory = new ServiceInventory(serviceInventoryConfig,
                new DiscoveryClientConfig().setDiscoveryServiceURI(URI.create("http://example.com:4111")),
View Full Code Here

TOP

Related Classes of com.proofpoint.http.client.balancing.HttpServiceBalancerImpl

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.