Hi Mann,
yes, HazelcastInstance is injected in a LifecycleListener when
you declare it in your Config either as implementation or by class
name. Both of the following work in 3.7.1:
public class HzAwareListener implements HazelcastInstanceAware, LifecycleListener { ... } // set implementation to an existing instance of your listener class Config cfg = new Config(); cfg.addListenerConfig(new ListenerConfig().setImplementation(new HzAwareListener())); HazelcastInstance hz = Hazelcast.newHazelcastInstance(cfg);
// set class name in listener config; an instance will be created by Hazelcast Config cfg = new Config(); cfg.addListenerConfig(new ListenerConfig().setClassName("org.domain.HzAwareListener")); HazelcastInstance hz = Hazelcast.newHazelcastInstance(cfg);
Best,
Vassilis
-- You received this message because you are subscribed to the Google Groups "Hazelcast" group. To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com. To post to this group, send email to haze...@googlegroups.com. Visit this group at https://groups.google.com/group/hazelcast. To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/6e473af8-5d8e-4601-b0d8-a54c8d04c597%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.