use of org.jboss.ejb.protocol.remote.RemoteTransportProvider in project wildfly by wildfly.
the class LastNodeToLeaveRemoteEJBTestCase method createModifiedEJBClientContext.
/*
* Create a sort-of copy of the current context with a different cluster node selector
*
* TODO: We need an easier way to create modified EJB client contexts
*/
private EJBClientContext createModifiedEJBClientContext(EJBClientContext oldContext) {
final EJBClientContext.Builder ejbClientBuilder = new EJBClientContext.Builder();
// transport
ejbClientBuilder.addTransportProvider(new RemoteTransportProvider());
// configured connections
for (EJBClientConnection connection : oldContext.getConfiguredConnections()) {
EJBClientConnection.Builder builder = new EJBClientConnection.Builder();
builder.setDestination(connection.getDestination());
builder.setForDiscovery(connection.isForDiscovery());
ejbClientBuilder.addClientConnection(builder.build());
}
// cluster node selector
ejbClientBuilder.setClusterNodeSelector(new CustomClusterNodeSelector());
return ejbClientBuilder.build();
}
Aggregations