Hi Sergey, I am wondering about the 'finally' block in the 'public Object invoke(Exchange exchange, Object request)' method of the JAXRSInvoker class.
For me, it is line numbers: 113-139. These lines call the resourceProvider to release the object instance in certain cases. Is this something that we can exclude from the JAXRSEJBInvoker? Should the bean manage all of its lifecycle based on the annotation or lifecycle-type (as when declared in xml)? In the InvokerFactory model, it releases the instance. In that model, the invoker plays the role of the resourceProvider by containing the Factory. I went through the CXFEasyBeansInvoker from easybeans, and compared it with the Jonas version, by commenting each line or group of lines with their location in the Jonas/CXF version. I think that now, we need to: Get the bean instance from the factory and use java.lang.reflect.Method to invoke the method. After the method is invoked, the bean is released. The InvokerFactory does that by way of the Invoker in the Jonas model. The Jonas model has JAXWSInvoker (with no invoke methods) managing other aspects of cleanup during invocation. The EasyBeansCXFInvoker invoke(w/ 4 params) method, contains, all the way down to the exceptionHandling, the essentials of the EasyBeans portion of the invocation. The remainder is common to AbstractInvoker. Right now, then, I am looking at JAXRSInvoker. If serverFactory.setResourceClass() won't work, how will we adjust it to allow for @Stateless, @Stateful, etc. annotations? I think that it currently throws an exception for an unknown annotation. Also, I've noticed that the JContainer3 has a method for creating a factory for itself. I am wondering about passing in factories. How will the factories be created? How will the IDeployable be created? I was thinking about passing that in to the RP and creating the factories that way, but maybe it would be better, somehow, to create the bean instance somewhere.. where??, and pass that into the RP, which can then invoke the JContainer3's start() method, which calls createBeanFactories(), which calls both createMessageDrivenBeanFactory and createSessionBeanFactory. So, passing the bean in, seems to be the, now, preferred, method, however, where and how is the bean going to be created? Do we declare it as a resourceClass? It does not seem to be focused on as being a class, in Easybeans, rather, the focus seems to be that of the entire deployable package or folder or archive. So, I am wondering what you think about the idea of passing the bean in and using it to start the factory, but am concerned about how cxf proposes to deploy this container? Should I be looking at the CXF/Jetty (such as cxfServlet) interface and finding out how the bean should be deploying through jetty? or are we just going to have the bean resource, lifecycle managed by factory, sitting alone as accessible through a servlet? I think that I am close to having the invoker finished. My main concern is how are we going to get the beans instantiated so that I can test them as being deployed? My main concern with the invoker is, what parts of JAXRSInvoker correspond to sf.declareResourceClass? If that method will not run for EJB annotations, what will become of cri and ori? Will we change declareResourceClasses? Will it be necessary? I just wanted to update you on my progress. The class-scanner in the RP might be moved out of the RP into whatever class creates an EJB IDeployable and packages it into a bean, returing a factory instance. Thanks, Ryan
