Results 1 to 2 of 2

Thread: Implementing a new protocol on org.springframework.core.io

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Posts
    8

    Default Implementing a new protocol on org.springframework.core.io

    I am testing the script groovy support.
    I know it use the org.springframework.core.io Resource support to be able to load the resouces from the filesystem or the classpath.
    But I need make possible to load the script files from a database. So I need to create database protocol :

    <constructor-arg index="0"><value>database:/tmp/CalculoSub.groovy</value></constructor-arg>

    How I will implement this generic resource support ?

  2. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    The Resource interface is generic, but the classes in Spring are not set up such that this is a pluggable protocol setup similar to the way URLs are handled for example. The actual text strings you entrer in an appcontext get converted to a Resoure via a ResourceEditor PropertyEditor that gets registered automatically, and this will ultimately end up using DefaultResourceLoader, which ends up creating Resources of type ClassPathResource or UrlResource. If you can register a standrd type URL handler in your environment which can handle a custom database prefix, that might be one approach.

    I would instead however first look at basing something off JdbcBeanDefinitionReader, for reading bean definitions from a db...
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Replies: 4
    Last Post: Jul 7th, 2005, 03:12 AM
  2. Replies: 2
    Last Post: Jul 7th, 2005, 02:30 AM
  3. Replies: 2
    Last Post: Jan 21st, 2005, 04:17 AM
  4. Implementing OpenSessionInViewInterceptor
    By springuser in forum Data
    Replies: 0
    Last Post: Nov 2nd, 2004, 08:21 AM
  5. Replies: 1
    Last Post: Sep 6th, 2004, 05:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •