本文整理了Java中com.hazelcast.core.IMap.removeEntryListener()
方法的一些代码示例,展示了IMap.removeEntryListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IMap.removeEntryListener()
方法的具体详情如下:
包路径:com.hazelcast.core.IMap
类名称:IMap
方法名:removeEntryListener
[英]Removes the specified entry listener.
Returns silently if there is no such listener added before.
[中]删除指定的条目侦听器。
如果之前没有添加此类侦听器,则以静默方式返回。
代码示例来源:origin: spring-projects/spring-session
@PreDestroy
public void close() {
this.sessions.removeEntryListener(this.sessionListenerId);
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public boolean removeEntryListener(String id) {
return map.removeEntryListener(id);
}
代码示例来源:origin: com.intrbiz.util/cache-hazelcast
@Override
public void close()
{
for (String listenerId : this.listenerIds)
{
this.cache.removeEntryListener(listenerId);
}
this.listenerIds.clear();
}
代码示例来源:origin: org.springframework.session/spring-session-hazelcast
@PreDestroy
public void close() {
this.sessions.removeEntryListener(this.sessionListenerId);
}
代码示例来源:origin: com.atlassian.cache/atlassian-cache-hazelcast
/**
* De-registers listeners. This method must be called when the bean is no longer required.
*/
@PreDestroy
public void destroy()
{
mapSettings.removeEntryListener(mapSettingsAddedListenerId);
mapSettings.removeEntryListener(mapSettingsUpdatedListenerId);
hazelcast.getCluster().removeMembershipListener(membershipListenerId);
}
代码示例来源:origin: spring-projects/spring-integration-extensions
@Override
protected void doStop() {
((IMap<?, ?>) this.distributedObject).removeEntryListener(getHazelcastRegisteredEventListenerId());
}
代码示例来源:origin: hazelcast/hazelcast-code-samples
public void run() {
IMap map = hazelcast.getMap("myMap");
final CountDownLatch latch = new CountDownLatch(1);
EntryListener listener = new EntryAdapter() {
@Override
public void onEntryEvent(EntryEvent event) {
latch.countDown();
}
};
String id = map.addLocalEntryListener(listener);
try {
latch.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
map.removeEntryListener(id);
}
}, 1);
代码示例来源:origin: hazelcast/hazelcast-code-samples
public void run() {
IMap map = hazelcast.getMap("myMap");
final CountDownLatch latch = new CountDownLatch(1);
EntryListener listener = new EntryAdapter() {
@Override
public void onEntryEvent(EntryEvent event) {
latch.countDown();
}
};
String id = map.addEntryListener(listener, true);
try {
latch.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
map.removeEntryListener(id);
}
}, 1);
代码示例来源:origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.core
/**
* Clean up method, removing the entry listener.
*/
public void removeEntryListener() {
if (hazelcastInstance == null) {
log.error("Couldn't unregister entry listener for execution plan: " + executionPlanName +
", for tenant-ID: " + tenantId
+ " as the hazelcast instance is not available.");
} else if (hazelcastInstance.getLifecycleService().isRunning()) {
log.error("Couldn't unregister entry listener for execution plan: " + executionPlanName +
", for tenant-ID: " + tenantId
+ " as the hazelcast instance is not active.");
} else {
hazelcastInstance.getMap(DistributedModeConstants.STORM_STATUS_MAP).removeEntryListener(listenerId);
}
}
代码示例来源:origin: io.snamp/internal-services
configurationMap.getHazelcastMap().removeEntryListener(membershipListenerMapRegistration);
} catch (final Exception e) {
OLogManager.instance().warn(this, "Failed to remove entry listener", e);
代码示例来源:origin: org.neo4j/neo4j-core-edge
@Override
public void stop()
{
log.info( String.format( "HazelcastCoreTopologyService stopping and unbinding from %s",
config.get( CoreEdgeClusterSettings.discovery_listen_address ) ) );
try
{
hazelcastInstance.getCluster().removeMembershipListener( membershipRegistrationId );
hazelcastInstance.getMap( EDGE_SERVER_BOLT_ADDRESS_MAP_NAME ).removeEntryListener( mapRegistrationId );
hazelcastInstance.getLifecycleService().terminate();
}
catch ( Throwable e )
{
log.warn( "Failed to stop Hazelcast", e );
}
finally
{
jobHandle.cancel( true );
}
}
代码示例来源:origin: spring-projects/spring-integration-extensions
@Override
protected void doStop() {
if (this.distributedObject instanceof IMap) {
((IMap<?, ?>) this.distributedObject).removeEntryListener(getHazelcastRegisteredEventListenerId());
}
else if (this.distributedObject instanceof MultiMap) {
((MultiMap<?, ?>) this.distributedObject).removeEntryListener(getHazelcastRegisteredEventListenerId());
}
else if (this.distributedObject instanceof ReplicatedMap) {
((ReplicatedMap<?, ?>) this.distributedObject).removeEntryListener(getHazelcastRegisteredEventListenerId());
}
else if (this.distributedObject instanceof IList) {
((IList<?>) this.distributedObject).removeItemListener(getHazelcastRegisteredEventListenerId());
}
else if (this.distributedObject instanceof ISet) {
((ISet<?>) this.distributedObject).removeItemListener(getHazelcastRegisteredEventListenerId());
}
else if (this.distributedObject instanceof IQueue) {
((IQueue<?>) this.distributedObject).removeItemListener(getHazelcastRegisteredEventListenerId());
}
else if (this.distributedObject instanceof ITopic) {
((ITopic<?>) this.distributedObject).removeMessageListener(getHazelcastRegisteredEventListenerId());
}
}
内容来源于网络,如有侵权,请联系作者删除!