Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: [StartupMonitor] getFailedCount on RETRYING_LOAD_RESOURCE - impossible?  (Read 8139 times)
cyberpunk
Newbie
*
Posts: 5



View Profile Email
« on: July 01, 2008, 10:28:14 »

hi again,
i can't find an (easy) way to get the number times a resource failed to load when i receive the StartupMonitorProxy.RETRYING_LOAD_RESOURCE notification

the notification body contains the name of my proxy ("DataProxy" in my case) and not the name used by StartupMonitor (would be "DataSRProxy") and i can't find out a way to retrieve the IStartupResourceProxy instance related to that resource

not to mention that, even if i find the correct IStartupResourceProxy, the interface does not expose the method to get the count of failed loading

i'm trying to do some modification on my own to the StartupMonitor to make the whole thing easier, but i would like to know if it was done in that way for some reason
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #1 on: July 03, 2008, 01:49:18 »

I've just seen your post.  I wil look into it and get back to you as soon as I can.
----Philip
Logged
cyberpunk
Newbie
*
Posts: 5



View Profile Email
« Reply #2 on: July 03, 2008, 01:58:12 »

thank you philip, no hurry though :)
by now I've modified the notification to pass the IStartupResourceProxy instance in the body instead of the name of the "original" proxy
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #3 on: July 03, 2008, 05:18:51 »

The practice of passing the app resource proxy name in the body of notifications sent from the startup manager began in the original custom versions before the release of the utility and was retained in the first release (v1.0).  At that time, the StartupResourceProxy was a much simpler class with state consisting just of the status property and that app proxy name.  So, it was thought that all the client app would need would be its proxy name, rather than needing indirection to get to it.

However, I can see a strong argument that it would be better to pass the reference to the StartupResourceProxy object in the notification, as you suggest, and then have related information available indirectly from that.  There is the question of being kind to existing implementations and minimising the migration chore.

As things stand, ways that you can get a reference to the StartupResourceProxy, include
1. if you know its name, facade.retrieveProxy()
2. something like the following should work: monitor.getResourceList().resourceList which gives an array of StartUpResourceProxy objects, and then search that for a match on the app proxy name using the appResourceProxyName() method on each object.

As regards the failed count, I think you already know that it should be available as follows
:
(r.retryPolicy as RetryPolicy).getFailedCount()where r refers to the StartupResourceProxy object.  However, as you say, it is not exposed by the IRetryPolicy interface.  It would be better if there was a getter for failedCount as part of that interface.

These points are worth considering in future contributions to the development of the utility.
---- Philip
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #4 on: July 03, 2008, 07:25:55 »

Addition to above post, re getting reference to StartupResourceProxy (srp) object...
The client app creates the srp object, so it could choose to keep a reference to it on the corresponding app proxy, which is retrievable by its proxy name.
----Philip
Logged
Pages: [1]
Print