From: Dave B. <bla...@us...> - 2012-01-03 23:14:53
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/doc-files In directory vz-cvs-3.sog:/tmp/cvs-serv3242/src/org/sblim/cimclient/doc-files Modified Files: Tag: Experimental indications.html Log Message: 3469210 - Include reliable indications in HTML Index: indications.html =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/doc-files/indications.html,v retrieving revision 1.5.2.8 retrieving revision 1.5.2.9 diff -u -d -r1.5.2.8 -r1.5.2.9 --- indications.html 22 Apr 2010 14:39:53 -0000 1.5.2.8 +++ indications.html 3 Jan 2012 23:14:51 -0000 1.5.2.9 @@ -3,7 +3,7 @@ <head> <!-- * - * (C) Copyright IBM Corp. 2006, 2010 + * (C) Copyright IBM Corp. 2006, 2012 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -23,6 +23,7 @@ * 2946113 2010-02-08 blaschke-oss First steps code snippet has compile errors * 2972697 2010-03-18 blaschke-oss Fix spelling errors in HTML files * 2990370 2010-04-22 blaschke-oss Development/unittest HTML out of date + * 3469210 2012-01-03 blaschke-oss Include reliable indications in HTML --> </head> <body style="background-color: white;"> @@ -60,7 +61,6 @@ throw e; } } -} </pre> </div> </div> @@ -117,6 +117,75 @@ <tr><td align="center">60s</td><td align="center">0</td><td align="center">8</td><td align="center">0</td><td align="center">10s</td><td>More dynamic handler allocation. Will destroy all handlers fast when idling and create them without delay on traffic. Allows higher HTTP timeout.</td></tr> <tr><td align="center">60s</td><td align="center">0</td><td align="center">8</td><td align="center">0</td><td align="center">120s</td><td>Similar to default but keeps handler count stable by long idle timeout instead of backlog. Makes it less vulnerable against blocking, but keeps handler open long after traffic peeks. Needs on average more handlers than default.</td></tr> <tr><td align="center">10s</td><td align="center">0</td><td align="center">2</td><td align="center">0</td><td align="center">10s</td><td>Resource saving: maximum of two handlers, aggressive HTTP timeout, short idle timeout. Will keep number of handlers low but is heavily creating & destroying its handlers.</td></tr> - </table> + </table> + <h2>Reliable Indications</h2> + <p>Reliable indication support, as defined by DMTF Indications Profile [DSP1054], is included in the SBLIM CIM Client for Java beginning with version 2.1.9. The gist of + reliable indication support is for indications to be delivered to the listener in the order intended by the CIMOM, NOT the order which they arrive at the Client. In other + words, if the CIMOM sends indications [#4,#5,#6] but network issues cause them to arrive at the Client as [#5,#6,#4], the Client will deliver them to the listener as [#4,#5,#6]. + <p>When reliable indication support is enabled (the default is disabled), the Client is responsible for determining when to dispatch reliable indications, which includes + queuing unexpected indications in either a hash table or linked list, caching all indications for the duration of their sequence identifier lifetime, and logging missing, + duplicate and out-of-order indications. + <p>A reliable indication must contain both the SequenceContext and SequenceNumber properties, the latter of which is used to deliver indications to the listener in order + of increasing value. The sequence identifier lifetime is defined as: + <div style="border: 1px dashed #3c78b5; font-size: 14px; font-family: Courier; margin: 10px; line-height: 17px;"> + <div style="background-color: #f0f0f0; padding: 10px;"> + <pre> +DeliveryRetryAttempts * DeliveryRetryInterval * 10 + </pre> + </div> + </div> + where DeliveryRetryAttempts and DeliveryRetryInterval are properties in the CIM_IndicationService instance on the CIMOM dispatching the indications. + <p>There are four configuration options that allow you to control reliable indication handling: + <ul> + <li><em>sblim.wbem.listenerEnableReliableIndications</em>: Enables or disables reliable indication support. If set to true, indications are queued by the Client in a linked list or hash table and delivered in order to the listener . If set to false, indications are passed directly to the listener.</li> + <li><em>sblim.wbem.listenerDeliveryRetryAttempts</em>: Sets the default value to use for the CIM_IndicationService DeliveryRetryAttempts property. This value should match the value of the property of the CIM_IndicationService instance on the CIMOM dispatching the indications.</li> + <li><em>sblim.wbem.listenerDeliveryRetryInterval</em>: Sets the default value to use for the CIM_IndicationService DeliveryRetryInterval property. This value should match the value of the property of the CIM_IndicationService instance on the CIMOM dispatching the indications.</li> + <li><em>sblim.wbem.listenerReliableIndicationHashtableCapacity</em>: Sets the default value to use for the reliable indication handler's initial hash table capacity. A value of 0 indicates use a linked list instead. Linked lists are better suited for a small number of listener destinations per WBEMListener while hash tables are better suited for a large number.</li> + </ul> + <p>The following code snippet illustrates how to set up a simple indication listener with reliable indication support enabled.</p> + <div style="border: 1px dashed #3c78b5; font-size: 14px; font-family: Courier; margin: 10px; line-height: 17px;"> + <div style="background-color: #f0f0f0; padding: 10px;"> + <pre> +/** + * Starts a indication listener that dumps every received indication to System.out + * @param port The TCP port to listen on + * @param ssl Set true if you want to listen on a secure (SSL) socket + * @return The indication listener instance. Call removeLister() to stop the listener. + */ +private WBEMListener startIndicationListener(int pPort, boolean pSsl) throws IOException { + + try { + WBEMListener listener = WBEMListenerFactory.getListener(WBEMClientConstants.PROTOCOL_CIMXML); + // Cast WBEMListener to WBEMListenerSBLIM to get access to the addListener() method that + // accepts properties - this method is not part of the JSR48 standard, but is a SBLIM addition + WBEMListenerSBLIM SBLIMlistener = (WBEMListenerSBLIM) listener; + + // Enable reliable indications using 2 retries at intervals of 30 seconds + Properties props = new Properties(); + props.setProperty("sblim.wbem.listenerEnableReliableIndications", "true"); + props.setProperty("sblim.wbem.listenerDeliveryRetryAttempts", "2"); + props.setProperty("sblim.wbem.listenerDeliveryRetryInterval", "30"); + + SBLIMlistener.addListener(new IndicationListener() { + public void indicationOccured(String pIndicationURL, CIMInstance pIndication) { + System.out.println("Indication received on: " + pIndicationURL + ":"); + System.out.println(pIndication.toString()); + } + }, pPort, pSsl ? "https" : "http", null, props); + + return listener; + + } catch (IOException e) { + System.err.println("Failed to bind socket to port "+pPort); + throw e; + } + } + </pre> + </div> + </div> + <p>The properties can also be set in the properties file itself, in which case the code would be identical to the first snippet above. However, that would enable reliable + indication support and set the attempts/interval for all listeners whereas this code snippet enables support and sets the attempts/interval for this particular listener only. + <p><b>NOTE:</b>If reliable indication support is enabled but the CIMOM does not send reliable indications (required properties missing), the indications are passed directly + to the listener. </body> </html> |