Examples of StatelessEJBLocator


Examples of org.jboss.ejb.client.StatelessEJBLocator

     *
     * @throws Exception
     */
    @Test
    public void testRemoteSLSBInvocation() throws Exception {
        final StatelessEJBLocator<EchoRemote> locator = new StatelessEJBLocator(EchoRemote.class, APP_NAME, MODULE_NAME, EchoBean.class.getSimpleName(), "");
        final EchoRemote proxy = EJBClient.createProxy(locator);
        Assert.assertNotNull("Received a null proxy", proxy);
        final String message = "Hello world from a really remote client";
        final String echo = proxy.echo(message);
        Assert.assertEquals("Unexpected echo message", message, echo);
View Full Code Here

Examples of org.jboss.ejb.client.StatelessEJBLocator

     *
     * @throws Exception
     */
    @Test
    public void testRemoteSLSBWithInterceptors() throws Exception {
        final StatelessEJBLocator<EchoRemote> locator = new StatelessEJBLocator(EchoRemote.class, APP_NAME, MODULE_NAME, InterceptedEchoBean.class.getSimpleName(), "");
        final EchoRemote proxy = EJBClient.createProxy(locator);
        Assert.assertNotNull("Received a null proxy", proxy);
        final String message = "Hello world from a really remote client";
        final String echo = proxy.echo(message);
        final String expectedEcho = message + InterceptorTwo.MESSAGE_SEPARATOR + InterceptorOne.class.getSimpleName() + InterceptorOne.MESSAGE_SEPARATOR + InterceptorTwo.class.getSimpleName();
View Full Code Here

Examples of org.jboss.ejb.client.StatelessEJBLocator

     *
     * @throws Exception
     */
    @Test
    public void testRemoteSLSBWithCustomObjects() throws Exception {
        final StatelessEJBLocator<EmployeeManager> locator = new StatelessEJBLocator(EmployeeManager.class, APP_NAME, MODULE_NAME, EmployeeBean.class.getSimpleName(), "");
        final EmployeeManager proxy = EJBClient.createProxy(locator);
        Assert.assertNotNull("Received a null proxy", proxy);
        final String[] nickNames = new String[]{"java-programmer", "ruby-programmer", "php-programmer"};
        final Employee employee = new Employee(1, "programmer");
        // invoke on the bean
View Full Code Here

Examples of org.jboss.ejb.client.StatelessEJBLocator

     *
     * @throws Exception
     */
    @Test
    public void testGetBusinessObjectRemote() throws Exception {
        final StatelessEJBLocator<EchoRemote> locator = new StatelessEJBLocator(EchoRemote.class, APP_NAME, MODULE_NAME, EchoBean.class.getSimpleName(), "");
        final EchoRemote proxy = EJBClient.createProxy(locator);
        final EchoRemote getBusinessObjectProxy = proxy.getBusinessObject();
        Assert.assertNotNull("Received a null proxy", getBusinessObjectProxy);
        final String message = "Hello world from a really remote client";
        final String echo = getBusinessObjectProxy.echo(message);
View Full Code Here

Examples of org.jboss.ejb.client.StatelessEJBLocator

     * <p/>
     * Make sure that the CDI request scope is activated for remote EJB invocations
     */
    @Test
    public void testCdiRequestScopeActive() {
        final StatelessEJBLocator<EchoRemote> locator = new StatelessEJBLocator(EchoRemote.class, APP_NAME, MODULE_NAME, EchoBean.class.getSimpleName(), "");
        final EchoRemote proxy = EJBClient.createProxy(locator);
        Assert.assertTrue(proxy.testRequestScopeActive());
    }
View Full Code Here

Examples of org.jboss.ejb.client.StatelessEJBLocator

        this.beanName = beanName;
    }

    @Override
    public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) {
        Object value = EJBClient.createProxy(new StatelessEJBLocator(componentView.getViewClass(), applicationName, moduleName, beanName, distinctName));
        return new ValueManagedReference(new ImmediateValue(value));
    }
View Full Code Here

Examples of org.jboss.ejb.client.StatelessEJBLocator

                ejbLocator = EJBClient.createSession(viewClass, appName, moduleName, beanName, distinctName);
            } catch (Exception e) {
                throw EjbMessages.MESSAGES.failedToCreateSessionForStatefulBean(e, beanName);
            }
        } else {
            ejbLocator = new StatelessEJBLocator(viewClass, appName, moduleName, beanName, distinctName);
        }
        final Object proxy = EJBClient.createProxy(ejbLocator);

        return new ValueManagedReference(new ImmediateValue<Object>(proxy));
    }
View Full Code Here

Examples of org.jboss.ejb.client.StatelessEJBLocator

    @Test
    public void testReconnectionWithClientAPI() throws Throwable {
        final EJBClientTransactionContext localUserTxContext = EJBClientTransactionContext.createLocal();
        EJBClientTransactionContext.setGlobalContext(localUserTxContext);

        final StatelessEJBLocator<SimpleCrashBeanRemote> locator = new StatelessEJBLocator(SimpleCrashBeanRemote.class, "", DEPLOYMENT, SimpleCrashBean.class.getSimpleName(), "");
        final SimpleCrashBeanRemote proxy = EJBClient.createProxy(locator);

        assertNotNull(proxy);
        String echo = proxy.echo("Hello!");
        assertEquals("Hello!", echo);

        controller.stop(CONTAINER);
        log.info("===appserver stopped===");
        controller.start(CONTAINER);
        log.info("===appserver started again===");


        final StatelessEJBLocator<SimpleCrashBeanRemote> locator2 = new StatelessEJBLocator(SimpleCrashBeanRemote.class, "", DEPLOYMENT, SimpleCrashBean.class.getSimpleName(), "");
        final SimpleCrashBeanRemote proxy2 = EJBClient.createProxy(locator2);

        assertNotNull(proxy2);
        echo = proxy2.echo("Bye!");
        assertEquals("Bye!", echo);
View Full Code Here

Examples of org.jboss.ejb.client.StatelessEJBLocator

    /**
     * Tests a simple app client that calls an ejb with its command line parameters
     */
    @Test
    public void simpleAppClientTest() throws Exception {
        final StatelessEJBLocator<AppClientSingletonRemote> locator = new StatelessEJBLocator(AppClientSingletonRemote.class, APP_NAME, MODULE_NAME, AppClientStateSingleton.class.getSimpleName(), "");
        final AppClientSingletonRemote remote = EJBClient.createProxy(locator);
        remote.reset();
        final AppClientWrapper wrapper = new AppClientWrapper(archive, "--host=" + managementClient.getRemoteEjbURL(), "client-annotation.jar", "cmdLineParam");
        try {
            final String result = remote.awaitAppClientCall();
View Full Code Here

Examples of org.jboss.ejb.client.StatelessEJBLocator

     *
     * @throws Exception
     */
    @Test
    public void descriptorBasedAppClientTest() throws Exception {
        final StatelessEJBLocator<AppClientSingletonRemote> locator = new StatelessEJBLocator(AppClientSingletonRemote.class, APP_NAME, MODULE_NAME, AppClientStateSingleton.class.getSimpleName(), "");
        final AppClientSingletonRemote remote = EJBClient.createProxy(locator);
        remote.reset();
        final AppClientWrapper wrapper = new AppClientWrapper(archive, "--host=" + managementClient.getRemoteEjbURL(), "client-dd.jar", "");
        try {
            final String result = remote.awaitAppClientCall();
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.