2 Replies Latest reply on Dec 27, 2013 11:07 AM by Marcio Dantas

    Remote stateless ejb proxy variable scope

    Marcio Dantas Newbie

      Hi to all,

       

      I understand that there has been a lot of improvements and changes in Jboss 7 ejb remoting API.

      What should be the scope of remote stateless ejb proxies? I'm invoking the beans from another AS 7 instance.

       

      Is application scope fine?

       

      I would like to know more about how the API handles connections, IO channels and multiple threads.

      Is there documentation available on this?

       

      Best regards,

      Márcio

        • 1. Re: Remote stateless ejb proxy variable scope
          Wolf-Dieter Fink Master

          There is no central documentation at the moment.

           

          There are different approaches to connect EJB's.

          What kind of proxy do you store? If you use injection there should be no problem with the application scope.

          In general the Proxy has less functionality as in former releases. It will be just a simple implementation of the interface and it will not have connection informations.

          The routing to the real instance is done during method invocation at server (or ejb-client) library.

          • 2. Re: Remote stateless ejb proxy variable scope
            Marcio Dantas Newbie

            I'm using the approach described here: EJB invocations from a remote server instance - JBoss AS 7.1 - Project Documentation Editor .

             

            In my case the remote ejbs are stateless and the proxy is created and stored in a JSF application scoped managed bean.

            I don't use CDI injection because I'm in a portlet environment.

             

            Then, the remote ejb proxy gets injected in another beans (most of session beans), like in the code example below.

             

            @ManagedBean(name = "remoteEjbProducerMB")

            @ApplicationScoped

            public class RemoteEjbProducerMB {

                private RemoteInterfaceService remoteInterfaceService;

              

                public RemoteInterfaceService getRemoteInterfaceService() {

                    if (remoteInterfaceService == null) {

                        remoteInterfaceService = remoteEjbServiceLocator .doJndiLookUp(RemoteInterfaceService.class);

                    }

                    return remoteInterfaceService;

                }

            }

             

             

            @ManagedBean

            @SessionScoped

            public class SessionMB implements Serializable {

                ...

                @ManagedProperty(value = "#{remoteEjbProducerMB.remoteInterfaceService}")

                private transient RemoteInterfaceService remoteInterfaceService;

                ...

            }