use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ObjectMultiMapProxy method isLocked.
@Override
public boolean isLocked(K key) {
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
final NodeEngine nodeEngine = getNodeEngine();
Data dataKey = nodeEngine.toData(key);
return lockSupport.isLocked(nodeEngine, dataKey);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ObjectMultiMapProxy method unlock.
@Override
public void unlock(K key) {
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
final NodeEngine nodeEngine = getNodeEngine();
Data dataKey = nodeEngine.toData(key);
lockSupport.unlock(nodeEngine, dataKey);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ObjectMultiMapProxy method initialize.
@Override
public void initialize() {
final NodeEngine nodeEngine = getNodeEngine();
List<EntryListenerConfig> listenerConfigs = config.getEntryListenerConfigs();
for (EntryListenerConfig listenerConfig : listenerConfigs) {
EntryListener listener = null;
if (listenerConfig.getImplementation() != null) {
listener = listenerConfig.getImplementation();
} else if (listenerConfig.getClassName() != null) {
try {
listener = ClassLoaderUtil.newInstance(nodeEngine.getConfigClassLoader(), listenerConfig.getClassName());
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
}
if (listener != null) {
if (listener instanceof HazelcastInstanceAware) {
((HazelcastInstanceAware) listener).setHazelcastInstance(nodeEngine.getHazelcastInstance());
}
if (listenerConfig.isLocal()) {
addLocalEntryListener(listener);
} else {
addEntryListener(listener, listenerConfig.isIncludeValue());
}
}
}
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ObjectMultiMapProxy method get.
@Override
public Collection<V> get(K key) {
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
final NodeEngine nodeEngine = getNodeEngine();
Data dataKey = nodeEngine.toData(key);
MultiMapResponse result = getAllInternal(dataKey);
return result.getObjectCollection(nodeEngine);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ObjectMultiMapProxy method values.
@Override
public Collection<V> values() {
final NodeEngine nodeEngine = getNodeEngine();
Map map = valuesInternal();
Collection values = new LinkedList();
for (Object obj : map.values()) {
if (obj == null) {
continue;
}
MultiMapResponse response = nodeEngine.toObject(obj);
values.addAll(response.getObjectCollection(nodeEngine));
}
return values;
}
Aggregations