[ 
https://issues.apache.org/jira/browse/FELIX-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13061828#comment-13061828
 ] 

Yann Diorcet commented on FELIX-3029:
-------------------------------------

Maybe one solution:

Index: src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
===================================================================
--- src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java   
(revision 1132718)
+++ src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java   
(revision )
@@ -327,6 +327,17 @@
         files.addAll(processingFailures);
         processingFailures.clear();
 
+        // Issue #3029: Check if the listener of each artifact still exists.
+        for (Iterator it = currentManagedArtifacts.values().iterator(); 
it.hasNext();)
+        {
+           Artifact artifact = (Artifact) it.next();
+           if(!listeners.contains(artifact.getListener()))
+           {
+              artifact.setListener(null);
+              files.add(artifact.getPath());
+           }
+        }
+
         for (Iterator it = files.iterator(); it.hasNext(); )
         {
             File file = (File) it.next();

> ArtifactListener/File dynamic issue
> -----------------------------------
>
>                 Key: FELIX-3029
>                 URL: https://issues.apache.org/jira/browse/FELIX-3029
>             Project: Felix
>          Issue Type: Improvement
>          Components: File Install
>    Affects Versions: fileinstall-3.1.10
>            Reporter: Yann Diorcet
>
> FileInstall don't correctly handle the arrival(and maybe departure) of a 
> ArtifactListener.
> I have one ArtifactListener and one file (abcd.xml)
> Indeed at the start of the platform, the first time that i provide a service 
> implementing ArtifactListener, FileInstall call canHandle with abcd.xml as a 
> File (and after install).
> But if i stop this service and if i restart it, FileInstall don't remake the 
> call to canHandle.
> The only solution for calling canHandle of the restarted service is to update 
> the file.
> Somehow, the Scanner object inside FileInstall doesn't have to be commonly 
> used with all the listener but one Scanner by listener.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to