I am a newbie for Hazelcast. I would like to know how can I list current lock in Hazelcast console?
For ex. assume that i open three console and i have taken 3 lock as f
Console is just a test app to simulate basic functionalities of hazelcast.
To see your lock instances following code will help you.
HazelcastInstance hzInstance = Hazelcast.newHazelcastInstance(null);
Collection<Instance> instances = hzInstance.getInstances();
Set<Instance> locks = new HashSet<Instance>();
for (Instance inst : instances) {
if(inst.getInstanceType().equals(Instance.InstanceType.LOCK))
locks.add(inst);
}
With Hazelcast 3.X we have to use hz.getDistributedObjects()
.
Please refer Renaming "instance" to "distributed object" for more details.