Search in sources :

Example 6 with RemoteTransportProvider

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();
}
Also used : EJBClientConnection(org.jboss.ejb.client.EJBClientConnection) EJBClientContext(org.jboss.ejb.client.EJBClientContext) RemoteTransportProvider(org.jboss.ejb.protocol.remote.RemoteTransportProvider)

Aggregations

RemoteTransportProvider (org.jboss.ejb.protocol.remote.RemoteTransportProvider)6 EJBClientConnection (org.jboss.ejb.client.EJBClientConnection)5 EJBClientContext (org.jboss.ejb.client.EJBClientContext)5 Properties (java.util.Properties)4 InitialContext (javax.naming.InitialContext)3 Test (org.junit.Test)3 WildFlyInitialContextFactory (org.wildfly.naming.client.WildFlyInitialContextFactory)3 NamingException (javax.naming.NamingException)2 URI (java.net.URI)1 Provider (java.security.Provider)1 Date (java.util.Date)1 TimeoutException (java.util.concurrent.TimeoutException)1 EJBException (javax.ejb.EJBException)1 OperationBuilder (org.jboss.as.controller.client.OperationBuilder)1 InitialContext (org.jboss.as.naming.InitialContext)1 Heartbeat (org.jboss.as.test.clustering.cluster.ejb.remote.bean.Heartbeat)1 HeartbeatBean (org.jboss.as.test.clustering.cluster.ejb.remote.bean.HeartbeatBean)1 HttpClientProvider (org.wildfly.httpclient.ejb.HttpClientProvider)1 WildFlyElytronProvider (org.wildfly.security.WildFlyElytronProvider)1 AuthenticationConfiguration (org.wildfly.security.auth.client.AuthenticationConfiguration)1