Examples of DictionaryService


Examples of com.bazaarvoice.ostrich.examples.dictionary.client.DictionaryService

                .build();

        // The service is partitioned, but partition filtering is configured by the ServiceFactory in this case
        // when the builder calls its configure() method.
        DictionaryServiceFactory serviceFactory = new DictionaryServiceFactory(config.getHttpClientConfiguration());
        DictionaryService service = ServicePoolBuilder.create(DictionaryService.class)
                .withServiceFactory(serviceFactory)
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, serviceFactory.getServiceName()))
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));
View Full Code Here

Examples of com.bazaarvoice.ostrich.examples.dictionary.client.DictionaryService

                .build();

        // The service is partitioned, but partition filtering is configured by the ServiceFactory in this case
        // when the builder calls its configure() method.
        DictionaryServiceFactory serviceFactory = new DictionaryServiceFactory(config.getHttpClientConfiguration());
        DictionaryService service = ServicePoolBuilder.create(DictionaryService.class)
                .withServiceFactory(serviceFactory)
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, serviceFactory.getServiceName()))
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));
View Full Code Here

Examples of com.bazaarvoice.ostrich.examples.dictionary.client.DictionaryService

                .withMaxServiceInstanceIdleTime(5, TimeUnit.MINUTES)
                .build();

        // The service is partitioned, but partition filtering is configured by the ServiceFactory in this case
        // when the builder calls its configure() method.
        DictionaryService service = ServicePoolBuilder.create(DictionaryService.class)
                .withServiceFactory(new DictionaryServiceFactory(configuration.getHttpClientConfiguration()))
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, "dictionary"))
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));
View Full Code Here

Examples of com.bazaarvoice.ostrich.examples.dictionary.client.DictionaryService

                .build();

        // The service is partitioned, but partition filtering is configured by the ServiceFactory in this case
        // when the builder calls its configure() method.
        DictionaryServiceFactory serviceFactory = new DictionaryServiceFactory(config.getHttpClientConfiguration());
        DictionaryService service = ServicePoolBuilder.create(DictionaryService.class)
                .withServiceFactory(serviceFactory)
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, serviceFactory.getServiceName()))
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));
View Full Code Here

Examples of com.bazaarvoice.ostrich.examples.dictionary.client.DictionaryService

                .build();

        // The service is partitioned, but partition filtering is configured by the ServiceFactory in this case
        // when the builder calls its configure() method.
        DictionaryServiceFactory serviceFactory = new DictionaryServiceFactory(config.getHttpClientConfiguration());
        DictionaryService service = ServicePoolBuilder.create(DictionaryService.class)
                .withServiceFactory(serviceFactory)
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, serviceFactory.getServiceName()))
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));
View Full Code Here

Examples of com.bazaarvoice.ostrich.examples.dictionary.client.DictionaryService

        // The service is partitioned, but partition filtering is configured by the ServiceFactory in this case
        // when the builder calls its configure() method.
        JerseyClientConfiguration httpClientConfiguration = config.getHttpClientConfiguration();
        MetricRegistry metrics = new MetricRegistry();
        DictionaryServiceFactory serviceFactory = new DictionaryServiceFactory(httpClientConfiguration, metrics);
        DictionaryService service = ServicePoolBuilder.create(DictionaryService.class)
                .withServiceFactory(serviceFactory)
                .withHostDiscovery(new ZooKeeperHostDiscovery(curator, serviceFactory.getServiceName(), metrics))
                .withMetricRegistry(metrics)
                .withCachingPolicy(cachingPolicy)
                .buildProxy(new ExponentialBackoffRetry(5, 50, 1000, TimeUnit.MILLISECONDS));
View Full Code Here

Examples of org.apache.felix.examples.dictionaryservice.DictionaryService

                boolean correct = false;

                // Check each available dictionary for the current word.
                for ( int i = 0; ( !correct ) && ( i < m_svcObjList.size() ); i++ )
                {
                    DictionaryService dictionary = ( DictionaryService ) m_svcObjList.get( i );

                    if ( dictionary.checkWord( word ) )
                    {
                        correct = true;
                    }
                }
View Full Code Here

Examples of org.apache.felix.examples.dictionaryservice.DictionaryService

                boolean correct = false;

                // Check each available dictionary for the current word.
                for ( int i = 0; ( !correct ) && ( i < m_svcObjList.size() ); i++ )
                {
                    DictionaryService dictionary = ( DictionaryService ) m_svcObjList.get( i );

                    if ( dictionary.checkWord( word ) )
                    {
                        correct = true;
                    }
                }
View Full Code Here

Examples of org.apache.felix.examples.dictionaryservice.DictionaryService

                        break;
                    }

                    // First, get a dictionary service and then check
                    // if the word is correct.
                    DictionaryService dictionary = ( DictionaryService ) context.getService( refs[0] );
                    if ( dictionary.checkWord( word ) )
                    {
                        System.out.println( "Correct." );
                    }
                    else
                    {
View Full Code Here

Examples of org.apache.felix.examples.dictionaryservice.DictionaryService

                    boolean correct = false;

                    // Check each available dictionary for the current word.
                    for ( int i = 0; ( !correct ) && ( i < m_refList.size() ); i++ )
                    {
                        DictionaryService dictionary = ( DictionaryService ) m_refToObjMap.get( m_refList.get( i ) );

                        if ( dictionary.checkWord( word ) )
                        {
                            correct = true;
                        }
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.