Package io.micronaut.cache.hazelcast
Class HazelcastFactory
java.lang.Object
io.micronaut.cache.hazelcast.HazelcastFactory
Factory class that creates a
HazelcastInstance
.- Since:
- 1.0.0
- Author:
- Nirav Assar
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.hazelcast.core.HazelcastInstance
Create a singletonHazelcastInstance
client, if client config resource exists.com.hazelcast.core.HazelcastInstance
Create a singletonHazelcastInstance
instance, if instance config resource exists.com.hazelcast.core.HazelcastInstance
hazelcastInstance
(com.hazelcast.client.config.ClientConfig clientConfig) Create a singletonHazelcastInstance
client, based on an existingClientConfig
bean.com.hazelcast.core.HazelcastInstance
hazelcastInstance
(com.hazelcast.config.Config config) Create a singletonHazelcastInstance
member, based on an existingConfig
bean.
-
Constructor Details
-
HazelcastFactory
public HazelcastFactory()
-
-
Method Details
-
hazelcastInstance
@Requires(beans=com.hazelcast.client.config.ClientConfig.class) @Singleton @Bean(preDestroy="shutdown") public com.hazelcast.core.HazelcastInstance hazelcastInstance(com.hazelcast.client.config.ClientConfig clientConfig) Create a singletonHazelcastInstance
client, based on an existingClientConfig
bean.- Parameters:
clientConfig
- the configuration read it as a bean- Returns:
HazelcastInstance
-
hazelcastInstance
@Requires(beans=com.hazelcast.config.Config.class) @Singleton @Bean(preDestroy="shutdown") public com.hazelcast.core.HazelcastInstance hazelcastInstance(com.hazelcast.config.Config config) Create a singletonHazelcastInstance
member, based on an existingConfig
bean.- Parameters:
config
- the configuration read it as a bean- Returns:
HazelcastInstance
-
hazelcastClient
@Requires(missingBeans={com.hazelcast.config.Config.class,com.hazelcast.client.config.ClientConfig.class}) @Requires(condition=HazelcastClientConfigCondition.class) @Singleton @Named("hazelcastInstance") @Bean(preDestroy="shutdown") public com.hazelcast.core.HazelcastInstance hazelcastClient()Create a singletonHazelcastInstance
client, if client config resource exists.- Returns:
HazelcastInstance
-
hazelcastInstance
@Requires(missingBeans={com.hazelcast.config.Config.class,com.hazelcast.client.config.ClientConfig.class}) @Requires(condition=HazelcastInstanceConfigCondition.class) @Singleton @Bean(preDestroy="shutdown") public com.hazelcast.core.HazelcastInstance hazelcastInstance()Create a singletonHazelcastInstance
instance, if instance config resource exists.- Returns:
HazelcastInstance
-