On Nov 7, 2007, at 9:45 PM, Will Tao wrote:

>
> However, this time seems Hessian can not serialize JobExecutionContext
> object from quartz. The JobExecutionContext class is Serializable  
> and I
> have verified this by using standard File serialization. Seems  
> something
> funny happens in constructor in JobExecutionContext during the
> serialization.
>
>
> public JobExecutionContext(Scheduler scheduler,
>             TriggerFiredBundle firedBundle, Job job) {

See if you can get Quartz to add a private zero-arg constructor :)

Unfortunately, java.io serialization cheats.  It uses an internal JVM  
call to create the object instance without calling the constructor.   
Since Hessian is restricted to Java reflection, it can only create an  
object using a constructor (although it can call private constructors).

There are a few objects like the Quartz JobExecutionContext that only  
have active constructors.  As a heuristic, Hessian tries to find the  
one closest to a zero-arg constructor, but that doesn't always work.

As a thought, it might be an interesting idea to add a HessianFactory  
concept.  Hessian could search for a  
JobExecutionContextHessianFactory and use that to create some sort of  
delegate class.

-- Scott

>         this.scheduler = scheduler;
>
>
>
>
>         this.trigger = firedBundle.getTrigger();
>         this.calendar = firedBundle.getCalendar();
>         this.jobDetail = firedBundle.getJobDetail();
>         this.job = job;
>         this.recovering = firedBundle.isRecovering();
>         this.fireTime = firedBundle.getFireTime();
>         this.scheduledFireTime = firedBundle.getScheduledFireTime();
>         this.prevFireTime = firedBundle.getPrevFireTime();
>         this.nextFireTime = firedBundle.getNextFireTime();
>
>         this.jobDataMap = new JobDataMap();
>         this.jobDataMap.putAll(jobDetail.getJobDataMap());
>         this.jobDataMap.putAll(trigger.getJobDataMap());
>     }
>
>
> Any thoughts, ideas, suggestion will be appreciated!
>
>
>
>
>
> -- 
> Will Tao
> Java Developer
> ICT Group
> NetRegistry Pty Ltd
>
>
>
> _______________________________________________
> hessian-interest mailing list
> [email protected]
> http://maillist.caucho.com/mailman/listinfo/hessian-interest



_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest

Reply via email to