Search in sources :

Example 1 with AllowsRetriesConnection

use of com.adaptris.core.AllowsRetriesConnection in project interlok by adaptris.

the class AdapterComponentChecker method checkInitialise.

@Override
public void checkInitialise(String xml) throws CoreException {
    AdaptrisMarshaller marshaller = DefaultMarshaller.getDefaultMarshaller();
    AdaptrisComponent component = (AdaptrisComponent) marshaller.unmarshal(xml);
    prepare(component);
    if (component instanceof AllowsRetriesConnection) {
        AllowsRetriesConnection retry = (AllowsRetriesConnection) component;
        if (retry.connectionAttempts() == -1) {
            retry.setConnectionAttempts(0);
        }
    }
    try {
        init(component);
    } finally {
        close(component);
    }
}
Also used : AllowsRetriesConnection(com.adaptris.core.AllowsRetriesConnection) AdaptrisMarshaller(com.adaptris.core.AdaptrisMarshaller) AdaptrisComponent(com.adaptris.core.AdaptrisComponent)

Example 2 with AllowsRetriesConnection

use of com.adaptris.core.AllowsRetriesConnection in project interlok by adaptris.

the class ServiceUtil method cloneForTesting.

private static AdaptrisConnection cloneForTesting(AdaptrisConnection conn) throws CoreException {
    if (conn == null) {
        return null;
    }
    AdaptrisConnection cloned = conn.cloneForTesting();
    if (cloned instanceof AllowsRetriesConnection) {
        AllowsRetriesConnection retry = (AllowsRetriesConnection) cloned;
        retry.setConnectionAttempts(0);
    }
    return cloned;
}
Also used : AllowsRetriesConnection(com.adaptris.core.AllowsRetriesConnection) AdaptrisConnection(com.adaptris.core.AdaptrisConnection)

Aggregations

AllowsRetriesConnection (com.adaptris.core.AllowsRetriesConnection)2 AdaptrisComponent (com.adaptris.core.AdaptrisComponent)1 AdaptrisConnection (com.adaptris.core.AdaptrisConnection)1 AdaptrisMarshaller (com.adaptris.core.AdaptrisMarshaller)1