Package org.jboss.as.test.clustering.ejb

Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory.lookupStateful()


    @Test
    public void testStatefulFailover() throws Exception {
        ContextSelector<EJBClientContext> selector = EJBClientContextSelector.setup(CLIENT_PROPERTIES);
        try (EJBDirectory context = new RemoteEJBDirectory(MODULE_NAME)) {
            Incrementor bean = context.lookupStateful(StatefulIncrementorBean.class, Incrementor.class);

            Result<Integer> result = bean.increment();
            String target = result.getNode();
            int count = 1;
            System.out.println("Established weak affinity to " + target);
View Full Code Here


    @Test
    public void testConcurrentFailover() throws Exception {
        ContextSelector<EJBClientContext> selector = EJBClientContextSelector.setup(CLIENT_PROPERTIES);
        try (EJBDirectory directory = new RemoteEJBDirectory(MODULE_NAME)) {
            Incrementor bean = directory.lookupStateful(SlowToDestroyStatefulIncrementorBean.class, Incrementor.class);
            AtomicInteger count = new AtomicInteger();

            // Allow sufficient time for client to receive full topology
            Thread.sleep(CLIENT_TOPOLOGY_UPDATE_WAIT);
View Full Code Here

    private Incrementor locator;

    @PostConstruct
    public void postConstruct() {
        try (EJBDirectory directory = new RemoteEJBDirectory(MODULE)) {
            this.locator = directory.lookupStateful(StatefulIncrementorBean.class, Incrementor.class);
        } catch (NamingException e) {
            throw new IllegalStateException(e);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.