com.hazelcast.spi.discovery.DiscoveryStrategy Java Examples

The following examples show how to use com.hazelcast.spi.discovery.DiscoveryStrategy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DockerDNSRRDiscoveryStrategyFactory.java    From hazelcast-docker-swarm-discovery-spi with Apache License 2.0 5 votes vote down vote up
@Override
public DiscoveryStrategy newDiscoveryStrategy(
        DiscoveryNode discoveryNode,
        ILogger logger,
        //Implementing DiscoveryStrategyFactory method with a raw type
        @SuppressWarnings("rawtypes") Map<String, Comparable> properties
) {
    return
            new DockerDNSRRDiscoveryStrategy(
                    logger,
                    properties
            );
}
 
Example #2
Source File: HazelcastKubernetesDiscoveryStrategyFactoryTest.java    From hazelcast-kubernetes with Apache License 2.0 5 votes vote down vote up
@Test
public void createDiscoveryStrategy() {
    HashMap<String, Comparable> properties = new HashMap<String, Comparable>();
    properties.put(KubernetesProperties.KUBERNETES_API_TOKEN.key(), API_TOKEN);
    properties.put(KubernetesProperties.KUBERNETES_CA_CERTIFICATE.key(), CA_CERTIFICATE);
    properties.put(String.valueOf(KubernetesProperties.SERVICE_PORT), 333);
    properties.put(KubernetesProperties.NAMESPACE.key(), "default");
    HazelcastKubernetesDiscoveryStrategyFactory factory = new HazelcastKubernetesDiscoveryStrategyFactory();
    DiscoveryStrategy strategy = factory.newDiscoveryStrategy(discoveryNode, LOGGER, properties);
    assertTrue(strategy instanceof HazelcastKubernetesDiscoveryStrategy);
    strategy.start();
    strategy.destroy();
}
 
Example #3
Source File: DockerSwarmDiscoveryStrategyFactory.java    From hazelcast-docker-swarm-discovery-spi with Apache License 2.0 4 votes vote down vote up
public Class<? extends DiscoveryStrategy> getDiscoveryStrategyType() {
    // Returns the actual class type of the DiscoveryStrategy
    // implementation, to match it against the configuration
    return DockerSwarmDiscoveryStrategy.class;
}
 
Example #4
Source File: DockerSwarmDiscoveryStrategyFactory.java    From hazelcast-docker-swarm-discovery-spi with Apache License 2.0 4 votes vote down vote up
public DiscoveryStrategy newDiscoveryStrategy(DiscoveryNode discoveryNode,
                                              ILogger logger,
                                              Map<String, Comparable> properties) {

    return new DockerSwarmDiscoveryStrategy(discoveryNode, logger, properties);
}
 
Example #5
Source File: DockerDNSRRDiscoveryStrategyFactory.java    From hazelcast-docker-swarm-discovery-spi with Apache License 2.0 4 votes vote down vote up
@Override
public Class<? extends DiscoveryStrategy> getDiscoveryStrategyType() {
    return DockerDNSRRDiscoveryStrategy.class;
}
 
Example #6
Source File: ConsulDiscoveryStrategyFactory.java    From hazelcast-consul-discovery-spi with Apache License 2.0 4 votes vote down vote up
public Class<? extends DiscoveryStrategy> getDiscoveryStrategyType() {
	// Returns the actual class type of the DiscoveryStrategy
	// implementation, to match it against the configuration
	return ConsulDiscoveryStrategy.class;
}
 
Example #7
Source File: ConsulDiscoveryStrategyFactory.java    From hazelcast-consul-discovery-spi with Apache License 2.0 4 votes vote down vote up
public DiscoveryStrategy newDiscoveryStrategy(DiscoveryNode discoveryNode,
											  ILogger logger,
											  Map<String, Comparable> properties ) {

	return new ConsulDiscoveryStrategy( discoveryNode, logger, properties );                                      
}
 
Example #8
Source File: HazelcastKubernetesDiscoveryStrategyFactory.java    From hazelcast-kubernetes with Apache License 2.0 4 votes vote down vote up
public Class<? extends DiscoveryStrategy> getDiscoveryStrategyType() {
    return HazelcastKubernetesDiscoveryStrategy.class;
}
 
Example #9
Source File: HazelcastKubernetesDiscoveryStrategyFactory.java    From hazelcast-kubernetes with Apache License 2.0 4 votes vote down vote up
public DiscoveryStrategy newDiscoveryStrategy(DiscoveryNode discoveryNode, ILogger logger,
                                              Map<String, Comparable> properties) {

    return new HazelcastKubernetesDiscoveryStrategy(logger, properties);
}
 
Example #10
Source File: HazelcastKubernetesDiscoveryStrategyFactoryTest.java    From hazelcast-kubernetes with Apache License 2.0 4 votes vote down vote up
@Test
public void checkDiscoveryStrategyType() {
    HazelcastKubernetesDiscoveryStrategyFactory factory = new HazelcastKubernetesDiscoveryStrategyFactory();
    Class<? extends DiscoveryStrategy> strategyType = factory.getDiscoveryStrategyType();
    assertEquals(HazelcastKubernetesDiscoveryStrategy.class.getCanonicalName(), strategyType.getCanonicalName());
}