Ok I am using the quartz api for job schedualing and I have
a JobDataMap that I put key/value pairs as (
String, long)
when I do a
try{
data.getLongValueFromString( f[0].getName() ) ;
}
catch( Exception e)
{
System.out.println( "not geting long value!!!") ;
e.printStackTrace() ;
}
I get a class casting exeception saying
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
at org.quartz.JobDataMap.getLongValueFromString(JobDataMap.java:699)
at com.eztakes.quartz.jobs.JobDirectoryScanJob.execute(JobDirectoryScanJ
ob.java:112)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:520)
Uh, I thought this method returns a long value assosiated to the String key.
I looked and I say that this method returns long not Long.
But maybe the api has a typeO. Anyway if I cann't get the long value in this way. Is their another way to get it. I just want to avoid creating a wrapper class Long every time I need to store/retrieve a long.
So the put method lets me put the values in the JobDataMap as long.
So I am assuming you can retrive the long as well with out using a wrapper.
I am looking at this api methods
web page