Java 类com.hazelcast.core.InstanceEvent 实例源码

项目:hazelcast-archive    文件:InstanceListenerManager.java   
public void notifyListeners(Packet packet) {
    String id = (String) toObject(packet.getKey());
    int i = (Integer) toObject(packet.getValue());
    InstanceEvent.InstanceEventType instanceEventType = (i == 0) ? InstanceEvent.InstanceEventType.CREATED : InstanceEvent.InstanceEventType.DESTROYED;
    InstanceEvent event = new InstanceEvent(instanceEventType, (Instance) client.getClientProxy(id));
    for (final InstanceListener listener : instanceListeners) {
        switch (instanceEventType) {
            case CREATED:
                listener.instanceCreated(event);
                break;
            case DESTROYED:
                listener.instanceDestroyed(event);
                break;
            default:
                break;
        }
    }
}
项目:health-and-care-developer-network    文件:InstanceListenerManager.java   
public void notifyListeners(Packet packet) {
    String id = (String) toObject(packet.getKey());
    int i = (Integer) toObject(packet.getValue());
    InstanceEvent.InstanceEventType instanceEventType = (i == 0) ? InstanceEvent.InstanceEventType.CREATED
                                                                 : InstanceEvent.InstanceEventType.DESTROYED;
    InstanceEvent event = new InstanceEvent(instanceEventType, (Instance) client.getClientProxy(id));
    for (final InstanceListener listener : instanceListeners) {
        switch (instanceEventType) {
            case CREATED:
                listener.instanceCreated(event);
                break;
            case DESTROYED:
                listener.instanceDestroyed(event);
                break;
            default:
                break;
        }
    }
}
项目:usergrid    文件:HazelcastLifecycleMonitor.java   
@Override
public void instanceCreated( InstanceEvent event ) {
    Instance instance = event.getInstance();
    logger.info( "Created instance ID: [{}] Type: [{}]", instance.getId(), instance.getInstanceType() );
}
项目:usergrid    文件:HazelcastLifecycleMonitor.java   
@Override
public void instanceDestroyed( InstanceEvent event ) {
    Instance instance = event.getInstance();
    logger.info( "Destroyed instance ID: [{}] Type: [{}]", instance.getId(), instance.getInstanceType() );
}
项目:usergrid    文件:HazelcastTest.java   
@Override
public void instanceCreated( InstanceEvent event ) {
    Instance instance = event.getInstance();
    logger.info( "Created instance ID: [" + instance.getId() + "] Type: [" + instance.getInstanceType() + "]" );
}
项目:usergrid    文件:HazelcastTest.java   
@Override
public void instanceDestroyed( InstanceEvent event ) {
    Instance instance = event.getInstance();
    logger.info( "Destroyed isntance ID: [" + instance.getId() + "] Type: [" + instance.getInstanceType() + "]" );
}