Yes, your understanding is correct.  Your service that registers for 
handle deletion notifications would also need to be able to handle a 
STAF_CALLBACK HANDLEDELETED HANDLE <Handle#> UUID <uuid> MACHINE 
<Endpoint> KEY <Key> request submitted to it as this is how your service 
is notified when a handle is deleted.  When your service handles a 
STAF_CALLBACK request, it should verify that the originator of the request 
is the STAFProc handle (handle #1) as no other STAF handles should ever 
submit a STAF_CALLBACK request to your service.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   Strösser, Bodo <bodo.stroes...@ts.fujitsu.com>
To:     Sharon Lucas/Austin/IBM@IBMUS, 
Cc:     "staf-users@lists.sourceforge.net" 
<staf-users@lists.sourceforge.net>
Date:   09/15/2011 12:12 PM
Subject:        RE: [staf-users] STAF service: receive notification if a 
handle is       deleted



Hi Sharon,
 
thank you for this valuable advice.
 
Do I understand the source correctly: the requested notification is sent 
from STAF as a “special” service request that uses the action 
“staf_callback” and is accepted only if the originator of the request is 
STAF?
 
Bodo
 
From: Sharon Lucas [mailto:luc...@us.ibm.com] 
Sent: Wednesday, September 14, 2011 10:03 PM
To: Strösser, Bodo; Strösser, Bodo
Cc: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] STAF service: receive notification if a handle 
is deleted
 
Yes, you can register (and unregister) to be notified when a STAF handle 
no longer exists via what we call "Handle Garbage Collection".  However, 
we don't provide documentation for this functionality as it can be a 
little tricky to use.  If it is used incorrectly it can cause issues. 

One of the external STAF services that use "Handle Garbage Collection" is 
the Resource Pool (ResPool) service.  So, you could look at the source 
code for the ResPool service (it is an external C++ service) to see how it 
is done in src/staf/services/respool/STAFResPoolService.cpp.  It submits a 
STAF_NOTIFY REGISTER ONENDOFHANDLE request to the local HANDLE service 
(which is undocumented) to add a notification for when a STAF handle (for 
a specified STAF instance running on a machine) no longer exists.  See the 
ResPool service's submitSTAFNotifyRegisterRequest() method.  For example: 
  
STAF local HANDLE STAF_NOTIFY REGISTER ONENDOFHANDLE <Handle#> MACHINE 
<Endpoint> UUID <uuid> SERVICE <ServiceName> KEY <Key> 

And it submits a STAF_NOTIFY UNREGISTER ONENDOFHANDLE request to the local 
HANDLE service (which is undocumented) if it wants to remove the 
notification.  See the ResPool service's 
submitSTAFNotifyUnregisterRequest() method. For example. 

STAF local HANDLE STAF_NOTIFY UNREGISTER ONENDOFHANDLE <Handle#> MACHINE 
<Endpoint> UUID <uuid> SERVICE <ServiceName> KEY <Key> 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:        Strösser, Bodo <bodo.stroes...@ts.fujitsu.com> 
To:        "staf-users@lists.sourceforge.net" 
<staf-users@lists.sourceforge.net>, 
Date:        09/14/2011 02:03 PM 
Subject:        [staf-users] STAF service: receive notification if a 
handle is        deleted 




Hi, 
  
I would like to write a STAF service, that allows to create instances of a 
specific test tool (“MyService CREATE ….”), 
pass commands to it (“MyService DOCMD ….”) and terminate the tool 
(“MyService DELETE …”). 
Each test tool instance would be associated with the STAF handle used 
while doing the CREATE. 
So it would be fine to have an automatic DELETE on a test tool, when this 
handle is deleted. 
  
So, is there a way to be notified on handle deletion? 
  
Bodo
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to