You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Ivan <xh...@gmail.com> on 2010/06/17 16:03:54 UTC

How to invoke the ejbTimeout method ?

Hi,
    While working with AroundTimeout implementation, I found that OpenEJB
treats it as a normal business method, and in EJBTimerServiceImpl, I can see
some codes like :
   --->
   try {
          RpcContainer container = (RpcContainer) deployment.getContainer();
          Method ejbTimeout = deployment.getEjbTimeout();
          container.invoke(deployment.getDeploymentID(),
ejbTimeout.getDeclaringClass(), ejbTimeout, new Object[] {timer},
timerData.getPrimaryKey());
        }
   <---
     In my plan, I wish to handle AroundTimeout as normal lifecycle
intercepor methods, it means that I need to set the Operation.TIMEOUT to
invocation context. But with existing codes, I do not find a chance to
configure it. I am wondering whether we could update the RpcContainer
interface and add a new invoke method ? In that method, we could configure
the Operation type.
     Another thing is that if the user call the ejbTimeout method via client
view, which interceptor methods should be invoked, AroundInvoke or
AroundTimeout ? I guess that it should be AroundInvoke ?
     Comments ?

-- 
Ivan

Re: How to invoke the ejbTimeout method ?

Posted by David Blevins <da...@visi.com>.
On Jun 22, 2010, at 7:48 PM, Ivan wrote:

> Hi,
>    Thanks, David. Wish that I did not give you the feeling that I am
> "pushing" you  ;-)

No it's great.  We're lucky to have you!

Got that patch committed.  Loved the test cases.

I had changed the EjbJarInfoBuilder a bit after your patch and had to manually tweak it a bit to get it applied.  I'm not sure if I left it out, but seems like we may still be missing aroundTimeout "copyCallbacks" call for MDBs.  If that's the case, maybe we should get an MDB timeout test in there.

Smaller side note, we could probably change:

 1.aroundInvoke.missing.possibleTypo = AroundInvoke/AroundTimeout method missing or invalid
To
 1.aroundInvoke.missing.possibleTypo = {0} method missing or invalid

Normally we don't put params in level 1 messages, but that's a good place to break the rules :)

>    Schedule annotation support is fine for me, it is related to something I
> had done before.

Cool.  Got some info on that, will post in another thread.


Excellent work as always, Ivan!

-David


> 
> 2010/6/23 David Blevins <da...@visi.com>
> 
>> FYI, reviewed it and it looks great.  Have to review and commit Thiago's
>> patch as he's been waiting a little longer, but I plan to commit this one as
>> is.  I have a couple small tweaks but insignificant and can easily be done
>> later.
>> 
>> Feel free hack on @Schedule and other timer stuff.  Or if there's something
>> else that attracts you that's good too.  Drop a note either way and I'll
>> assign it to you.
>> 
>> -David
>> 
>> 
>> Begin forwarded message:
>> 
>>> Resent-From: <db...@visi.com>
>>> From: Ivan <xh...@gmail.com>
>>> Date: June 18, 2010 2:19:49 AM PDT
>>> To: dev@openejb.apache.org
>>> Subject: Re: How to invoke the ejbTimeout method ?
>>> Reply-To: dev@openejb.apache.org
>>> 
>>> Thanks, David, it is a good choice to add a new InterfaceType. I have
>>> attached the patch to OpenEJB-1221, if any problem, please let me know.
>>> 
>>> 2010/6/18 David Blevins <da...@visi.com>
>>> 
>>>> 
>>>> On Jun 17, 2010, at 7:03 AM, Ivan wrote:
>>>> 
>>>>> Hi,
>>>>>  While working with AroundTimeout implementation, I found that OpenEJB
>>>>> treats it as a normal business method, and in EJBTimerServiceImpl, I
>> can
>>>> see
>>>>> some codes like :
>>>>> --->
>>>>> try {
>>>>>        RpcContainer container = (RpcContainer)
>>>> deployment.getContainer();
>>>>>        Method ejbTimeout = deployment.getEjbTimeout();
>>>>>        container.invoke(deployment.getDeploymentID(),
>>>>> ejbTimeout.getDeclaringClass(), ejbTimeout, new Object[] {timer},
>>>>> timerData.getPrimaryKey());
>>>>>      }
>>>>> <---
>>>>>   In my plan, I wish to handle AroundTimeout as normal lifecycle
>>>>> intercepor methods, it means that I need to set the Operation.TIMEOUT
>> to
>>>>> invocation context. But with existing codes, I do not find a chance to
>>>>> configure it. I am wondering whether we could update the RpcContainer
>>>>> interface and add a new invoke method ? In that method, we could
>>>> configure
>>>>> the Operation type.
>>>> 
>>>> We can probably treat it as a new InterfaceType.  Maybe
>>>> InterfaceType.TIMEOUT or something.
>>>> 
>>>>>   Another thing is that if the user call the ejbTimeout method via
>>>> client
>>>>> view, which interceptor methods should be invoked, AroundInvoke or
>>>>> AroundTimeout ? I guess that it should be AroundInvoke ?
>>>> 
>>>> Right, it would be a plain AroundInvoke.  Basically any method, say a
>>>> PostConstruct method, could be exposed as a business method.  In that
>> case
>>>> it gets treated as a plain business method.
>>>> 
>>>> 
>>>> -David
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> Ivan
>> 
>> 
> 
> 
> -- 
> Ivan


