Examples of RemoteEJBDirectory


Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory

    @Test
    public void test() throws Exception {

        ContextSelector<EJBClientContext> selector = EJBClientContextSelector.setup(CLIENT_PROPERTIES);

        try (EJBDirectory context = new RemoteEJBDirectory(MODULE_NAME)) {
            RegistryRetriever bean = context.lookupStateless(RegistryRetrieverBean.class, RegistryRetriever.class);
            Collection<String> names = bean.getNodes();
            assertEquals(2, names.size());
            assertTrue(names.toString(), names.contains(NODE_1));
            assertTrue(names.toString(), names.contains(NODE_2));
           
View Full Code Here

Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory

        return jar;
    }

    @BeforeClass
    public static void beforeClass() throws NamingException {
        directory = new RemoteEJBDirectory(ARCHIVE_NAME);
        singletonDirectory = new RemoteEJBDirectory(ARCHIVE_NAME_SINGLE);
    }
View Full Code Here

Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory

        this.testStatelessFailover(SECURE_CLIENT_PROPERTIES, SecureStatelessIncrementorBean.class);
    }

    private void testStatelessFailover(String properties, Class<? extends Incrementor> beanClass) throws Exception {
        ContextSelector<EJBClientContext> selector = EJBClientContextSelector.setup(properties);
        try (EJBDirectory context = new RemoteEJBDirectory(MODULE_NAME)) {
            Incrementor bean = context.lookupStateless(beanClass, Incrementor.class);

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

            List<String> results = new ArrayList<>(COUNT);
View Full Code Here

Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory

    }

    @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

Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory

    }

    @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

Examples of org.jboss.as.test.clustering.ejb.RemoteEJBDirectory

    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.