use of com.adaptris.core.AdaptrisConnection in project interlok by adaptris.
the class JndiHelperTest method testUnbindCollection.
@Test
public void testUnbindCollection() throws Exception {
NullConnection connection = new NullConnection();
connection.setUniqueId(getName());
ArrayList<AdaptrisConnection> connectionList = new ArrayList<AdaptrisConnection>();
connectionList.add(connection);
JndiHelper.bind(connectionList);
JndiHelper.unbind(connectionList, false);
try {
JndiHelper.unbind(connectionList, false);
fail();
} catch (CoreException expected) {
}
}
use of com.adaptris.core.AdaptrisConnection in project interlok by adaptris.
the class FilteredSharedComponentStart method logActivity.
private void logActivity(ConnectionAction action, Collection<AdaptrisConnection> conns) {
if (log.isTraceEnabled()) {
List<String> names = new ArrayList<>();
for (AdaptrisConnection c : conns) {
names.add(c.getUniqueId());
}
log.trace("Filtered list for {} operation : {}", action, names);
}
}
use of com.adaptris.core.AdaptrisConnection in project interlok by adaptris.
the class FilteredSharedComponentStart method start.
@Override
public void start(Collection<AdaptrisConnection> conns) throws CoreException {
Collection<AdaptrisConnection> actual = filter(new ArrayList<AdaptrisConnection>(conns));
logActivity(ConnectionAction.START, actual);
for (AdaptrisConnection c : actual) {
execute(ConnectionAction.START, c);
}
}
use of com.adaptris.core.AdaptrisConnection in project interlok by adaptris.
the class FilteredSharedComponentStart method include.
private Collection<AdaptrisConnection> include(Collection<AdaptrisConnection> conns) {
if (getIncludes().size() == 0) {
return conns;
}
initialisePatterns();
List<AdaptrisConnection> result = new ArrayList<>();
for (AdaptrisConnection element : conns) {
for (Pattern pattern : includePatterns) {
if (pattern.matcher(element.getUniqueId()).find()) {
result.add(element);
break;
}
}
}
return result;
}
use of com.adaptris.core.AdaptrisConnection 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;
}
Aggregations