[cas-dev] Services in CAS 3.1 (was CAS-430)

John Thiltges jthiltges2 at unl.edu
Tue Nov 28 15:39:38 EST 2006


Marvin Addison wrote:
> John,
>
> Would you mind sharing the source for your JDBC-backed
> ServiceRegistryReloader?  I was thinking about developing something
> similar, but I'd be happy to avoid reinventing the wheel if possible.
>
> Thanks,
> Marvin Addison
>   

Marvin,

I'm happy to do so. Attached (hopefully) is the Java class, the bean 
XML, and a MySQL schema.

To detect if the table has been modified, it runs the query 
sqlLastModified and stores the result as a string. If the string 
changes, it reloads the registry. I'm currently using "<count of 
records>:<max timestamp>" as the string. If a record is added to the 
registry table (or modified), the max timestamp will change. If a record 
is deleted, the record count will change. Your database server might 
have a better way to determine if a table has been modified.

It's not as pretty as I would like, but it seems to work. Keep in mind 
I'm still learning Java, so if you're wondering why I did something a 
certain way, it's probably because I didn't know any better. =]

I'd be grateful for any suggestions or improvements you can offer.

Thanks,
John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: JdbcServiceRegistryReloader.java
Type: text/x-java
Size: 7917 bytes
Desc: not available
Url : http://tp.its.yale.edu/pipermail/cas-dev/attachments/20061128/b22ca955/JdbcServiceRegistryReloader.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: approvedServices-bean.xml
Type: text/xml
Size: 888 bytes
Desc: not available
Url : http://tp.its.yale.edu/pipermail/cas-dev/attachments/20061128/b22ca955/approvedServices-bean.xml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: services.sql
Type: text/x-sql
Size: 334 bytes
Desc: not available
Url : http://tp.its.yale.edu/pipermail/cas-dev/attachments/20061128/b22ca955/services.bin


More information about the cas-dev mailing list