2 Replies Latest reply on May 22, 2003 11:50 AM by fburough

    Using entity bean to represent file system objects

    irenekam

      Hello all,

      I am familiar with using entity beans to represent
      database records, but what I would like to do now is
      to use entity beans to represent file system objects
      (such as file, directories). I have some idea on how
      to do this, but would like to know if there's any
      resource on the Web (or books) that presents such an
      example. All the EJB books that I have looked at
      provide examples on entity beans and databases. So
      far I haven't seen anything on using entity beans
      to represent non-database entities.

      Any suggestions would be appreciated!

        • 1. Re: Using entity bean to represent file system objects
          davidjencks

          The ejb specs discourage if not prohibit this. Two acceptable ways to access file system objects would be to write a jca connector (no transaction) that handled the access for you, or do the access through an mbean.

          You might also be able to use a jndi-filesystem adapter, although I don't know anything about what capabilities that might offer.

          Why would you want to access a filesystem from an entity bean?

          • 2. Re: Using entity bean to represent file system objects
            fburough

            > Why would you want to access a filesystem from an
            > entity bean?
            I am attempting to implement the Lucene file-based indexer as a service that can be accessed from any of my client machines. Since the index is file-based, my EJB must be able to access the filesystem for both reads and writes. I am a newbie to EJB and if Entity beans are not the way to go, I could sure use some other suggestions.

            Thanks!