Revision 7107
Added by ben leinfelder almost 13 years ago
src/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastService.java | ||
---|---|---|
48 | 48 |
import com.hazelcast.core.HazelcastInstance; |
49 | 49 |
import com.hazelcast.core.IMap; |
50 | 50 |
import com.hazelcast.core.ISet; |
51 |
import com.hazelcast.core.LifecycleEvent; |
|
52 |
import com.hazelcast.core.LifecycleListener; |
|
51 | 53 |
import com.hazelcast.core.Member; |
52 | 54 |
import com.hazelcast.core.MembershipEvent; |
53 | 55 |
import com.hazelcast.core.MembershipListener; |
... | ... | |
70 | 72 |
* The Hazelcast service enables Metacat as a Hazelcast cluster member |
71 | 73 |
*/ |
72 | 74 |
public class HazelcastService extends BaseService |
73 |
implements EntryListener<Identifier, SystemMetadata>, MembershipListener { |
|
75 |
implements EntryListener<Identifier, SystemMetadata>, MembershipListener, LifecycleListener {
|
|
74 | 76 |
|
75 | 77 |
private static final String SINCE_PROPERTY = "dateSysMetadataModified"; |
76 | 78 |
|
... | ... | |
530 | 532 |
|
531 | 533 |
} |
532 | 534 |
|
535 |
/** |
|
536 |
* In cases where this cluster is paused, we want to |
|
537 |
* check that the local store accurately reflects the shared |
|
538 |
* SystemMetadata map |
|
539 |
* @param event |
|
540 |
*/ |
|
541 |
@Override |
|
542 |
public void stateChanged(LifecycleEvent event) { |
|
543 |
logMetacat.debug("HZ LifecycleEvent.state: " + event.getState()); |
|
544 |
if (event.getState().equals(LifecycleEvent.LifecycleState.RESUMED)) { |
|
545 |
logMetacat.debug("HZ LifecycleEvent.state is RESUMED, calling synchronizeLocalStore()"); |
|
546 |
synchronizeLocalStore(); |
|
547 |
} |
|
548 |
} |
|
549 |
|
|
533 | 550 |
} |
Also available in: Unified diff
synchronizeLocalStore() when the cluster has a LifecycleEvent state change to RESUMED.