Java Code Examples for org.gradle.internal.concurrent.CompositeStoppable#stop()

The following examples show how to use org.gradle.internal.concurrent.CompositeStoppable#stop() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MessageHub.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void stop() {
    requestStop();

    CompositeStoppable stoppable = new CompositeStoppable();
    lock.lock();
    try {
        stoppable.add(outgoingUnicasts.values());
        stoppable.add(outgoingBroadcasts.values());
        stoppable.add(workers);
        stoppable.add(handlers);
        stoppable.add(connections);
        stoppable.add(router);
        stoppable.add(executors);
    } finally {
        outgoingUnicasts.clear();
        outgoingBroadcasts.clear();
        workers.clear();
        handlers.clear();
        lock.unlock();
    }

    stoppable.stop();
}
 
Example 2
Source File: MessageHub.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void stop() {
    requestStop();

    CompositeStoppable stoppable = new CompositeStoppable();
    lock.lock();
    try {
        stoppable.add(outgoingUnicasts.values());
        stoppable.add(outgoingBroadcasts.values());
        stoppable.add(workers);
        stoppable.add(handlers);
        stoppable.add(connections);
        stoppable.add(router);
        stoppable.add(executors);
    } finally {
        outgoingUnicasts.clear();
        outgoingBroadcasts.clear();
        workers.clear();
        handlers.clear();
        lock.unlock();
    }

    stoppable.stop();
}
 
Example 3
Source File: MessageHub.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void stop() {
    requestStop();

    CompositeStoppable stoppable = new CompositeStoppable();
    lock.lock();
    try {
        stoppable.add(outgoingUnicasts.values());
        stoppable.add(outgoingBroadcasts.values());
        stoppable.add(workers);
        stoppable.add(handlers);
        stoppable.add(connections);
        stoppable.add(router);
        stoppable.add(executors);
    } finally {
        outgoingUnicasts.clear();
        outgoingBroadcasts.clear();
        workers.clear();
        handlers.clear();
        lock.unlock();
    }

    stoppable.stop();
}
 
Example 4
Source File: MessageHub.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void stop() {
    requestStop();

    CompositeStoppable stoppable = new CompositeStoppable();
    lock.lock();
    try {
        stoppable.add(outgoingUnicasts.values());
        stoppable.add(outgoingBroadcasts.values());
        stoppable.add(workers);
        stoppable.add(handlers);
        stoppable.add(connections);
        stoppable.add(router);
        stoppable.add(executors);
    } finally {
        outgoingUnicasts.clear();
        outgoingBroadcasts.clear();
        workers.clear();
        handlers.clear();
        lock.unlock();
    }

    stoppable.stop();
}
 
Example 5
Source File: SftpClientFactory.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void stop() {
    synchronized (lock) {
        try {
            CompositeStoppable stoppable = new CompositeStoppable();
            for (LockableSftpClient client : clients.values()) {
                stoppable.add(client);
            }
            stoppable.stop();
        } finally {
            clients.clear();
        }
    }
}
 
Example 6
Source File: DefaultOutgoingBroadcast.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void stop() {
    CompositeStoppable stoppable;
    lock.lock();
    try {
        stoppable = CompositeStoppable.stoppable(hub, discoveryBroadcast, executor);
    } finally {
        connections.clear();
        lock.unlock();
    }
    stoppable.stop();
}
 
Example 7
Source File: DefaultWorkerProcess.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void cleanup() {
    CompositeStoppable stoppable;
    lock.lock();
    try {
        stoppable = CompositeStoppable.stoppable(acceptor, connection);
    } finally {
        this.connection = null;
        this.acceptor = null;
        this.execHandle = null;
        lock.unlock();
    }
    stoppable.stop();
}
 
Example 8
Source File: DefaultOutgoingBroadcast.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void stop() {
    CompositeStoppable stoppable;
    lock.lock();
    try {
        stoppable = CompositeStoppable.stoppable(hub, discoveryBroadcast, executor);
    } finally {
        connections.clear();
        lock.unlock();
    }
    stoppable.stop();
}
 
Example 9
Source File: DefaultWorkerProcess.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void cleanup() {
    CompositeStoppable stoppable;
    lock.lock();
    try {
        stoppable = CompositeStoppable.stoppable(acceptor, connection);
    } finally {
        this.connection = null;
        this.acceptor = null;
        this.execHandle = null;
        lock.unlock();
    }
    stoppable.stop();
}
 
Example 10
Source File: SftpClientFactory.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void stop() {
    synchronized (lock) {
        try {
            CompositeStoppable stoppable = new CompositeStoppable();
            for (LockableSftpClient client : clients.values()) {
                stoppable.add(client);
            }
            stoppable.stop();
        } finally {
            clients.clear();
        }
    }
}
 
Example 11
Source File: DefaultOutgoingBroadcast.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void stop() {
    CompositeStoppable stoppable;
    lock.lock();
    try {
        stoppable = CompositeStoppable.stoppable(hub, discoveryBroadcast, executor);
    } finally {
        connections.clear();
        lock.unlock();
    }
    stoppable.stop();
}
 
Example 12
Source File: DefaultWorkerProcess.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void cleanup() {
    CompositeStoppable stoppable;
    lock.lock();
    try {
        stoppable = CompositeStoppable.stoppable(acceptor, connection);
    } finally {
        this.connection = null;
        this.acceptor = null;
        this.execHandle = null;
        lock.unlock();
    }
    stoppable.stop();
}
 
Example 13
Source File: DefaultOutgoingBroadcast.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void stop() {
    CompositeStoppable stoppable;
    lock.lock();
    try {
        stoppable = CompositeStoppable.stoppable(hub, discoveryBroadcast, executor);
    } finally {
        connections.clear();
        lock.unlock();
    }
    stoppable.stop();
}
 
Example 14
Source File: DefaultWorkerProcess.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void cleanup() {
    CompositeStoppable stoppable;
    lock.lock();
    try {
        stoppable = CompositeStoppable.stoppable(acceptor, connection);
    } finally {
        this.connection = null;
        this.acceptor = null;
        this.execHandle = null;
        lock.unlock();
    }
    stoppable.stop();
}