Package org.jboss.as.demos.ejb3.archive

Examples of org.jboss.as.demos.ejb3.archive.BMTStatefulBean


        return counter.getCount();
    }

    public String callAsync(String jndiName, String input) throws Exception {
        InitialContext ctx = new InitialContext();
        AsyncLocal bean = (AsyncLocal)ctx.lookup(jndiName);
        final Future<String> future = bean.asyncMethod(input);
        return future.get();
    }
View Full Code Here


public class ExerciseBMT implements Callable<String> {
    @Override
    public String call() throws Exception {
        InitialContext ctx = new InitialContext();
        String name = "java:global/ejb3-example/BMTStatefulBean!" + BMTStatefulBean.class.getName();
        BMTStatefulBean bean = (BMTStatefulBean) ctx.lookup(name);
        bean.setup("42");
        return bean.commit();
    }
View Full Code Here

    public String call() throws Exception {
        InitialContext ctx = new InitialContext();
        String name = "java:global/ejb3-example/SimpleStatefulSessionBean!" + SimpleStatefulSessionLocal.class.getName();
        SimpleStatefulSessionLocal bean = (SimpleStatefulSessionLocal) ctx.lookup(name);
        bean.setState("via another view");
        EchoService view = bean.getEchoService();
        return view.echo("echo service");
    }
View Full Code Here

            executor.submit(singletonBeanLookupThread);
        }
        latch.await();

        Context ctx = new InitialContext();
        SimpleSingletonLocal bean = (SimpleSingletonLocal) ctx.lookup(jndiName);
        return bean.getBeanInstanceCount();
    }
View Full Code Here

            executor.submit(singletonBeanAccessThread);
        }
        latch.await();

        Context ctx = new InitialContext();
        SimpleSingletonLocal counter = (SimpleSingletonLocal) ctx.lookup(jndiName);
        return counter.getCount();
    }
View Full Code Here

            executor.submit(singletonBeanLookupThread);
        }
        latch.await();

        Context ctx = new InitialContext();
        SimpleSingletonLocal bean = (SimpleSingletonLocal) ctx.lookup(jndiName);
        return bean.getBeanInstanceCount();
    }
View Full Code Here

            executor.submit(singletonBeanAccessThread);
        }
        latch.await();

        Context ctx = new InitialContext();
        SimpleSingletonLocal counter = (SimpleSingletonLocal) ctx.lookup(jndiName);
        return counter.getCount();
    }
View Full Code Here

    public Object call() throws Exception {
        try {

            for (int i = 0; i < numTimes; i++) {
                Context ctx = new InitialContext();
                SimpleSingletonLocal bean = (SimpleSingletonLocal) ctx.lookup(jndiName);
                bean.increment();
            }
        } finally {
            latch.countDown();
        }
        return null;
View Full Code Here

    public Object call() throws Exception {
        try {

            for (int i = 0; i < numTimes; i++) {
                Context ctx = new InitialContext();
                SimpleSingletonLocal bean = (SimpleSingletonLocal) ctx.lookup(jndiName);
                // invoke a no-op since the singleton bean instance gets created on invocation
                bean.doNothing();
            }
        } finally {
            latch.countDown();
        }
        return null;
View Full Code Here

public class ExerciseStateful implements Callable<String> {
    @Override
    public String call() throws Exception {
        InitialContext ctx = new InitialContext();
        String name = "java:global/ejb3-example/SimpleStatefulSessionBean!" + SimpleStatefulSessionLocal.class.getName();
        SimpleStatefulSessionLocal bean = (SimpleStatefulSessionLocal) ctx.lookup(name);
        bean.setState("42");
        return bean.echo("the answer");
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.demos.ejb3.archive.BMTStatefulBean

Copyright © 2018 www.massapicom. 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.