| Hi Wim and Eugen, 
 On 11/22/2010 1:28 PM, Wim Jongman wrote:
 Hi Eugen,
      
 It is funny that this pops up frequently lately. I guess it
        would be sweet if we could implement some kind of
        ProgressMonitor while executing the task much like the progress
        monitor in Eclipse.  
 In the mean time, you can implement your own progress service
        OR use the ECF Future feature. You call a method async and you
        get a Future back. You can poll the Future while you show an
        "indefinite" progress (the one that sweeps) based on the status
        of the Future. 
 Wim is quite right...this is a way to do progress monitoring on
    consumer side of a remote service.   Admittedly it isn't ideal,
    however...as the client's progress indication doesn't actually get
    data from the host/service side in order to show progress....rather
    it just assumes some progress has been made because time passes.
 
 By way of explanation...the real problem here is that normal/OSGi
    remote method call doesn't support callbacks (and that's what
    IProgressMonitor or custom equivalent is).  The reason for this is
    that it doesn't generally support remote method parameter
    pass-by-reference...which is needed to trivially support callbacks. 
    With most providers remote method parameters are necessarily passed
    by value (i.e. method parameters are serialized and a copy is sent
    to the remote service host...rather than a distributed object
    reference).
 
 However, it's quite possible to define/create a messaging pattern to
    implement progress monitoring...e.g. with the ECF shared object API
    and/or the datashare API.  This isn't strictly OSGi remote services,
    though.  Both ECF APIs can/could be pretty easily used to define the
    messaging to support remote progress monitoring.  One of the things
    that I've contemplated doing is to add such a feature to
    RegistrySharedObject (via the shared object api)...and perhaps even
    to the remote services API...for example exposing it via a new type
    of IFuture that would allow the specification of client-side
    progress monitors that actually use server-side messages to update. 
    But, I haven't been able to personally work on this thread yet given
    the attention of OSGi remote services.  If folks would like to
    persue adding such a feature then please open an enhancement request
    and consider contributing or supporting work in that area.
 
 Scott
 
 
 
 
 |