Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] [prov] directory watcher


ok.  Can someone (DJ?) take a stab at figuring out exactly how this should work?  We have two settings template file that people can put in the project but we need to figure out how this gets hooked in etc.

Jeff



DJ Houghton/Ottawa/IBM@IBMCA
Sent by: equinox-dev-bounces@xxxxxxxxxxx

09/06/2007 02:14 PM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc
Subject
Re: [equinox-dev] [prov] directory watcher





You are correct, the project preferences themselves are stored in
<project>/.settings/<bundleID>.prefs.

But I don't know how the UI determines if they should be used. In a perfect
world everyone would go through the preference service with the default
lookup order (project being one of them) and then they would just be
discovered. From your experience though, it seems that this is not the
case.

                 dj



                                                                         
            Jeff                                                          
            McAffer/Ottawa/IB                                            
            M@IBMCA                                                    To
            Sent by:                  Equinox development mailing list    
            equinox-dev-bounc         <equinox-dev@xxxxxxxxxxx>          
            es@xxxxxxxxxxx                                             cc
                                                                         
                                                                  Subject
            08/30/2007 05:27          Re: [equinox-dev] [prov] directory  
            PM                        watcher                            
                                                                         
                                                                         
            Please respond to                                            
                 Equinox                                                  
               development                                                
              mailing list                                                
            <equinox-dev@ecli                                            
                pse.org>                                                  
                                                                         
                                                                         





Interesting. So it might be that the coding practice project setup
instructions need to be tweaked.  I worked with Tom last night to clean
things up and setup templates for both the JDT Core and UI related
preferences.  The assumptoin on my part was that if these pref files were
simply copied into the project that they would take effect for that
project.  Perhaps there is something missing?  I wonder where the "project
specific settings" setting is stored.

Perhaps DJ "preference man" Houghton knows?  Anyone else?

Jeff


                                                                         
Pascal Rapicault/Ottawa/IBM@IBMCA                                        
Sent by:                                                                  
equinox-dev-bounces@xxxxxxxxxxx                                        To
                                           Equinox development mailing    
                                           list <equinox-dev@xxxxxxxxxxx>
08/30/2007 02:36 PM                                                    cc
                                                                         
                                                                  Subject
         Please respond to                 Re: [equinox-dev] [prov]      
 Equinox development mailing list          directory watcher              
     <equinox-dev@xxxxxxxxxxx>                                            
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         





The problem in the preferences, not in the code. If you look at the project
preferences, you will notice that under "java code style" > "organize
imports" the project specific settings are not enabled.
I will fix it.

It feels like we are missing a provisioning solution for preferences :-)

PaScaL

|------------>
| From:      |
|------------>

>--------------------------------------------------------------------------------------------------------------------------------------------------|

|Jeff McAffer/Ottawa/IBM@IBMCA
|

>--------------------------------------------------------------------------------------------------------------------------------------------------|

|------------>
| To:        |
|------------>

>--------------------------------------------------------------------------------------------------------------------------------------------------|

|Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
|

>--------------------------------------------------------------------------------------------------------------------------------------------------|

|------------>
| Date:      |
|------------>

>--------------------------------------------------------------------------------------------------------------------------------------------------|

|08/30/2007 02:30 PM
|

>--------------------------------------------------------------------------------------------------------------------------------------------------|

|------------>
| Subject:   |
|------------>

>--------------------------------------------------------------------------------------------------------------------------------------------------|

|Re: [equinox-dev] [prov] directory watcher
|

>--------------------------------------------------------------------------------------------------------------------------------------------------|







can you point out a precise problem?  I had used an older version of the
JDT UI prefs template (I've now updated the project) but organizing imports
on the code did not change anything (ie.., they were properly organized).

Jeff


Pascal Rapicault/Ottawa/IBM@IBMCA
Sent by:
equinox-dev-bounces@xxxxxxxxxxx                                        To
                                             Equinox development mailing
                                             list
08/30/2007 09:50 AM                           <equinox-dev@xxxxxxxxxxx>
                                                                      cc

        Please respond to                                        Subject
Equinox development mailing list             Re: [equinox-dev] [prov]
    <equinox-dev@xxxxxxxxxxx>                directory watcher












Please make sure to properly set the "organization of imports" for this
project :-)

