Search in sources :

Example 1 with CommunicationType

use of org.jumpmind.symmetric.model.NodeCommunication.CommunicationType in project symmetric-ds by JumpMind.

the class NodeCommunicationServiceTest method testNodeCommunicationTypeLengths.

@Test
public void testNodeCommunicationTypeLengths() {
    final int MAX_LENGTH_IN_DB = 10;
    for (CommunicationType communicationType : NodeCommunication.CommunicationType.values()) {
        String msg = communicationType.name() + " is too long for DB. " + communicationType.name().length() + " <= " + MAX_LENGTH_IN_DB;
        assertTrue(msg, communicationType.name().length() <= MAX_LENGTH_IN_DB);
    }
}
Also used : CommunicationType(org.jumpmind.symmetric.model.NodeCommunication.CommunicationType) Test(org.junit.Test)

Example 2 with CommunicationType

use of org.jumpmind.symmetric.model.NodeCommunication.CommunicationType in project symmetric-ds by JumpMind.

the class NodeCommunicationService method stop.

public void stop() {
    Collection<CommunicationType> services = new HashSet<NodeCommunication.CommunicationType>(executors.keySet());
    for (CommunicationType communicationType : services) {
        try {
            ExecutorService service = executors.get(communicationType);
            service.shutdownNow();
        } finally {
            executors.remove(communicationType);
        }
    }
}
Also used : NodeCommunication(org.jumpmind.symmetric.model.NodeCommunication) ExecutorService(java.util.concurrent.ExecutorService) HashSet(java.util.HashSet) CommunicationType(org.jumpmind.symmetric.model.NodeCommunication.CommunicationType)

Aggregations

CommunicationType (org.jumpmind.symmetric.model.NodeCommunication.CommunicationType)2 HashSet (java.util.HashSet)1 ExecutorService (java.util.concurrent.ExecutorService)1 NodeCommunication (org.jumpmind.symmetric.model.NodeCommunication)1 Test (org.junit.Test)1