title: How to use hazelcast lock
body: <p>I have to upgrade an app which is using an old version of hazelcast to one of the more recent versions. There was some hazelcast lock functionality which has since been deprecated and removed altogether from the API. In particular, the old lock functionality worked as such:</p>
  
  <pre><code>Hazecast.getLock(myString);
  </code></pre>
  
  <p>The getLock function was a static method on Hazelcast. Now it is to be replaced with something like:</p>
  
  <pre><code>hazelcastInstance.getLock(myString);
  </code></pre>
  
  <p>...where the lock comes from one of the instances in the cluster. </p>
  
  <p>My question is, can I use any one of the instances in the hazelcast cluster to get the lock? And if so, will this lock all instances?</p>