You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Szűcs Attila <sz...@codespring.ro> on 2012/11/01 08:47:16 UTC

Access RunData from scheduled job

Hi,

   I need to access the RunData in one of my scheduled jobs. The job invokes a regular action I have already written. The action of course needs the Context and the RunData objects.
I don't want to copy - paste the same action just to run it in the job.  So how can I get the RunData for my scheduled job?

Thanks,
    Atti

Re: Access RunData from scheduled job

Posted by Ludwig Magnusson <lu...@itcatapult.com>.
RunData wraps an HttpServletRequest and an HttpServletResponse. It 
contains a lot of methods for easy access to things you might need from 
these objects such ass parameters and cookies.
My guess is that you do not have all of this in you scheduled job, 
correct?

Without knowing anything about your code my guess is that there is too 
much logic in your action. I my projects, I always tro to put all my 
logic into my services and the actions are only responsible for 
checking permissions and parsing the paramaters received from http 
requests and then pass them into the services.
So again, without knowing anything about your code my guess is that you 
can move the logic from your action into a service and then call that 
service both from your action and your scheduled job.

/Ludwig

On Thu 01 Nov 2012 08:47:16 AM CET, Szűcs Attila wrote:
> Hi,
>
>     I need to access the RunData in one of my scheduled jobs. The job invokes a regular action I have already written. The action of course needs the Context and the RunData objects.
> I don't want to copy - paste the same action just to run it in the job.  So how can I get the RunData for my scheduled job?
>
> Thanks,
>      Atti
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org
For additional commands, e-mail: user-help@turbine.apache.org