PaScaL



From:       Jeff McAffer/Ottawa/IBM@IBMCA


To:         Equinox development mailing list <equinox-dev@xxxxxxxxxxx>


Date:       08/30/2007 08:58 AM


Subject:    Re: [equinox-dev] [prov] directory watcher








For the most part the DirectoryWatcher is very similar to what Peter did
originally.  That is, it just polls using a configurable delay.  It
certainly could be extended to hook the filesystem to get change
notifications.  We have all the required infrastructure in the resources
plugins so it should be relatively easy.

The DirectoryWatcher also notices changes (based on File.lastModified())
and file deletions.  The "JARListener" translates file timestamp changes
into BundleContext.update() and file deletions into
BundleContext.uninstall().  In some cases a file might be locked (e.g., if
you installed a bundle by reference: and a classloader has it open).  In
that case you can "virtually delete" the file by adding a sibling file of
the same name but with ".del" appended.  The DirectoryWatcher will notice
this and process the base file (the one without .del) as though it had been
removed (e.g., the corresponding bundle would be uninstalled).  Then, at
the end of each polling cycle the DirectoryWatcher attempts to delete all
"virtually deleted" base files as well as the corresponding delete marker
files (.del files).  I'm sure there are holes in the actual implementation
but initial testing shows that it works quite handily.

Some notes:
- currently bundles are installed using standard OSGi installBundle().
That is, they are not installed by reference so you end up with two copies
of the bundle on disk.  Worse, you get one copy per configuration that used
this technique.   We should look at having an option to install by
reference.
- The real intention is to have this be a replacement for Update Manager's
promiscuous install behaviour.  People have grown quite used to dropping
some files in the plugins dir and having them show up in Eclipse on next
run.   With p2 that will not happen natively.  With the DirectoryWatcher
and a p2 listener, users should be able to identify as many directories as
they want and have bundles added and removed from them *dynamically*
installed/uninstalled/updated.  So in the end users get enhanced
functionality.

Jeff




"Alex Blewitt"
<alex.blewitt@xxxxxxxxx>
Sent by:                                                               To
equinox-dev-bounces@xxxxxxxxxxx          "Equinox development mailing
                                       list" <equinox-dev@xxxxxxxxxxx>
                                                                     cc
08/30/2007 03:58 AM
                                                                Subject
                                       Re: [equinox-dev] [prov]
      Please respond to                directory watcher
Equinox development mailing list
  <equinox-dev@xxxxxxxxxxx>










Interesting. Does it periodically scan for changes, or does it hook in
with the underlying file system notifications to receive changes? I
believe that the Win32 resources API has the ability to pick up
changes; it would be good if that worked for other systems too.

Does it do the reverse, uninstalling a bundle if the corresponding
file is deleted?

Alex.

On 30/08/2007, Jeff McAffer <Jeff_McAffer@xxxxxxxxxx> wrote:
>
> I finally did something that has been on my list for quite some time.
>  Inspired by Peter Kriens' FileInstall bundle, I made a DirectoryWatcher
> that, as the name implies, watches a directory and installs, uninstalls,
> configures, ... things that are dropped into/removed from/changed in the
> dir.  The current working support directly calls installBundle() etc but
I
> have also been working on one that calls p2 API to effect and install.
The
> design consists of a DirectoryWatcher with which you can register
listeners.
>  The listeners then get added, removed and changed events for the files
of
> interest in the directory being watched.  It is quite easy to create a
new
> listener that does your own thing.
>
> Keeping in mind that this is quite early, take a look at
>         org.eclipse.equinox.p2.directorywatcher
> I have added not this to the PSF files yet as there are some compile
errors
> in the provisioning listener as I have not completed enhancing the
metadata
> generator to work on individual files rather than directories.  More to
come
> later...
>
> Jeff
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
>
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Back to the top