Re: How to invoke the ejbTimeout method ?

Posted by Ivan <xh...@gmail.com>.
Hi,
    Thanks, David. Wish that I did not give you the feeling that I am
"pushing" you  ;-)
    Schedule annotation support is fine for me, it is related to something I
had done before.

2010/6/23 David Blevins <da...@visi.com>

> FYI, reviewed it and it looks great.  Have to review and commit Thiago's
> patch as he's been waiting a little longer, but I plan to commit this one as
> is.  I have a couple small tweaks but insignificant and can easily be done
> later.
>
> Feel free hack on @Schedule and other timer stuff.  Or if there's something
> else that attracts you that's good too.  Drop a note either way and I'll
> assign it to you.
>
> -David
>
>
> Begin forwarded message:
>
> > Resent-From: <db...@visi.com>
> > From: Ivan <xh...@gmail.com>
> > Date: June 18, 2010 2:19:49 AM PDT
> > To: dev@openejb.apache.org
> > Subject: Re: How to invoke the ejbTimeout method ?
> > Reply-To: dev@openejb.apache.org
> >
> > Thanks, David, it is a good choice to add a new InterfaceType. I have
> > attached the patch to OpenEJB-1221, if any problem, please let me know.
> >
> > 2010/6/18 David Blevins <da...@visi.com>
> >
> >>
> >> On Jun 17, 2010, at 7:03 AM, Ivan wrote:
> >>
> >>> Hi,
> >>>   While working with AroundTimeout implementation, I found that OpenEJB
> >>> treats it as a normal business method, and in EJBTimerServiceImpl, I
> can
> >> see
> >>> some codes like :
> >>>  --->
> >>>  try {
> >>>         RpcContainer container = (RpcContainer)
> >> deployment.getContainer();
> >>>         Method ejbTimeout = deployment.getEjbTimeout();
> >>>         container.invoke(deployment.getDeploymentID(),
> >>> ejbTimeout.getDeclaringClass(), ejbTimeout, new Object[] {timer},
> >>> timerData.getPrimaryKey());
> >>>       }
> >>>  <---
> >>>    In my plan, I wish to handle AroundTimeout as normal lifecycle
> >>> intercepor methods, it means that I need to set the Operation.TIMEOUT
> to
> >>> invocation context. But with existing codes, I do not find a chance to
> >>> configure it. I am wondering whether we could update the RpcContainer
> >>> interface and add a new invoke method ? In that method, we could
> >> configure
> >>> the Operation type.
> >>
> >> We can probably treat it as a new InterfaceType.  Maybe
> >> InterfaceType.TIMEOUT or something.
> >>
> >>>    Another thing is that if the user call the ejbTimeout method via
> >> client
> >>> view, which interceptor methods should be invoked, AroundInvoke or
> >>> AroundTimeout ? I guess that it should be AroundInvoke ?
> >>
> >> Right, it would be a plain AroundInvoke.  Basically any method, say a
> >> PostConstruct method, could be exposed as a business method.  In that
> case
> >> it gets treated as a plain business method.
> >>
> >>
> >> -David
> >>
> >>
> >
> >
> > --
> > Ivan
>
>


