Skip to main content

[java-state-managemen~source:21] Show an example of 'escaping' from the scoping given by StateMap, and get

  • From: mitch.upton@...
  • To: commits@...
  • Subject: [java-state-managemen~source:21] Show an example of 'escaping' from the scoping given by StateMap, and get
  • Date: Thu, 6 Dec 2012 03:40:11 +0000

Project:    java-state-managemen
Repository: source
Revision:   21
Author:     mitch.upton
Date:       2012-12-06 03:40:09 UTC
Link:       

Log Message:
------------
Show an example of 'escaping' from the scoping given by StateMap, and get a 
StateContainer directly from it.


Revisions:
----------
21


Modified Paths:
---------------
trunk/new-examples/scenarios/src/main/java/PersonDogScenario1.java


Diffs:
------
Index: trunk/new-examples/scenarios/src/main/java/PersonDogScenario1.java
===================================================================
--- trunk/new-examples/scenarios/src/main/java/PersonDogScenario1.java  
(revision 20)
+++ trunk/new-examples/scenarios/src/main/java/PersonDogScenario1.java  
(revision 21)
@@ -85,6 +85,14 @@
     Dog fidoCopy = dogMap.get(fidoUniqueName);
     Person johnCopy = personMap.get(johnUniqueName);
 
+    // 'Escape' from the scoping StateMap gives us and get back to
+    // StateContainer
+
+    StateContainer<String, Dog> fidoStateCopy =
+      dogMap.getStateContainer(fidoUniqueName);
+    System.out.println("Fido was last updated: " + 
fidoStateCopy.getLastUpdateTime());
+    System.out.println("Fido's globally unique key is: " + 
fidoStateCopy.getKey());
+
     // Clean up
 
     conn.close();





[java-state-managemen~source:21] Show an example of 'escaping' from the scoping given by StateMap, and get

mitch . upton 12/06/2012
 
 
Close
loading
Please Confirm
Close