Hi,

I am trying to make it possible to use functions as Quartz jobs for my Clojure 
DSL on top of
Quartz [1]. For that, I need to implement a simple 1-method interface. Both 
gen-class and defrecord with additional methods work great but seem too
heavyweight in many cases so I am trying to add function support using 
core/proxy.

The interface I need to implement looks like this:

https://gist.github.com/63989c1a081737813f99

and my code is basically this:

https://gist.github.com/a83687aed4ea62c915f5

However, when Quartz tries to execute a new job instance, 
UnsupportedOperationException is raised
as if execute was not implemented.

Listing methods on the class obtained via (class (proxy …)) suggests that the 
method is there and its signature looks
correct:

#<Method public void 
user.proxy$java.lang.Object$Job$4e5e6f14.execute(org.quartz.JobExecutionContext)>

Quartz job factory instantiates new jobs using reflection API (.newInstance w/o 
arguments), not sure if this
may matter in this case. What I may be doing wrong?

Out of curiosity I tried using reify instead and in that case, I get 
instantiation exception. Can it be that reify generates default constructor 
with visibility other than public?

Thanks.


1. https://github.com/michaelklishin/quartzite

MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to