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/[EMAIL PROTECTED] 
Sent by: [EMAIL PROTECTED]
08/30/2007 02:36 PM
Please respond to
Equinox development mailing list <[email protected]>


To
Equinox development mailing list <[email protected]>
cc

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






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/[EMAIL PROTECTED]                                  |
 
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
 
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Equinox development mailing list <[email protected]>            |
 
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| 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/[EMAIL PROTECTED] 
 Sent by: 
 [EMAIL PROTECTED]                                        To 

                                               Equinox development mailing 

                                               list 
 08/30/2007 09:50 AM                           <[email protected]> 
                                                                        cc 

 
          Please respond to                                        Subject 

  Equinox development mailing list             Re: [equinox-dev] [prov] 
      <[email protected]>                directory watcher 
 
 
 
 
 
 
 





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

PaScaL



 From:       Jeff McAffer/Ottawa/[EMAIL PROTECTED]


 To:         Equinox development mailing list <[email protected]>


 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"
<[EMAIL PROTECTED]>
Sent by:                                                               To
[EMAIL PROTECTED]          "Equinox development mailing
                                         list" <[email protected]>
                                                                       cc
08/30/2007 03:58 AM
                                                                  Subject
                                         Re: [equinox-dev] [prov]
        Please respond to                directory watcher
 Equinox development mailing list
    <[email protected]>










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 <[EMAIL PROTECTED]> 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
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
>
_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to