Enlighten me, please. If ResourceFactory.newReaderResource() creates a drools.io.Resource from a java.io.Reader, how would you get at some modification time, and of what?
The general idea of a Reader seems to be a data source without implication as to data representation, persistence, file system or any other such thing. -W 2012/1/6 Esteban Aliverti <[email protected]> > +1 to Thomas' proposal: the first step would be to change the thrown > Exception to UnsupportedOperationException. Of course this will be a > temporary change until Dean implements all the methods in the correct way > :) > > Best Regards > > > XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > > Esteban Aliverti > - Developer @ http://www.plugtree.com > - Blog @ http://ilesteban.wordpress.com > > > 2012/1/6 Swindells, Thomas <[email protected]> > > As well as the message not making sense the exception should also really >> be UnsupportedOperationException, of course the preference is for someone >> to implement it and make it supported!**** >> >> ** ** >> >> Thomas**** >> >> ** ** >> >> *From:* [email protected] [mailto: >> [email protected]] *On Behalf Of *Esteban Aliverti >> *Sent:* 06 January 2012 09:14 >> *To:* Rules Users List >> *Subject:* Re: [rules-users] Resource Change Scanner Service modified >> date error**** >> >> ** ** >> >> Could you please share with us how are you adding your resources to the >> agent? According to what you are saying I assume you are using a >> ReaderResource. According to Drools code, ReaderResource doesn't support >> most of org.drools.io.internal.InternalResource methods. Some of these >> methods (i.e. getLastModified()) are used by ResourceScanner to check if a >> resource has actually changed.**** >> >> So if we take a look at ReaderResource.getLastModified() we will see this: >> **** >> >> ** ** >> >> public long getLastModified() {**** >> >> throw new IllegalStateException( "reader does have a modified date" ); >> **** >> >> } **** >> >> ** ** >> >> You can find the whole source code here: >> https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/io/impl/ReaderResource.java >> **** >> >> ** ** >> >> So, don't expect this to work :)**** >> >> ** ** >> >> There are 2 things you can do:**** >> >> 1. Submit a patch for ReaderResource.java implementing all the >> unimplemented methods :) **** >> 2. Use a different Resource like UrlResource, FileResource, >> InputStreamResource, etc. **** >> >> In my opinion, Bug 733008 must be reopened until someone (maybe you >> Dean) provides a correct implementation of ReaderResource. **** >> >> ** ** >> >> Best Regards,**** >> >> >> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> >> Esteban Aliverti >> - Developer @ http://www.plugtree.com >> - Blog @ http://ilesteban.wordpress.com >> >> **** >> >> On Fri, Jan 6, 2012 at 8:53 AM, Dean <[email protected]> wrote:**** >> >> I'm pretty sure this issue is the same as Bug 733008 >> (https://bugzilla.redhat.com/show_bug.cgi?id=733008). >> >> I have updated the class from Bug 733008 to reproduce the bug in Drools >> 5.4.0.Beta1: >> >> http://drools.46999.n3.nabble.com/file/n3637279/AgentTest.java >> AgentTest.java >> >> It doesn't seem to be possible to scan a resource for changes at all. Even >> if I execute ResourceFactory.getResourceChangeScannerService().scan(); >> directly, I get the same error message: >> >> [2012-01-06 09:47:57,144:exception]**** >> >> java.lang.IllegalStateException: reader does have a modified date**** >> >> at >> org.drools.io.impl.ReaderResource.getLastModified(ReaderResource.java:64) >> at >> >> org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScannerImpl.java:166) >> at >> >> org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(ResourceChangeScannerImpl.java:311) >> at java.lang.Thread.run(Thread.java:662) >> >> (As a side note the error message should probably read: reader does /not/ >> have a modified date) >> >> Regards >> >> Dean >> >> >> -- >> View this message in context: >> http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3637279.html >> **** >> >> Sent from the Drools: User forum mailing list archive at Nabble.com. >> _______________________________________________ >> rules-users mailing list >> [email protected] >> https://lists.jboss.org/mailman/listinfo/rules-users**** >> >> ** ** >> >> ------------------------------ >> >> >> ************************************************************************************** >> This message is confidential and intended only for the addressee. If you >> have received this message in error, please immediately notify the >> [email protected] and delete it from your system as well as any copies. >> The content of e-mails as well as traffic data may be monitored by NDS for >> employment and security purposes. To protect the environment please do not >> print this e-mail unless necessary. >> >> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 >> 4EX, United Kingdom. A company registered in England and Wales. Registered >> no. 3080780. VAT no. GB 603 8808 40-00 >> >> ************************************************************************************** >> >> _______________________________________________ >> rules-users mailing list >> [email protected] >> https://lists.jboss.org/mailman/listinfo/rules-users >> >> > > _______________________________________________ > rules-users mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-users > >
_______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
