1 2 Previous Next 29 Replies Latest reply on Apr 21, 2008 9:07 AM by heiko.braun

    webservices ejb3 api usage

    starksm64

      The one usage that has no representation in the externalized ejb3 jars is the org.jboss.ejb3.session.ClassProxyHack in use by the webservices module. I know we had a discussion of needing a webservice/ejb3 spi. I'm not finding the jira issues yet, This thread should track the creation of this spi.

        • 1. Re: webservices ejb3 api usage
          alrubinger

          We'll have to check with Heiko about the status of this SPI getting defined. I'll email him a link to this topic.

          S,
          ALR

          • 2. Re: webservices ejb3 api usage
            starksm64

            The current org.jboss.wsf.container.jboss50.InvocationHandlerEJB3 that had the api issue is easily updated to use the org.jboss.ejb3.stateless.StatelessContainer.localInvoke. With that change I have all of the jbossas trunk compiling against the external ejb3 artifacts. I assume we still don't want to be using StatelessContainer directly.

            • 3. Re: webservices ejb3 api usage
              heiko.braun

               

              I assume we still don't want to be using StatelessContainer directly.


              Right, that should covered by the WS-EJB API. But as long as EJB3 is in a state of flux I don't put my fingers on. I was going to wait until it consolidates and there's one codebase left.


              • 4. Re: webservices ejb3 api usage
                heiko.braun

                There is two issues that need to be addressed by the API:

                a) EJB MetaData access
                b) Invocation handling

                Back at JBW, we talked about solving the later by going through the MC bus: http://labs.jboss.com/file-access/default/members/jbossmc/freezone/docs/2.0.x/userGuide/ch04s04.html

                Andrew, can you confirm that an indirect MC invocation is equivalent to an invocation through the EJB container?

                The meta data piece is a deployment issue. WS requires access to the EJB meta data down to session and mdb meta data details. One idea was to use something similiar to Container.resolveAnnotation(...), however I see that this part has been deprecated. What's the replacement for it?

                I havn't spent much time on these issues lately, so any comments and ideas are welcome.

                • 5. Re: webservices ejb3 api usage
                  alrubinger

                   

                  "heiko.braun@jboss.com" wrote:
                  As long as EJB3 is in a state of flux I don't put my fingers on. I was going to wait until it consolidates and there's one codebase left.


                  Pretend EJB3 Code in trunk doesn't exist, Heiko. At this point most of the stuff in there is just for compile-time constraints. The Projects location is where everything lives now.

                  So go ahead and touch it, we won't bite.

                  S,
                  ALR

                  • 6. Re: webservices ejb3 api usage
                    alrubinger

                     

                    "heiko.braun@jboss.com" wrote:
                    Andrew, can you confirm that an indirect MC invocation is equivalent to an invocation through the EJB container?


                    I cannot. Ping me online and we'll talk about it.


                    "heiko.braun@jboss.com" wrote:
                    One idea was to use something similiar to Container.resolveAnnotation(...), however I see that this part has been deprecated. What's the replacement for it?


                    Container.getAnnotation().

                    "heiko.braun@jboss.com" wrote:
                    I havn't spent much time on these issues lately, so any comments and ideas are welcome.


                    Let me know what you need and I'll work with you to get you started.

                    S,
                    ALR

                    • 7. Re: webservices ejb3 api usage
                      starksm64

                      The only code being used in jbossas trunk right now is the org.jboss.ejb3.deployers. I'm ready to remove the other code after I have the deployers better tested. That is what I'm doing right now.

                      • 8. Re: webservices ejb3 api usage
                        heiko.braun

                        For the records: This is where I left the meta data discussion:

                        http://jira.jboss.org/jira/browse/JBWS-1813

                        • 9. Re: webservices ejb3 api usage
                          heiko.braun

                          OK, as I said before I am looking at two areas that require decoupling:

                          a) Meta data retrieval
                          b) Invocation handling

                          For retrieving web service relevant meta data from a ejb3 deployment, I think the contract would cover certain Container methods and annotations representing web service meta data:

                          Container {
                          
                           [...]
                          
                           String getEjbName();
                           String getBeanClassName();
                           <T> T getAnnotation(Class<T>);
                          }
                          


                          That's basically already given, I would just need supply the annotations and their implementation and hook it up to the Ejb3DescriptorHandler, similar to the way TX and Security meta data is supplied.

                          • 10. Re: webservices ejb3 api usage
                            wolfc

                            Don't forget WebServiceRef and WebServiceContext injection.

                            • 11. Re: webservices ejb3 api usage
                              heiko.braun

                              Right, I did intend to cover injection with invocation handling, but webserviceref comes on it's own. That makes:


                              a) meta data retrieval
                              b) invocation handling + injection
                              c) web serviceref handling

                              • 12. Re: webservices ejb3 api usage
                                wolfc

                                You can't. WebServiceContext must be injected before PostConstruct is called. It's explicitly documented in JAX-WS 2.1 5.2.1 last paragraph.

                                • 13. Re: webservices ejb3 api usage
                                  heiko.braun

                                  Here's my 2 cents on invocation handling:

                                  Currently we use

                                  SessionContainer.localInvoke(method, args, null, callback)
                                  


                                  and the callback impl. supplies the WebServiceContext to the BeanContext.
                                  However the biggest problem with this approach is that the bean context doesn't have a generic way of supplying context properties. This currently forces us to cast to a particular beancontext (StatelessBeanContext).

                                  I think if we want to stick with that approach, we need to solve to problems:

                                  1) How to get to a container in the first place?
                                  2) How to inject a webservice context in a generic way?

                                  The first point currently relies in the ObjectName for that container and uses an aop Dispatcher to to get to the container. IMO both is crap and should be replaced by proper abstractions.

                                  The second point can be solved two ways: Either the WS callback does the injection on it's own using reflection (2.1) or the BeanContext offers a more generic way to supply injectable properties (2.2), so that we are not forced to cast to particular container implementations.

                                  I would favor 2.2, since dependency injection is already part of the EJB3 domain.





                                  • 14. Re: webservices ejb3 api usage
                                    heiko.braun

                                    But maybe there's a more generic way to do local invocations?
                                    Some abstraction like the client side service locator, i.e. getting references to beans through the business interface?

                                    1 2 Previous Next