Search in sources :

Example 1 with NodeAware

use of com.hazelcast.spi.NodeAware in project hazelcast by hazelcast.

the class HazelcastManagedContext method initialize.

@Override
public Object initialize(Object obj) {
    if (obj instanceof HazelcastInstanceAware) {
        HazelcastInstanceAware hazelcastInstanceAware = (HazelcastInstanceAware) obj;
        hazelcastInstanceAware.setHazelcastInstance(instance);
    }
    if (obj instanceof NodeAware) {
        NodeAware nodeAware = (NodeAware) obj;
        nodeAware.setNode(instance.node);
    }
    if (hasExternalContext) {
        return externalContext.initialize(obj);
    }
    return obj;
}
Also used : HazelcastInstanceAware(com.hazelcast.core.HazelcastInstanceAware) NodeAware(com.hazelcast.spi.NodeAware)

Aggregations

HazelcastInstanceAware (com.hazelcast.core.HazelcastInstanceAware)1 NodeAware (com.hazelcast.spi.NodeAware)1