-- 
Ivan

Re: How to invoke the ejbTimeout method ?

Posted by Ivan <xh...@gmail.com>.
Thanks, David, it is a good choice to add a new InterfaceType. I have
attached the patch to OpenEJB-1221, if any problem, please let me know.

2010/6/18 David Blevins <da...@visi.com>

>
> On Jun 17, 2010, at 7:03 AM, Ivan wrote:
>
> > Hi,
> >    While working with AroundTimeout implementation, I found that OpenEJB
> > treats it as a normal business method, and in EJBTimerServiceImpl, I can
> see
> > some codes like :
> >   --->
> >   try {
> >          RpcContainer container = (RpcContainer)
> deployment.getContainer();
> >          Method ejbTimeout = deployment.getEjbTimeout();
> >          container.invoke(deployment.getDeploymentID(),
> > ejbTimeout.getDeclaringClass(), ejbTimeout, new Object[] {timer},
> > timerData.getPrimaryKey());
> >        }
> >   <---
> >     In my plan, I wish to handle AroundTimeout as normal lifecycle
> > intercepor methods, it means that I need to set the Operation.TIMEOUT to
> > invocation context. But with existing codes, I do not find a chance to
> > configure it. I am wondering whether we could update the RpcContainer
> > interface and add a new invoke method ? In that method, we could
> configure
> > the Operation type.
>
> We can probably treat it as a new InterfaceType.  Maybe
> InterfaceType.TIMEOUT or something.
>
> >     Another thing is that if the user call the ejbTimeout method via
> client
> > view, which interceptor methods should be invoked, AroundInvoke or
> > AroundTimeout ? I guess that it should be AroundInvoke ?
>
> Right, it would be a plain AroundInvoke.  Basically any method, say a
> PostConstruct method, could be exposed as a business method.  In that case
> it gets treated as a plain business method.
>
>
> -David
>
>


-- 
Ivan

Re: How to invoke the ejbTimeout method ?

Posted by David Blevins <da...@visi.com>.
On Jun 17, 2010, at 7:03 AM, Ivan wrote:

> Hi,
>    While working with AroundTimeout implementation, I found that OpenEJB
> treats it as a normal business method, and in EJBTimerServiceImpl, I can see
> some codes like :
>   --->
>   try {
>          RpcContainer container = (RpcContainer) deployment.getContainer();
>          Method ejbTimeout = deployment.getEjbTimeout();
>          container.invoke(deployment.getDeploymentID(),
> ejbTimeout.getDeclaringClass(), ejbTimeout, new Object[] {timer},
> timerData.getPrimaryKey());
>        }
>   <---
>     In my plan, I wish to handle AroundTimeout as normal lifecycle
> intercepor methods, it means that I need to set the Operation.TIMEOUT to
> invocation context. But with existing codes, I do not find a chance to
> configure it. I am wondering whether we could update the RpcContainer
> interface and add a new invoke method ? In that method, we could configure
> the Operation type.

We can probably treat it as a new InterfaceType.  Maybe InterfaceType.TIMEOUT or something.

>     Another thing is that if the user call the ejbTimeout method via client
> view, which interceptor methods should be invoked, AroundInvoke or
> AroundTimeout ? I guess that it should be AroundInvoke ?

Right, it would be a plain AroundInvoke.  Basically any method, say a PostConstruct method, could be exposed as a business method.  In that case it gets treated as a plain business method.


-David