|
60 | 60 |
|
61 | 61 | import java.util.Enumeration; |
62 | 62 | import java.util.StringTokenizer; |
| 63 | +import java.util.Iterator; |
63 | 64 |
|
64 | 65 | import org.apache.jcs.access.exception.CacheException; |
65 | 66 |
|
66 | 67 | import org.apache.jcs.engine.behavior.IElementAttributes; |
67 | 68 | import org.apache.jcs.engine.ElementAttributes; |
68 | | -import org.apache.jcs.engine.control.group.GroupCacheHub; |
69 | 69 |
|
70 | 70 | import org.apache.commons.logging.Log; |
71 | 71 | import org.apache.commons.logging.LogFactory; |
72 | 72 |
|
73 | 73 | import org.apache.jcs.engine.control.event.TestElementEventHandler; |
| 74 | +import org.apache.jcs.engine.control.CompositeCacheManager; |
74 | 75 |
|
75 | 76 |
|
76 | 77 |
|
@@ -110,27 +111,27 @@ public static void main( String[] args ) |
110 | 111 | //cache_control= GroupCacheAccess.getGroupAccess( "testGroupCache" ); |
111 | 112 |
|
112 | 113 | // start the local cache witht he appropriate props file |
113 | | - GroupCacheHub.getInstance( args[0] ); |
| 114 | + CompositeCacheManager.getInstance( args[0] ); |
114 | 115 |
|
115 | 116 | cache_control = GroupCacheAccess.getGroupAccess( "testCache1" ); |
116 | 117 |
|
117 | 118 | // not necessary if you don't set default element attributes |
118 | | - try |
119 | | - { |
120 | | - cache_control.defineGroup( "gr" ); |
121 | | - } |
122 | | - catch ( CacheException ce ) |
123 | | - { |
124 | | - p( ce.toString() + " /n" + ce.getMessage() ); |
125 | | - } |
126 | | - try |
127 | | - { |
128 | | - cache_control.defineGroup( "gr2" ); |
129 | | - } |
130 | | - catch ( CacheException ce ) |
131 | | - { |
132 | | - p( ce.toString() + " /n" + ce.getMessage() ); |
133 | | - } |
| 119 | +// try |
| 120 | +// { |
| 121 | +// cache_control.defineGroup( "gr" ); |
| 122 | +// } |
| 123 | +// catch ( CacheException ce ) |
| 124 | +// { |
| 125 | +// p( ce.toString() + " /n" + ce.getMessage() ); |
| 126 | +// } |
| 127 | +// try |
| 128 | +// { |
| 129 | +// cache_control.defineGroup( "gr2" ); |
| 130 | +// } |
| 131 | +// catch ( CacheException ce ) |
| 132 | +// { |
| 133 | +// p( ce.toString() + " /n" + ce.getMessage() ); |
| 134 | +// } |
134 | 135 |
|
135 | 136 | GroupCacheAccess cache_control2 = GroupCacheAccess.getGroupAccess( "testCache2" ); |
136 | 137 | p( "cache_control = " + cache_control ); |
@@ -741,11 +742,11 @@ public static void help() |
741 | 742 | /** Gets the attributeNames attribute of the TestCacheAccess class */ |
742 | 743 | static void getAttributeNames( String groupName ) |
743 | 744 | { |
744 | | - Enumeration enum = cache_control.getAttributeNames( groupName ); |
745 | | - p( "enum = " + enum ); |
746 | | - while ( enum.hasMoreElements() ) |
| 745 | + Iterator iter = cache_control.getGroupKeys( groupName ).iterator(); |
| 746 | + |
| 747 | + while ( iter.hasNext() ) |
747 | 748 | { |
748 | | - p( "=" + ( String ) enum.nextElement() ); |
| 749 | + p( "=" + ( String ) iter.next() ); |
749 | 750 | } |
750 | 751 | } |
751 | 752 | } |
|
0 commit comments