anonymous wrote : I assumed that because the init method has been annotated
with a Factory annotation and the testVar component is initially null - that
this would cause the init method (i.e. method annotated with the Factory
annotation) to be invoked whenever one invokes any business method in
If you want something run on every invocation in a SLSB (or anything else for
that matter), you're looking for an interceptor. Check out the @LoggedIn
interceptor in the booking example for a simple implementation. The manual
covers this interceptor in section 2.6
All @Factory does is
The difference between @Factory and @Unwrap is that @Unwrap only works on
components. @Factory can work on contextual variables as well, like the String
example given.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3973923#3973923
Reply to the post :
@Unwrap is not just a factory. It can be used to do MUCH more than just
auto-instantiate something.
@Factory is used when you just want to auto-initialize some value from a
component.
@Unwrap is used when the component really manages the value.
View the original post :
Hi Gavin,
Thanks for the reply. Actually, something in the init and testSLSBMethod
methods would reference testVar. I just left that out.
In terms of @Create, is that not possible from a stateless session bean?
Thanks!
View the original post :
anonymous wrote : Thanks for the reply. Actually, something in the init and
testSLSBMethod methods would reference testVar.
No, what references the testVar *context variable*, not the testVar instance
variable? Do you understand what @Factory is for?
anonymous wrote : In terms of @Create, is
What I'm trying to achieve (or figure out) is why the init method isn't being
invoked when I call the testSLSBMethod. I assumed that because the init method
has been annotated with a Factory annotation and the testVar component is
initially null - that this would cause the init method (i.e.