[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] ååï equinox bundle akin to felix fileinstall

On Fri, Jun 15, 2012 at 10:23 AM, hbdrawn <hbdrawn@xxxxxxxxxx> wrote:
i encoutered Âthe same problem before.After checked out the code,i found the spilth code in the line of 502(maybe the original code had been modified somewhere,so the line is not correct maybe,but the code below is right,please check it)Âin the DirectoryWatcher.java( function process):
toRefresh.addAll( uninstalledBundles );
//toRefresh.addAll( installedBundles );

This actually does seem to be the issue. Again I'm not sure who is at fault because internally equinox is performing a refresh on bundles using a separate thread which would clearly seem to violate the code in AbstractBundle.beginStateChange which will quite clearly throw an error it a separate thread has the bundle in a dirty state.

Perhaps there is no need for felix file install to actually force a package refresh? Wouldn't that be automatically done by the framework itself on an install/update/deletion?Â

Perhaps it's because it's trying to perform the process as a batch?

Here is the exact code in question:

    // Handle deleted artifacts
    // We do the operations in the following order:
    // uninstall, update, install, refresh & start.
    Collection uninstalledBundles = uninstall(deleted);
    Collection updatedBundles = update(modified);
    Collection installedBundles = install(created);
    Set toRefresh = new HashSet();
    toRefresh.addAll( uninstalledBundles );
    toRefresh.addAll( installedBundles );
    findBundlesWithFragmentsToRefresh( toRefresh );
    findBundlesWithOptionalPackagesToRefresh( toRefresh );
    if (toRefresh.size() > 0)
      // Refresh if any bundle got uninstalled or updated.
      refresh((Bundle[]) toRefresh.toArray(new Bundle[toRefresh.size()]));

The error results from the second last line above, but if we comment the line asÂbdrawn mentions above, then it eliminates the error, but does it leave the system in a state it shouldn't be in?

Raymond Augà Â|ÂSenior Software Architect |ÂLiferay, Inc.Â


8-9 October 2012 |ÂLiferayÂNorth America SymposiumÂ|Âliferay.com/northamerica2012

16-17 October 2012 |ÂLiferayÂEurope SymposiumÂ|Âliferay.com/europe2012

24-25 October 2012 |ÂLiferayÂSpain SymposiumÂ|Âliferay.com/spain2012