Extensibility/Plugins?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mitch Williams

    Extensibility/Plugins?

    One of my friends and I are writing a program to assist in AP
    Statistics. Essentailly the program allows you to plot data in a variety
    of ways and then export it to a browser/word processor friendly file format.

    My question is this: Is there a way to move the classes to seperate
    modules and detect their presence and load them dynamically at runtime?
    IE, how does one go about implementing a plugin system in Java?

  • Brad BARCLAY

    #2
    Re: Extensibility/Plugins?

    Mitch Williams wrote:
    [color=blue]
    > My question is this: Is there a way to move the classes to seperate
    > modules and detect their presence and load them dynamically at runtime?
    > IE, how does one go about implementing a plugin system in Java?[/color]

    Yes and no. The loading mechanisms can be coded, but automatically
    detecting the plug-ins can be difficult.

    My project, the jSyncManager (http://www.jsyncmanager.org), has two
    different plug-in systems implemented. Feel free to look through the
    sources to see how it works.

    Brad BARCLAY

    --
    =-=-=-=-=-=-=-=-=
    From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
    The jSyncManager Project: http://www.jsyncmanager.org
    

    Comment

    • Phil...

      #3
      Re: Extensibility/Plugins?

      Could you not define a particular
      directory for plug ins and load everything
      that is in the directory? When a new
      one is developed just put it there.


      "Brad BARCLAY" <bbarclay@jsync manager.org> wrote in message
      news:mTYcb.8400 3$Lnr1.77340@ne ws01.bloor.is.n et.cable.rogers .com...[color=blue]
      > Mitch Williams wrote:
      >[color=green]
      > > My question is this: Is there a way to move the classes to seperate
      > > modules and detect their presence and load them dynamically at runtime?
      > > IE, how does one go about implementing a plugin system in Java?[/color]
      >
      > Yes and no. The loading mechanisms can be coded, but automatically
      > detecting the plug-ins can be difficult.
      >
      > My project, the jSyncManager (http://www.jsyncmanager.org), has two
      > different plug-in systems implemented. Feel free to look through the
      > sources to see how it works.
      >
      > Brad BARCLAY
      >
      > --
      > =-=-=-=-=-=-=-=-=
      > From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
      > The jSyncManager Project: http://www.jsyncmanager.org
      > 
      >[/color]


      Comment

      • Brad BARCLAY

        #4
        Re: Extensibility/Plugins?

        Phil... wrote:[color=blue]
        > Could you not define a particular
        > directory for plug ins and load everything
        > that is in the directory? When a new
        > one is developed just put it there.[/color]

        You can, but there are downsides to doing this. In particular, if you
        do so you're locked into filesystem-based classloaders. You won't be
        able to use network-based classloaders under such a mechanism, nor will
        you be able to use any that require a DBMS.

        For the jSyncManager, I decided to keep things sufficiently generic for
        now that we can be classloader-neutral. We don't do any access to the
        underlying storage structures. We currently use a set of properties
        that define the classnames of available plug-ins instead. This may
        eventually change, but one of the beauties of Java is it's ability for
        classes to be stored on all sorts of systems other than just traditional
        PC filesystems -- and I want to ensure we can take advantage of that as
        much as possible.

        Brad BARCLAY

        --
        =-=-=-=-=-=-=-=-=
        From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
        The jSyncManager Project: http://www.jsyncmanager.org
        

        Comment

        Working...