Search in sources :

Example 1 with EventListener

use of es.bsc.compss.types.data.listener.EventListener in project compss by bsc-wdc.

the class NIOAdaptor method registerCopy.

public void registerCopy(Copy c) {
    for (EventListener el : c.getEventListeners()) {
        Integer groupId = el.getId();
        LinkedList<Copy> copies = GROUP_TO_COPY.get(groupId);
        if (copies == null) {
            copies = new LinkedList<Copy>();
            GROUP_TO_COPY.put(groupId, copies);
        }
        copies.add(c);
    }
}
Also used : Copy(es.bsc.compss.types.data.operation.copy.Copy) EventListener(es.bsc.compss.types.data.listener.EventListener)

Example 2 with EventListener

use of es.bsc.compss.types.data.listener.EventListener in project compss by bsc-wdc.

the class DataOperation method notifyEnd.

private void notifyEnd(OpEndState state, Exception e) {
    synchronized (listeners) {
        endState = state;
        endException = e;
        // Check end state of the operation
        switch(state) {
            case OP_OK:
                for (EventListener listener : listeners) {
                    listener.notifyEnd(this);
                }
                break;
            case OP_IN_PROGRESS:
                break;
            case OP_WAITING_SOURCES:
                break;
            default:
                // OP_FAILED or OP_PREPARATION_FAILED
                for (EventListener listener : listeners) {
                    listener.notifyFailure(this, e);
                }
                break;
        }
    }
}
Also used : EventListener(es.bsc.compss.types.data.listener.EventListener)

Aggregations

EventListener (es.bsc.compss.types.data.listener.EventListener)2 Copy (es.bsc.compss.types.data.operation.copy.Copy)1