-
1. Re: Seam Remoting Refactored
deniss.parhomenko Apr 18, 2006 12:39 PM (in response to shane.bryzak)is it possible to use @WebRemote with play Java Bean, I try to use it together with Hibenrate (not EJB3)
@Name("ticketReserveAction") @Scope(SESSION) @Interceptors(SeamInterceptor.class) @LoggedIn public class TicketReservAction { @WebRemote public String reserveTicket(String name){ return "reserved"; } }
-
2. Re: Seam Remoting Refactored
shane.bryzak Apr 18, 2006 6:25 PM (in response to shane.bryzak)There are two types of client stub that can be generated, "executable" stubs and "type" stubs. Executable stubs are behavioural, and are used to execute methods against your session bean components, while type stubs contain state and represent the types that can be passed in as parameters or returned as a result.
The type of client stub that is generated depends on the type of your Seam component. If the component is a session bean, then an executable stub will be generated, otherwise if it's an entity or javabean, then a type stub will be generated. In your example, the component type that would be returned by Seam.getComponentType() for your class is JAVA_BEAN (ie, its not a stateless or stateful session bean, nor an entity bean). So the default client stub that would be generated for this is a "type" stub (ie something that can contain state).
I'll ask Gavin if I should change the rules used to determine the stub type. It wouldn't be difficult to test for the existence of the @WebRemote annotation on any of the bean's methods, and if it exists to create an executable stub instead of a type stub. -
3. Re: Seam Remoting Refactored
gavin.king Apr 18, 2006 6:30 PM (in response to shane.bryzak)Yes, that sounds good.
Oh, and copy/paste what you just wrote into the docs ;) -
4. Re: Seam Remoting Refactored
gavin.king Apr 18, 2006 6:41 PM (in response to shane.bryzak)"deniss.parhomenko" wrote:
is it possible to use @WebRemote with play Java Bean, I try to use it together with Hibenrate (not EJB3)
Just be aware that plain JavaBeans don't have managed transactions or role-based security, which means that you would have to deal with those concerns by writing an interceptor. -
5. Re: Seam Remoting Refactored
shane.bryzak Apr 18, 2006 7:31 PM (in response to shane.bryzak)I've checked an update into CVS which will now check JAVA_BEAN components for any methods annotated with @WebRemote. If the annotation is found, then an executable stub will be generated allowing you to use remoting to call the methods of your component.
I've also updated the remoting docs with a description of the interface types. -
6. Re: Seam Remoting Refactored
deniss.parhomenko Apr 19, 2006 2:45 AM (in response to shane.bryzak)Thank you , i'll check it later