You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(97) |
Dec
(35) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(55) |
Mar
(21) |
Apr
(3) |
May
(7) |
Jun
(25) |
Jul
(108) |
Aug
(23) |
Sep
|
Oct
|
Nov
|
Dec
(4) |
2006 |
Jan
|
Feb
|
Mar
(6) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(13) |
Feb
|
Mar
(257) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(38) |
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(63) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <lan...@us...> - 2003-08-03 20:10:36
|
Update of /cvsroot/webmacro/webmacro/src-optional/org/opendoors/cache/immutable In directory sc8-pr-cvs1:/tmp/cvs-serv8047/immutable Log Message: Directory /cvsroot/webmacro/webmacro/src-optional/org/opendoors/cache/immutable added to the repository |
From: <lan...@us...> - 2003-08-03 20:10:34
|
Update of /cvsroot/webmacro/webmacro/src-optional/org/opendoors/util In directory sc8-pr-cvs1:/tmp/cvs-serv8029/util Log Message: Directory /cvsroot/webmacro/webmacro/src-optional/org/opendoors/util added to the repository |
From: <lan...@us...> - 2003-08-03 20:10:33
|
Update of /cvsroot/webmacro/webmacro/src-optional/org/opendoors/cache In directory sc8-pr-cvs1:/tmp/cvs-serv8029/cache Log Message: Directory /cvsroot/webmacro/webmacro/src-optional/org/opendoors/cache added to the repository |
From: <lan...@us...> - 2003-08-03 20:10:31
|
Update of /cvsroot/webmacro/webmacro/src-optional/org/opendoors In directory sc8-pr-cvs1:/tmp/cvs-serv8015/opendoors Log Message: Directory /cvsroot/webmacro/webmacro/src-optional/org/opendoors added to the repository |
From: <lan...@us...> - 2003-08-03 20:10:28
|
Update of /cvsroot/webmacro/webmacro/src-optional/org In directory sc8-pr-cvs1:/tmp/cvs-serv8003/org Log Message: Directory /cvsroot/webmacro/webmacro/src-optional/org added to the repository |
From: <lan...@us...> - 2003-08-03 20:10:25
|
Update of /cvsroot/webmacro/webmacro/src-optional In directory sc8-pr-cvs1:/tmp/cvs-serv7987/src-optional Log Message: Directory /cvsroot/webmacro/webmacro/src-optional added to the repository |
Update of /cvsroot/webmacro/webmacro/src/org/opendoors/cache/immutable In directory sc8-pr-cvs1:/tmp/cvs-serv7758/src/org/opendoors/cache/immutable Removed Files: CacheFactory.java CacheImpl.java ChangeControl.java Depopulate.java Populate.java Log Message: move to src-optional --- CacheFactory.java DELETED --- --- CacheImpl.java DELETED --- --- ChangeControl.java DELETED --- --- Depopulate.java DELETED --- --- Populate.java DELETED --- |
From: <lan...@us...> - 2003-08-03 20:04:23
|
Update of /cvsroot/webmacro/webmacro/src/org/opendoors/util In directory sc8-pr-cvs1:/tmp/cvs-serv7134/src/org/opendoors/util Removed Files: PostponeObservable.java Timer.java Log Message: move opendoors to src-optional --- PostponeObservable.java DELETED --- --- Timer.java DELETED --- |
From: <lan...@us...> - 2003-08-03 20:04:23
|
Update of /cvsroot/webmacro/webmacro/src/org/opendoors/cache In directory sc8-pr-cvs1:/tmp/cvs-serv7134/src/org/opendoors/cache Removed Files: Cache.java UpdateableCache.java Log Message: move opendoors to src-optional --- Cache.java DELETED --- --- UpdateableCache.java DELETED --- |
From: <lan...@us...> - 2003-08-01 20:40:06
|
Update of /cvsroot/webmacro/wiki/builds/help In directory sc8-pr-cvs1:/tmp/cvs-serv7623/builds/help Modified Files: CreatingAWikiSite.pdf Log Message: Index: CreatingAWikiSite.pdf =================================================================== RCS file: /cvsroot/webmacro/wiki/builds/help/CreatingAWikiSite.pdf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsCA6uSn and /tmp/cvs6b0ptB differ |
From: <lan...@us...> - 2003-08-01 20:39:54
|
Update of /cvsroot/webmacro/wiki/builds/help In directory sc8-pr-cvs1:/tmp/cvs-serv7547/builds/help Modified Files: CreatingAWikiSite.sxw Log Message: Index: CreatingAWikiSite.sxw =================================================================== RCS file: /cvsroot/webmacro/wiki/builds/help/CreatingAWikiSite.sxw,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsnqRPkt and /tmp/cvscwnvqM differ |
From: <lan...@us...> - 2003-08-01 20:25:48
|
Update of /cvsroot/webmacro/wiki/src/org/opendoors/util In directory sc8-pr-cvs1:/tmp/cvs-serv4158/src/org/opendoors/util Modified Files: StringHelper.java Log Message: update version Index: StringHelper.java =================================================================== RCS file: /cvsroot/webmacro/wiki/src/org/opendoors/util/StringHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** StringHelper.java 30 Sep 2001 08:28:26 -0000 1.1.1.1 --- StringHelper.java 1 Aug 2003 20:25:46 -0000 1.2 *************** *** 11,15 **** * (using JDK codes for the converter). * <p> ! * This class also has methods to take lists of supported locales and * character encoding names and their corresponding 'JDK codes'. Those codes * can be used for setting the encoding of widgets. There is a method --- 11,15 ---- * (using JDK codes for the converter). * <p> ! * This class also has methods to take lists of supported locales and * character encoding names and their corresponding 'JDK codes'. Those codes * can be used for setting the encoding of widgets. There is a method *************** *** 17,63 **** * and a method that returns the name for a given code. * - * @see #convertToDefault(String, String) - * @see #convertFromDefault(String, String) - * @see #getEncodingCode(String) - * @see #getEncodingName(String) - * @see #getLocaleNames(String) - * - * @author Klaas Waslander - * @author Alex Barilov - * @version 1.8, 12/18/97 */ ! public class StringHelper { ! final static boolean JDK10 = false; /** * Never instantiated. */ ! private StringHelper() { } /** * Splits a list separated by a delimiter into an array. */ ! public static String[] split(String list, String delimiter) { ! StringTokenizer token = new StringTokenizer(list, delimiter); ! int count = token.countTokens(); ! String[] fields = new String[count]; ! int index = 0; ! while (token.hasMoreTokens()) { ! fields[index++] = token.nextToken(); ! } ! return fields; ! } ! /** ! * Indexes a set of unique strings and returns it as a hash. ! */ ! public static Hashtable indexStrings(String[] string) { ! Hashtable hash = new Hashtable(); ! for (int index = 0; index < string.length; index++) ! hash.put(string[index], new Integer(index)); ! return hash; } /** * Determines if a string is a member of an array of strings. Case sensitive. --- 17,61 ---- * and a method that returns the name for a given code. * */ ! public class StringHelper ! { /** * Never instantiated. */ ! private StringHelper () ! { } + /** * Splits a list separated by a delimiter into an array. */ ! public static String[] split (String list, String delimiter) ! { ! StringTokenizer token = new StringTokenizer(list, delimiter); ! int count = token.countTokens(); ! String[] fields = new String[count]; ! int index = 0; ! while (token.hasMoreTokens()) ! { ! fields[index++] = token.nextToken(); ! } ! return fields; ! } ! ! /** ! * Indexes a set of unique strings and returns it as a hash. ! */ ! public static Hashtable indexStrings (String[] string) ! { ! Hashtable hash = new Hashtable(); ! for (int index = 0; index < string.length; index++) ! hash.put(string[index], new Integer(index)); ! return hash; } + /** * Determines if a string is a member of an array of strings. Case sensitive. *************** *** 65,76 **** * @param list The list possibly containing item. */ ! public static boolean isMember(String item, String[] list) { ! for (int index = 0; index < list.length; index++) { ! if (list[index].equals(item)) ! return true; ! } ! return false; } ! /** --- 63,76 ---- * @param list The list possibly containing item. */ ! public static boolean isMember (String item, String[] list) ! { ! for (int index = 0; index < list.length; index++) ! { ! if (list[index].equals(item)) ! return true; ! } ! return false; } ! /** *************** *** 79,103 **** * NOTE: this method does NOT use the JDK encoding mechanism! */ ! public static String bytesToString(byte[] bytes) { char value[] = new char[bytes.length]; ! for (int i = bytes.length; i-- > 0;) { ! value[i] = (char)(bytes[i] & 0xff); } return new String(value).trim(); } /** * Converts String to bytes, using one byte per character. * NOTE: this method does NOT use the JDK encoding mechanism! */ ! public static byte[] stringToBytes(String str) { char value[] = str.trim().toCharArray(); ! byte[] bytes = new byte[value.length]; ! for (int i = value.length; i-- > 0;) { ! bytes[i] = (byte)value[i]; } return bytes; } /** * Replace all occurences of string one with string two. --- 79,109 ---- * NOTE: this method does NOT use the JDK encoding mechanism! */ ! public static String bytesToString (byte[] bytes) ! { char value[] = new char[bytes.length]; ! for (int i = bytes.length; i-- > 0;) ! { ! value[i] = (char) (bytes[i] & 0xff); } return new String(value).trim(); } + /** * Converts String to bytes, using one byte per character. * NOTE: this method does NOT use the JDK encoding mechanism! */ ! public static byte[] stringToBytes (String str) ! { char value[] = str.trim().toCharArray(); ! byte[] bytes = new byte[value.length]; ! for (int i = value.length; i-- > 0;) ! { ! bytes[i] = (byte) value[i]; } return bytes; } + /** * Replace all occurences of string one with string two. *************** *** 109,124 **** * @return The newly constructed string. */ ! public static String stringReplace(String org, String str1, String str2) { ! StringBuffer sb = new StringBuffer(); ! int oldi = 0; ! int i = org.indexOf(str1); ! while (i >= 0) { sb.append(org.substring(oldi, i)); // check escape character ! if (i > 0 && org.charAt(i-1) == '\\') { // do not replace sb.append(str1); ! } else { // replace now! sb.append(str2); --- 115,135 ---- * @return The newly constructed string. */ ! public static String stringReplace (String org, String str1, String str2) ! { ! StringBuffer sb = new StringBuffer(); ! int oldi = 0; ! int i = org.indexOf(str1); ! while (i >= 0) ! { sb.append(org.substring(oldi, i)); // check escape character ! if (i > 0 && org.charAt(i - 1) == '\\') ! { // do not replace sb.append(str1); ! } ! else ! { // replace now! sb.append(str2); *************** *** 143,160 **** * @see #convertFromDefault(char, String) */ ! public static String convertFromDefault(String s, String encoding) { ! if (JDK10) { return s; - } else { - try { - return new String(s.getBytes(), encoding); - } catch (Throwable e) { - // unknown encoding - // System.out.println("Unknown encoding: " + encoding); - return s; - } } } /** * Convert a character in the default encoding to the given --- 154,172 ---- * @see #convertFromDefault(char, String) */ ! public static String convertFromDefault (String s, String encoding) ! { ! try ! { ! return new String(s.getBytes(), encoding); ! } ! catch (Throwable e) ! { ! // unknown encoding ! // System.out.println("Unknown encoding: " + encoding); return s; } } + /** * Convert a character in the default encoding to the given *************** *** 166,182 **** * @see #convertFromDefault(String, String) */ ! public static char convertFromDefault(char character, String encoding) { ! if (JDK10) { return character; - } else { - String str = convertFromDefault(""+character, encoding); - if (str.length() > 0) { - return str.charAt(0); - } else { - return character; - } } } /** * Converts a string with the given encoding to a string in the --- 178,195 ---- * @see #convertFromDefault(String, String) */ ! public static char convertFromDefault (char character, String encoding) ! { ! String str = convertFromDefault("" + character, encoding); ! if (str.length() > 0) ! { ! return str.charAt(0); ! } ! else ! { return character; } } + /** * Converts a string with the given encoding to a string in the *************** *** 190,207 **** * @see #convertToDefault(char, String) */ ! public static String convertToDefault(String s, String encoding) { ! if (JDK10) { return s; - } else { - try { - return new String(s.getBytes(encoding)); - } catch (Throwable e) { - // unknown encoding - // System.out.println("Unknown encoding: " + encoding); - return s; - } } } /** * Convert a character in the given encoding to the default --- 203,221 ---- * @see #convertToDefault(char, String) */ ! public static String convertToDefault (String s, String encoding) ! { ! try ! { ! return new String(s.getBytes(encoding)); ! } ! catch (Throwable e) ! { ! // unknown encoding ! // System.out.println("Unknown encoding: " + encoding); return s; } } + /** * Convert a character in the given encoding to the default *************** *** 213,242 **** * @see #convertToDefault(String, String) */ ! public static char convertToDefault(char character, String encoding) { ! if (JDK10) { return character; - } else { - String str = convertToDefault(""+character, encoding); - if (str.length() > 0) { - return str.charAt(0); - } else { - return character; - } } } ! /** ! * Compares one byte array to the other and returns true if they ! * are identical in length and value. ! */ ! public static boolean compare(byte[] a, byte[] b) { ! int length = a.length; ! if (length != b.length) ! return false; ! for (int index = 0; index < length; index++) { ! if (a[index] != b[index]) ! return false; ! } ! return true; } --- 227,259 ---- * @see #convertToDefault(String, String) */ ! public static char convertToDefault (char character, String encoding) ! { ! String str = convertToDefault("" + character, encoding); ! if (str.length() > 0) ! { ! return str.charAt(0); ! } ! else ! { return character; } } ! ! /** ! * Compares one byte array to the other and returns true if they ! * are identical in length and value. ! */ ! public static boolean compare (byte[] a, byte[] b) ! { ! int length = a.length; ! if (length != b.length) ! return false; ! for (int index = 0; index < length; index++) ! { ! if (a[index] != b[index]) ! return false; ! } ! return true; } *************** *** 256,267 **** * @see #getEncodingCode */ ! public static String getEncodingName(String code) { // get the names, go through them and if one returns the same // code, return that name as the resulting encoding name. ! Enumeration names = encodingTable.keys(); ! while (names.hasMoreElements()) { ! String name = (String)names.nextElement(); ! String currentCode = (String)encodingTable.get(name); ! if (currentCode.equalsIgnoreCase(code)) { return name; } --- 273,287 ---- * @see #getEncodingCode */ ! public static String getEncodingName (String code) ! { // get the names, go through them and if one returns the same // code, return that name as the resulting encoding name. ! Enumeration names = encodingTable.keys(); ! while (names.hasMoreElements()) ! { ! String name = (String) names.nextElement(); ! String currentCode = (String) encodingTable.get(name); ! if (currentCode.equalsIgnoreCase(code)) ! { return name; } *************** *** 270,273 **** --- 290,294 ---- } + /** * Get the code of the given encoding name. The case of the given *************** *** 279,292 **** * @see #getEncodingCodes */ ! public static String getEncodingCode(String name) { ! String code = (String)encodingTable.get(name); // try to find it ignoring the case ! if (code == null) { ! Enumeration names = encodingTable.keys(); ! while (names.hasMoreElements()) { ! String currentName = (String)names.nextElement(); ! if (currentName.equalsIgnoreCase(name)) { ! code = (String)encodingTable.get(currentName); break; } --- 300,317 ---- * @see #getEncodingCodes */ ! public static String getEncodingCode (String name) ! { ! String code = (String) encodingTable.get(name); // try to find it ignoring the case ! if (code == null) ! { ! Enumeration names = encodingTable.keys(); ! while (names.hasMoreElements()) ! { ! String currentName = (String) names.nextElement(); ! if (currentName.equalsIgnoreCase(name)) ! { ! code = (String) encodingTable.get(currentName); break; } *************** *** 296,299 **** --- 321,325 ---- } + /** * Get all the available encoding names. *************** *** 302,317 **** * @see #getEncodingName */ ! public static String[] getEncodingNames() { ! Vector result = new Vector(); ! Enumeration names = encodingTable.keys(); ! while (names.hasMoreElements()) { ! String currentName = (String)names.nextElement(); result.addElement(currentName); } ! String[] array = new String[result.size()]; result.copyInto(array); return array; } /** * Get all the available encoding codes. --- 328,346 ---- * @see #getEncodingName */ ! public static String[] getEncodingNames () ! { ! Vector result = new Vector(); ! Enumeration names = encodingTable.keys(); ! while (names.hasMoreElements()) ! { ! String currentName = (String) names.nextElement(); result.addElement(currentName); } ! String[] array = new String[result.size()]; result.copyInto(array); return array; } + /** * Get all the available encoding codes. *************** *** 320,327 **** * @see #getEncodingCode */ ! public static String[] getEncodingCodes() { ! String[] names = getEncodingNames(); ! String[] result = new String[names.length]; ! for (int i = 0; i < names.length; i++) { result[i] = getEncodingCode(names[i]); } --- 349,358 ---- * @see #getEncodingCode */ ! public static String[] getEncodingCodes () ! { ! String[] names = getEncodingNames(); ! String[] result = new String[names.length]; ! for (int i = 0; i < names.length; i++) ! { result[i] = getEncodingCode(names[i]); } *************** *** 329,332 **** --- 360,364 ---- } + /** * Get all supported locale names. *************** *** 335,346 **** * @see #getEncodingNames */ ! public static String[] getLocaleNames() { ! Locale[] localeList = (new java.text.resources.LocaleData()).getAvailableLocales(null); String[] names = new String[localeList.length]; ! for (int i = 0; i < localeList.length; i++) { names[i] = localeList[i].getDisplayName() + "[" + localeList[i].toString() + "]"; } return names; ! } /** --- 367,381 ---- * @see #getEncodingNames */ ! public static String[] getLocaleNames () ! { ! Locale[] localeList = java.text.Collator.getAvailableLocales();//(new java.text.resources.LocaleData()).getAvailableLocales(null); String[] names = new String[localeList.length]; ! for (int i = 0; i < localeList.length; i++) ! { names[i] = localeList[i].getDisplayName() + "[" + localeList[i].toString() + "]"; } return names; ! } ! /** *************** *** 349,410 **** * for the JDK character encoding class. */ ! private static Hashtable encodingTable = new Hashtable(); ! static { ! putEncoding("ISO Latin-1", "8859_1"); ! putEncoding("ISO Latin-2", "8859_2"); ! putEncoding("ISO Latin-3", "8859_3"); ! putEncoding("ISO Latin-4", "8859_4"); ! putEncoding("ISO Latin/Cyrillic", "8859_5"); ! putEncoding("ISO Latin/Arabic", "8859_6"); ! putEncoding("ISO Latin/Greek", "8859_7"); ! putEncoding("ISO Latin/Hebrew", "8859_8"); ! putEncoding("ISO Latin-5", "8859_9"); ! putEncoding("Windows East Europe", "Cp1250"); ! putEncoding("Windows Cyrillic", "Cp1251"); ! putEncoding("Windows West Europe", "Cp1252"); ! putEncoding("Windows Greek", "Cp1253"); ! putEncoding("Windows Turkish", "Cp1254"); ! putEncoding("Windows Hebrew", "Cp1255"); ! putEncoding("Windows Arabic", "Cp1256"); ! putEncoding("Windows Baltic", "Cp1257"); ! putEncoding("Windows Vietnamese", "Cp1258"); ! putEncoding("PC Original", "Cp437"); ! putEncoding("PC Greek", "Cp737"); ! putEncoding("PC Baltic", "Cp775"); ! putEncoding("PC Latin-1", "Cp850"); ! putEncoding("PC Latin-2", "Cp852"); ! putEncoding("PC Cyrillic", "Cp855"); ! putEncoding("PC Turkish", "Cp857"); ! putEncoding("PC Portuguese", "Cp860"); ! putEncoding("PC Icelandic", "Cp861"); ! putEncoding("PC Hebrew", "Cp862"); ! putEncoding("PC Canadian French", "Cp863"); ! putEncoding("PC Arabic", "Cp864"); ! putEncoding("PC Nordic", "Cp865"); ! putEncoding("PC Russian", "Cp866"); ! putEncoding("PC Modern Greek", "Cp869"); ! putEncoding("Windows Thai", "Cp874"); ! putEncoding("Japanese EUC", "EUCJIS"); ! putEncoding("Macintosh Arabic", "MacArabic"); ! putEncoding("JIS", "JIS");//"LIS"); ! putEncoding("Macintosh Latin-2", "MacCentralEurope"); ! putEncoding("Macintosh Croation", "MacCroatian"); ! putEncoding("Macintosh Cyrillic", "MacCyrillic"); ! putEncoding("Macintosh Dingbat", "MacDingbat"); ! putEncoding("Macintosh Greek", "MacGreek"); ! putEncoding("Macintosh Hebrew", "MacHebrew"); ! putEncoding("Macintosh Iceland", "Iceland"); ! putEncoding("Macintosh Roman", "MacRoman"); ! putEncoding("Macintosh Romania", "MacRomania"); ! putEncoding("Macintosh Symbol", "MacSymbol"); ! putEncoding("Macintosh Thai", "MacThai"); ! putEncoding("Macintosh Turkish", "MacTurkish"); ! putEncoding("Macintosh Ukraine", "MacUkraine"); ! putEncoding("PC-Windows Japanese", "SJIS"); ! putEncoding("Standard UTF-8", "UTF8"); } /** Add an encoding name/value pair to the encoding hashtable. */ ! private static void putEncoding(String s1, String s2) { encodingTable.put(s1 + " [" + s2 + "]", s2); } --- 384,450 ---- * for the JDK character encoding class. */ ! private static Hashtable encodingTable = new Hashtable(); ! ! ! static ! { ! putEncoding("ISO Latin-1", "8859_1"); ! putEncoding("ISO Latin-2", "8859_2"); ! putEncoding("ISO Latin-3", "8859_3"); ! putEncoding("ISO Latin-4", "8859_4"); ! putEncoding("ISO Latin/Cyrillic", "8859_5"); ! putEncoding("ISO Latin/Arabic", "8859_6"); ! putEncoding("ISO Latin/Greek", "8859_7"); ! putEncoding("ISO Latin/Hebrew", "8859_8"); ! putEncoding("ISO Latin-5", "8859_9"); ! putEncoding("Windows East Europe", "Cp1250"); ! putEncoding("Windows Cyrillic", "Cp1251"); ! putEncoding("Windows West Europe", "Cp1252"); ! putEncoding("Windows Greek", "Cp1253"); ! putEncoding("Windows Turkish", "Cp1254"); ! putEncoding("Windows Hebrew", "Cp1255"); ! putEncoding("Windows Arabic", "Cp1256"); ! putEncoding("Windows Baltic", "Cp1257"); ! putEncoding("Windows Vietnamese", "Cp1258"); ! putEncoding("PC Original", "Cp437"); ! putEncoding("PC Greek", "Cp737"); ! putEncoding("PC Baltic", "Cp775"); ! putEncoding("PC Latin-1", "Cp850"); ! putEncoding("PC Latin-2", "Cp852"); ! putEncoding("PC Cyrillic", "Cp855"); ! putEncoding("PC Turkish", "Cp857"); ! putEncoding("PC Portuguese", "Cp860"); ! putEncoding("PC Icelandic", "Cp861"); ! putEncoding("PC Hebrew", "Cp862"); ! putEncoding("PC Canadian French", "Cp863"); ! putEncoding("PC Arabic", "Cp864"); ! putEncoding("PC Nordic", "Cp865"); ! putEncoding("PC Russian", "Cp866"); ! putEncoding("PC Modern Greek", "Cp869"); ! putEncoding("Windows Thai", "Cp874"); ! putEncoding("Japanese EUC", "EUCJIS"); ! putEncoding("Macintosh Arabic", "MacArabic"); ! putEncoding("JIS", "JIS");//"LIS"); ! putEncoding("Macintosh Latin-2", "MacCentralEurope"); ! putEncoding("Macintosh Croation", "MacCroatian"); ! putEncoding("Macintosh Cyrillic", "MacCyrillic"); ! putEncoding("Macintosh Dingbat", "MacDingbat"); ! putEncoding("Macintosh Greek", "MacGreek"); ! putEncoding("Macintosh Hebrew", "MacHebrew"); ! putEncoding("Macintosh Iceland", "Iceland"); ! putEncoding("Macintosh Roman", "MacRoman"); ! putEncoding("Macintosh Romania", "MacRomania"); ! putEncoding("Macintosh Symbol", "MacSymbol"); ! putEncoding("Macintosh Thai", "MacThai"); ! putEncoding("Macintosh Turkish", "MacTurkish"); ! putEncoding("Macintosh Ukraine", "MacUkraine"); ! putEncoding("PC-Windows Japanese", "SJIS"); ! putEncoding("Standard UTF-8", "UTF8"); } + /** Add an encoding name/value pair to the encoding hashtable. */ ! private static void putEncoding (String s1, String s2) ! { encodingTable.put(s1 + " [" + s2 + "]", s2); } |
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv23890/src/org/webmacro/servlet Modified Files: CGITool.java CookieTool.java FormListTool.java FormTool.java ListTool.java LocaleTool.java MathTool.java RequestTool.java ResponseTool.java SessionTool.java TemplateTool.java TextTool.java TypeTool.java URLTool.java VariableTool.java Log Message: Refactor ContextTool to be a special case of ContextAutoLoader Index: CGITool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/CGITool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CGITool.java 16 Jul 2003 06:45:00 -0000 1.11 --- CGITool.java 30 Jul 2003 04:51:17 -0000 1.12 *************** *** 32,38 **** * script variable names. */ ! public class CGITool implements ContextTool { - public Object init (Context context) throws PropertyException --- 32,37 ---- * script variable names. */ ! public class CGITool extends ContextTool { public Object init (Context context) throws PropertyException Index: CookieTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/CookieTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CookieTool.java 16 Jul 2003 06:45:00 -0000 1.10 --- CookieTool.java 30 Jul 2003 04:51:17 -0000 1.11 *************** *** 31,35 **** * Provide Template with access to form data. */ ! public class CookieTool implements ContextTool { --- 31,35 ---- * Provide Template with access to form data. */ ! public class CookieTool extends ContextTool { Index: FormListTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/FormListTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FormListTool.java 16 Jul 2003 06:45:00 -0000 1.10 --- FormListTool.java 30 Jul 2003 04:51:17 -0000 1.11 *************** *** 31,35 **** * Provide Template with access to form data. */ ! public class FormListTool implements ContextTool { --- 31,35 ---- * Provide Template with access to form data. */ ! public class FormListTool extends ContextTool { Index: FormTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/FormTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FormTool.java 16 Jul 2003 06:45:00 -0000 1.10 --- FormTool.java 30 Jul 2003 04:51:17 -0000 1.11 *************** *** 31,35 **** * Provide Template with access to form data. */ ! public class FormTool implements ContextTool { --- 31,35 ---- * Provide Template with access to form data. */ ! public class FormTool extends ContextTool { Index: ListTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/ListTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ListTool.java 16 Jul 2003 06:45:00 -0000 1.6 --- ListTool.java 30 Jul 2003 04:51:17 -0000 1.7 *************** *** 34,38 **** * @see ListUtil */ ! public class ListTool implements ContextTool { --- 34,38 ---- * @see ListUtil */ ! public class ListTool extends ContextTool { Index: LocaleTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/LocaleTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** LocaleTool.java 16 Jul 2003 06:45:00 -0000 1.9 --- LocaleTool.java 30 Jul 2003 04:51:17 -0000 1.10 *************** *** 40,44 **** * fields e.g., Locale.US */ ! public class LocaleTool implements ContextTool, Bag { --- 40,44 ---- * fields e.g., Locale.US */ ! public class LocaleTool extends ContextTool implements Bag { Index: MathTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/MathTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MathTool.java 16 Jul 2003 06:45:00 -0000 1.8 --- MathTool.java 30 Jul 2003 04:51:17 -0000 1.9 *************** *** 34,38 **** */ ! public class MathTool implements ContextTool { --- 34,38 ---- */ ! public class MathTool extends ContextTool { Index: RequestTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/RequestTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RequestTool.java 16 Jul 2003 06:45:00 -0000 1.9 --- RequestTool.java 30 Jul 2003 04:51:17 -0000 1.10 *************** *** 31,35 **** * Provide Template with access to form data. */ ! public class RequestTool implements ContextTool { --- 31,35 ---- * Provide Template with access to form data. */ ! public class RequestTool extends ContextTool { Index: ResponseTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/ResponseTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ResponseTool.java 16 Jul 2003 06:45:00 -0000 1.9 --- ResponseTool.java 30 Jul 2003 04:51:17 -0000 1.10 *************** *** 31,35 **** * Provide Template with access to form data. */ ! public class ResponseTool implements ContextTool { --- 31,35 ---- * Provide Template with access to form data. */ ! public class ResponseTool extends ContextTool { Index: SessionTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/SessionTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SessionTool.java 16 Jul 2003 06:45:00 -0000 1.11 --- SessionTool.java 30 Jul 2003 04:51:17 -0000 1.12 *************** *** 34,38 **** * with the current request. */ ! public class SessionTool implements ContextTool { --- 34,38 ---- * with the current request. */ ! public class SessionTool extends ContextTool { Index: TemplateTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/TemplateTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TemplateTool.java 16 Jul 2003 06:45:00 -0000 1.8 --- TemplateTool.java 30 Jul 2003 04:51:17 -0000 1.9 *************** *** 10,13 **** --- 10,14 ---- import org.webmacro.PropertyException; import org.webmacro.Template; + import org.webmacro.ContextTool; import org.webmacro.engine.StringTemplate; *************** *** 26,30 **** * @version 0.2 */ ! public class TemplateTool implements org.webmacro.ContextTool { --- 27,31 ---- * @version 0.2 */ ! public class TemplateTool extends ContextTool { Index: TextTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/TextTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TextTool.java 16 Jul 2003 06:45:00 -0000 1.12 --- TextTool.java 30 Jul 2003 04:51:17 -0000 1.13 *************** *** 42,46 **** */ ! public class TextTool implements ContextTool { --- 42,46 ---- */ ! public class TextTool extends ContextTool { Index: TypeTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/TypeTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TypeTool.java 16 Jul 2003 06:45:00 -0000 1.5 --- TypeTool.java 30 Jul 2003 04:51:17 -0000 1.6 *************** *** 34,38 **** * @see org.webmacro.util.CastUtil */ ! public class TypeTool implements ContextTool { --- 34,38 ---- * @see org.webmacro.util.CastUtil */ ! public class TypeTool extends ContextTool { Index: URLTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/URLTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** URLTool.java 16 Jul 2003 06:45:00 -0000 1.5 --- URLTool.java 30 Jul 2003 04:51:17 -0000 1.6 *************** *** 35,39 **** * @author Sebastian Kanthak (mailto:ska...@mu...) */ ! public class URLTool implements ContextTool { --- 35,39 ---- * @author Sebastian Kanthak (mailto:ska...@mu...) */ ! public class URLTool extends ContextTool { Index: VariableTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/VariableTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** VariableTool.java 28 Jul 2003 20:56:23 -0000 1.11 --- VariableTool.java 30 Jul 2003 04:51:17 -0000 1.12 *************** *** 35,39 **** */ ! public class VariableTool implements ContextTool { --- 35,39 ---- */ ! public class VariableTool extends ContextTool { |
From: <bri...@us...> - 2003-07-30 04:51:20
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/broker In directory sc8-pr-cvs1:/tmp/cvs-serv23890/src/org/webmacro/broker Added Files: ContextAutoLoader.java ContextObjectFactory.java DefaultContextAutoLoader.java Log Message: Refactor ContextTool to be a special case of ContextAutoLoader --- NEW FILE: ContextAutoLoader.java --- package org.webmacro.broker; import org.webmacro.Context; import org.webmacro.Broker; import org.webmacro.PropertyException; /** * ContextAutoLoader * * @author Brian Goetz */ public interface ContextAutoLoader { /** * Called once after construction. */ void init(Broker b, String name); /** * Return a new instance of the named automatic variable */ Object get(String name, Context context) throws PropertyException; } --- NEW FILE: ContextObjectFactory.java --- package org.webmacro.broker; import org.webmacro.Context; import org.webmacro.PropertyException; /** * ContextObjectFactory * This interface replaces ContextTool. * * @author Brian Goetz */ public interface ContextObjectFactory { /** * Return an object which is suitable for placement in the context. * This might be a new context-specific object, or a shared instance of an * immutable object. */ public Object get(Context c) throws PropertyException; } --- NEW FILE: DefaultContextAutoLoader.java --- package org.webmacro.broker; import java.lang.reflect.Constructor; import java.util.*; import org.webmacro.Broker; import org.webmacro.Context; import org.webmacro.Log; import org.webmacro.PropertyException; import org.webmacro.util.Settings; import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap; /** * DefaultContextAutoLoader * * @author Brian Goetz */ public class DefaultContextAutoLoader implements ContextAutoLoader { private Log _log; private Broker _broker; private Map _factories = new ConcurrentHashMap(); public void init(Broker b, String name) { _broker = b; _log = b.getLog("broker"); loadFactories(name); } public Object get(String name, Context context) throws PropertyException { Object o = _factories.get(name); if (o == null) return null; ContextObjectFactory f = (ContextObjectFactory) o; return f.get(context); } /** * Load the context tools listed in the supplied string. See * the ComponentMap class for a description of the format of * this string. */ private void loadFactories (String keyName) { _broker.getSettings().processListSetting(keyName, new AutoContextSettingsHandler()); } private class AutoContextSettingsHandler extends Settings.ListSettingHandler { public void processSetting (String settingKey, String settingValue) { try { addAutoVariable(settingKey, settingValue); } catch (Exception e) { _log.error("Automatic variable (" + settingValue + ") failed to load", e); } } } /** * Attempts to instantiate the tool using two different constructors * until one succeeds, in the following order: * <ul> * <li>new MyTool(String key)</li> * <li>new MyTool()</li> * </ul> * The key is generally the unqualified class name of the tool minus the * "Tool" suffix, e.g., "My" in the example above * The settings are any configured settings for this tool, i.e, settings * prefixed with the tool's key. * <br> * NOTE: keats - 25 May 2002, no tools are known to use the settings mechanism. * We should create an example of this and test it, or abolish this capability! * Abolished -- BG */ private void addAutoVariable(String toolName, String className) { Class c; try { c = _broker.classForName(className); } catch (ClassNotFoundException e) { _log.warning("Context: Could not locate class for context tool " + className); return; } if (toolName == null || toolName.equals("")) { toolName = className; int start = 0; int end = toolName.length(); int lastDot = toolName.lastIndexOf('.'); if (lastDot != -1) start = lastDot + 1; toolName = toolName.substring(start, end); } Constructor ctor = null; Constructor[] ctors = c.getConstructors(); Class[] parmTypes = null; Object instance = null; // check for 1 arg (String) constructor for (int i = 0; i < ctors.length; i++) { parmTypes = ctors[i].getParameterTypes(); if (parmTypes.length == 1 && parmTypes[0].equals(String.class)) { ctor = ctors[i]; Object[] args = {toolName}; try { instance = ctor.newInstance(args); } catch (Exception e) { _log.error("Failed to instantiate tool " + toolName + " of class " + className + " using constructor " + ctor.toString(), e); } } } if (instance == null) { // try no-arg constructor try { instance = c.newInstance(); } catch (Exception e) { _log.error("Unable to construct tool " + toolName + " of class " + className, e); return; } } if (instance instanceof ContextObjectFactory) { _factories.put(toolName, instance); _broker.registerAutoContextVariable(toolName, this); _log.info("Registered automatic variable factory " + toolName); } else { _log.warning("Context object " + toolName + " is not of type ContextObjectFactory"); } } } |
From: <bri...@us...> - 2003-07-30 04:51:20
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv23890/src/org/webmacro Modified Files: Broker.java Context.java ContextTool.java Log Message: Refactor ContextTool to be a special case of ContextAutoLoader Index: Broker.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/Broker.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Broker.java 30 Jul 2003 02:28:13 -0000 1.40 --- Broker.java 30 Jul 2003 04:51:17 -0000 1.41 *************** *** 22,30 **** import java.io.*; import java.lang.ref.WeakReference; - import java.lang.reflect.Constructor; import java.net.MalformedURLException; import java.net.URL; import java.util.*; import org.webmacro.engine.DefaultEvaluationExceptionHandler; import org.webmacro.engine.EvaluationExceptionHandler; --- 22,31 ---- import java.io.*; import java.lang.ref.WeakReference; import java.net.MalformedURLException; import java.net.URL; import java.util.*; + import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap; + import org.webmacro.broker.ContextAutoLoader; import org.webmacro.engine.DefaultEvaluationExceptionHandler; import org.webmacro.engine.EvaluationExceptionHandler; *************** *** 38,42 **** import org.webmacro.util.Settings; import org.webmacro.util.SubSettings; - import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap; /** --- 39,42 ---- *************** *** 89,94 **** private Map _functionMap = new ConcurrentHashMap(); ! /** a local map for context tools */ ! private Map _tools = new ConcurrentHashMap(); --- 89,94 ---- private Map _functionMap = new ConcurrentHashMap(); ! /** a local map for context tools and other automatic context goodies */ ! private Map _toolLoader = new ConcurrentHashMap(); *************** *** 237,241 **** private class ProviderSettingHandler extends Settings.ListSettingHandler { - public void processSetting (String settingKey, String settingValue) { --- 237,240 ---- *************** *** 253,257 **** } ! private class ToolsSettingHandler extends Settings.ListSettingHandler { public void processSetting (String settingKey, String settingValue) --- 252,256 ---- } ! private class AutoLoaderSettingHandler extends Settings.ListSettingHandler { public void processSetting (String settingKey, String settingValue) *************** *** 259,267 **** try { ! addTool(settingKey, settingValue, "Tool"); } catch (Exception e) { ! _log.error("Tool (" + settingValue + ") failed to load", e); } } --- 258,268 ---- try { ! Class pClass = classForName(settingValue); ! ContextAutoLoader instance = (ContextAutoLoader) pClass.newInstance(); ! instance.init(Broker.this, settingKey); } catch (Exception e) { ! _log.error("ContextAutoLoader (" + settingValue + ") failed to load", e); } } *************** *** 300,306 **** } ! // load tools ! loadTools("ContextTools"); ! loadTools("WebContextTools"); eehClass = _config.getSetting("ExceptionHandler"); --- 301,306 ---- } ! _config.processListSetting("ContextAutoLoaders", new AutoLoaderSettingHandler()); ! // @@@ load autoloaders eehClass = _config.getSetting("ExceptionHandler"); *************** *** 826,929 **** } ! /** ! * Attempts to instantiate the tool using two different constructors ! * until one succeeds, in the following order: ! * <ul> ! * <li>new MyTool(String key)</li> ! * <li>new MyTool()</li> ! * </ul> ! * The key is generally the unqualified class name of the tool minus the ! * "Tool" suffix, e.g., "My" in the example above ! * The settings are any configured settings for this tool, i.e, settings ! * prefixed with the tool's key. ! * <br> ! * NOTE: keats - 25 May 2002, no tools are known to use the settings mechanism. ! * We should create an example of this and test it, or abolish this capability! ! * Abolished -- BG ! */ ! private void addTool(String toolName, String className, String suffix) { ! Class c; ! try ! { ! c = classForName(className); ! } ! catch (ClassNotFoundException e) ! { ! _log.warning("Context: Could not locate class for context tool " ! + className); ! return; ! } ! if (toolName == null || toolName.equals("")) ! { ! toolName = className; ! int start = 0; ! int end = toolName.length(); ! int lastDot = toolName.lastIndexOf('.'); ! if (lastDot != -1) ! { ! start = lastDot + 1; ! } ! if (toolName.endsWith(suffix)) ! { ! end -= suffix.length(); ! } ! toolName = toolName.substring(start, end); ! } ! ! Constructor ctor = null; ! Constructor[] ctors = c.getConstructors(); ! Class[] parmTypes = null; ! Object instance = null; ! ! // check for 1 arg (String) constructor ! for (int i = 0; i < ctors.length; i++) ! { ! parmTypes = ctors[i].getParameterTypes(); ! if (parmTypes.length == 1 && parmTypes[0].equals(String.class)) ! { ! ctor = ctors[i]; ! Object[] args = {toolName}; ! try ! { ! instance = ctor.newInstance(args); ! } ! catch (Exception e) ! { ! _log.error("Failed to instantiate tool " ! + toolName + " of class " + className + " using constructor " ! + ctor.toString(), e); ! } ! } } ! if (instance == null) ! { ! // try no-arg constructor ! try ! { ! instance = c.newInstance(); ! } ! catch (Exception e) ! { ! _log.error("Unable to construct tool " + toolName + " of class " + className, e); ! return; ! } } - _tools.put(toolName, instance); - _log.info("Registered ContextTool " + toolName); - } - - /** Fetch a tool */ - public ContextTool getTool(Object toolName) { - return (ContextTool) _tools.get(toolName); } ! /** ! * Load the context tools listed in the supplied string. See ! * the ComponentMap class for a description of the format of ! * this string. ! */ ! protected final void loadTools (String keyName) ! { ! getSettings().processListSetting(keyName, new ToolsSettingHandler()); } --- 826,845 ---- } ! /** Fetch a tool */ ! public Object getAutoContextVariable(String variableName, Context context) { ! ContextAutoLoader loader = (ContextAutoLoader) _toolLoader.get(variableName); ! try { ! if (loader == null) ! return null; ! else ! return loader.get(variableName, context); } ! catch (PropertyException e) { ! return null; } } ! public void registerAutoContextVariable(String variableName, ContextAutoLoader loader) { ! _toolLoader.put(variableName, loader); } Index: Context.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/Context.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Context.java 17 Jul 2003 05:25:06 -0000 1.63 --- Context.java 30 Jul 2003 04:51:17 -0000 1.64 *************** *** 219,269 **** { Object ret = _variables.get(name); ! if (ret == null && !_variables.containsKey(name)) { ! Object tool = _broker.getTool(name); ! if (tool != null) { ! try ! { ! ContextTool ct = (ContextTool) tool; ! ret = ct.init(this); ! put(name, ret); ! } ! catch (PropertyException e) ! { ! _log.error("Unable to initialize ContextTool: " + name, e); ! } } ! else if (name instanceof FunctionCall) { ! FunctionCall fc = (FunctionCall) name; ! String fname = fc.getName(); ! MethodWrapper func = null; ! if (_funcs != null) { ! func = (MethodWrapper) _funcs.get(fname); ! } ! if (func == null) ! { ! func = _broker.getFunction(fname); ! } ! if (func != null) ! { ! Object[] args = fc.getArguments(this); ! ret = func.invoke(args); ! } ! else ! { ! _log.error("Function " + fname + " was not loaded!"); ! } } else { ! // changed by Keats 30-Nov-01 ! return UNDEF; } ! //throw new ! // PropertyException.NoSuchVariableException(name.toString()); } - return ret; } --- 219,262 ---- { Object ret = _variables.get(name); ! if (ret != null || _variables.containsKey(name)) ! return ret; ! ! if (name instanceof String) { ! Object var = _broker.getAutoContextVariable((String) name, this); ! if (var != null) { ! put(name, var); ! return var; ! } ! else ! return UNDEF; ! } ! else if (name instanceof FunctionCall) { ! FunctionCall fc = (FunctionCall) name; ! String fname = fc.getName(); ! MethodWrapper func = null; ! if (_funcs != null) { ! func = (MethodWrapper) _funcs.get(fname); ! } ! if (func == null) { ! func = _broker.getFunction(fname); } ! if (func != null) { ! Object[] args = fc.getArguments(this); ! ret = func.invoke(args); } else { ! _log.error("Function " + fname + " was not loaded!"); } ! return ret; ! } ! else ! { ! // changed by Keats 30-Nov-01 ! return UNDEF; } } Index: ContextTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/ContextTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ContextTool.java 16 Jul 2003 06:44:59 -0000 1.9 --- ContextTool.java 30 Jul 2003 04:51:17 -0000 1.10 *************** *** 24,32 **** package org.webmacro; /** ! * This interface is used to attach utilities to a context to assist ! * with the generation of views. */ ! public interface ContextTool { --- 24,34 ---- package org.webmacro; + import org.webmacro.broker.ContextObjectFactory; + /** ! * This class is used as a base class for legacy context tools so they can fit into the ContextObjectFactory ! * framework. */ ! public abstract class ContextTool implements ContextObjectFactory { *************** *** 38,42 **** * to hold the per-request state. */ ! public Object init (Context c) throws PropertyException; } --- 40,47 ---- * to hold the per-request state. */ ! public abstract Object init (Context c) throws PropertyException; + public Object get(Context c) throws PropertyException { + return init(c); + } } |
From: <bri...@us...> - 2003-07-30 04:51:20
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv23890 Modified Files: WebMacro.defaults Log Message: Refactor ContextTool to be a special case of ContextAutoLoader Index: WebMacro.defaults =================================================================== RCS file: /cvsroot/webmacro/webmacro/WebMacro.defaults,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** WebMacro.defaults 30 Jul 2003 02:28:13 -0000 1.41 --- WebMacro.defaults 30 Jul 2003 04:51:17 -0000 1.42 *************** *** 216,219 **** --- 216,221 ---- parse.TemplateExtensions: .wm, .wmt, .tml, .tmpl, .wmm + ContextAutoLoaders.ContextTools: org.webmacro.broker.DefaultContextAutoLoader + ContextAutoLoaders.WebContextTools: org.webmacro.broker.DefaultContextAutoLoader # The following are tools which are added to your WebContext. You can |
From: <bri...@us...> - 2003-07-30 02:28:18
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/parser In directory sc8-pr-cvs1:/tmp/cvs-serv2401/src/org/webmacro/parser Modified Files: WMParser_impl.java WMParser_implConstants.java WMParser_implTokenManager.java Log Message: Replace complicated cache manager options with SimpleCacheManager (simple cache backed by ConcurrentHashMap) and ReloadingCacheManager (complicated reloading/expiring, simplified version of SMapCacheManager); replace TimeLoop (used by ReloadingCacheManager) with ClockDaemon; eliminate all the silly pseudo-optimization associated with ScalableXxx. Index: WMParser_impl.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_impl.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** WMParser_impl.java 21 Jul 2003 21:28:24 -0000 1.52 --- WMParser_impl.java 30 Jul 2003 02:28:14 -0000 1.53 *************** *** 2,18 **** package org.webmacro.parser; ! import org.webmacro.Broker; ! import org.webmacro.Context; ! import org.webmacro.WM; import org.webmacro.directive.*; import org.webmacro.directive.Directive.ArgDescriptor; import org.webmacro.directive.Directive.OptionChoice; import org.webmacro.directive.Directive.Subdirective; - import org.webmacro.engine.*; [...7572 lines suppressed...] + jj_rescan = false; + } ! final private void jj_save(int index, int xla) { ! JJCalls p = jj_2_rtns[index]; ! while (p.gen > jj_gen) { ! if (p.next == null) { p = p.next = new JJCalls(); break; } ! p = p.next; } + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; + } + + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; + } } Index: WMParser_implConstants.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_implConstants.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** WMParser_implConstants.java 12 Jun 2003 00:47:46 -0000 1.13 --- WMParser_implConstants.java 30 Jul 2003 02:28:14 -0000 1.14 *************** *** 2,134 **** package org.webmacro.parser; ! public interface WMParser_implConstants ! { ! int EOF = 0; ! int _ALPHA_CHAR = 1; ! int _NUM_CHAR = 2; ! int _ALPHANUM_CHAR = 3; ! int _IDENTIFIER_CHAR = 4; ! int _IDENTIFIER = 5; ! int _NEWLINE = 6; ! int _WHITESPACE = 7; ! int _QCHAR = 8; ! int _RESTOFLINE = 9; ! int _COMMENT = 10; ! int STUFF = 11; ! int RBRACE = 12; ! int END = 13; ! int BEGIN = 14; ! int LBRACE = 15; ! int POUNDPOUND = 17; ! int RESTOFLINE = 18; ! int COMMENT_ELSE = 19; ! int DOLLAR = 20; ! int QCHAR = 21; ! int SLASH = 22; ! int POUND = 23; ! int QUOTE = 24; ! int SQUOTE = 25; ! int NULL = 26; ! int TRUE = 27; ! int FALSE = 28; ! int UNDEFINED = 29; ! int WS = 30; ! int NEWLINE = 31; ! int LPAREN = 32; ! int RPAREN = 33; ! int LBRACKET = 34; ! int RBRACKET = 35; ! int COLON = 36; ! int DOT = 37; ! int OP_LT = 38; ! int OP_LE = 39; ! int OP_GT = 40; ! int OP_GE = 41; ! int OP_EQ = 42; ! int OP_SET = 43; ! int OP_NE = 44; ! int OP_PLUS = 45; ! int OP_MINUS = 46; ! int OP_MULT = 47; ! int OP_DIV = 48; ! int OP_AND = 49; ! int OP_OR = 50; ! int OP_NOT = 51; ! int COMMA = 52; ! int SEMI = 53; ! int WORD = 54; ! int NUMBER = 55; ! int OTHER = 56; ! int QS_TEXT = 57; ! int SQS_TEXT = 58; ! int SQS = 0; ! int QS = 1; ! int COMMENT = 2; ! int WM = 3; ! int DEFAULT = 4; ! String[] tokenImage = { ! "<EOF>", ! "<_ALPHA_CHAR>", ! "<_NUM_CHAR>", ! "<_ALPHANUM_CHAR>", ! "<_IDENTIFIER_CHAR>", ! "<_IDENTIFIER>", ! "<_NEWLINE>", ! "<_WHITESPACE>", ! "<_QCHAR>", ! "<_RESTOFLINE>", ! "<_COMMENT>", ! "<STUFF>", ! "\"}\"", ! "\"#end\"", ! "\"#begin\"", ! "\"{\"", ! "<token of kind 16>", ! "\"##\"", ! "<RESTOFLINE>", ! "<COMMENT_ELSE>", ! "\"$\"", ! "<QCHAR>", ! "\"\\\\\"", ! "\"#\"", ! "\"\\\"\"", ! "\"\\\'\"", ! "\"null\"", ! "\"true\"", ! "\"false\"", ! "\"undefined\"", ! "<WS>", ! "<NEWLINE>", ! "\"(\"", ! "\")\"", ! "\"[\"", ! "\"]\"", ! "\":\"", ! "\".\"", ! "\"<\"", ! "\"<=\"", ! "\">\"", ! "\">=\"", ! "\"==\"", ! "\"=\"", ! "<OP_NE>", ! "\"+\"", ! "\"-\"", ! "\"*\"", ! "\"/\"", ! "<OP_AND>", ! "<OP_OR>", ! "<OP_NOT>", ! "\",\"", ! "\";\"", ! "<WORD>", ! "<NUMBER>", ! "<OTHER>", ! "<QS_TEXT>", ! "<SQS_TEXT>", ! }; } --- 2,133 ---- package org.webmacro.parser; ! public interface WMParser_implConstants { ! int EOF = 0; ! int _ALPHA_CHAR = 1; ! int _NUM_CHAR = 2; ! int _ALPHANUM_CHAR = 3; ! int _IDENTIFIER_CHAR = 4; ! int _IDENTIFIER = 5; ! int _NEWLINE = 6; ! int _WHITESPACE = 7; ! int _QCHAR = 8; ! int _RESTOFLINE = 9; ! int _COMMENT = 10; ! int STUFF = 11; ! int RBRACE = 12; ! int END = 13; ! int BEGIN = 14; ! int LBRACE = 15; ! int POUNDPOUND = 17; ! int RESTOFLINE = 18; ! int COMMENT_ELSE = 19; ! int DOLLAR = 20; ! int QCHAR = 21; ! int SLASH = 22; ! int POUND = 23; ! int QUOTE = 24; ! int SQUOTE = 25; ! int NULL = 26; ! int TRUE = 27; ! int FALSE = 28; ! int UNDEFINED = 29; ! int WS = 30; ! int NEWLINE = 31; ! int LPAREN = 32; ! int RPAREN = 33; ! int LBRACKET = 34; ! int RBRACKET = 35; ! int COLON = 36; ! int DOT = 37; ! int OP_LT = 38; ! int OP_LE = 39; ! int OP_GT = 40; ! int OP_GE = 41; ! int OP_EQ = 42; ! int OP_SET = 43; ! int OP_NE = 44; ! int OP_PLUS = 45; ! int OP_MINUS = 46; ! int OP_MULT = 47; ! int OP_DIV = 48; ! int OP_AND = 49; ! int OP_OR = 50; ! int OP_NOT = 51; ! int COMMA = 52; ! int SEMI = 53; ! int WORD = 54; ! int NUMBER = 55; ! int OTHER = 56; ! int QS_TEXT = 57; ! int SQS_TEXT = 58; ! int SQS = 0; ! int QS = 1; ! int COMMENT = 2; ! int WM = 3; ! int DEFAULT = 4; ! String[] tokenImage = { ! "<EOF>", ! "<_ALPHA_CHAR>", ! "<_NUM_CHAR>", ! "<_ALPHANUM_CHAR>", ! "<_IDENTIFIER_CHAR>", ! "<_IDENTIFIER>", ! "<_NEWLINE>", ! "<_WHITESPACE>", ! "<_QCHAR>", ! "<_RESTOFLINE>", ! "<_COMMENT>", ! "<STUFF>", ! "\"}\"", ! "\"#end\"", ! "\"#begin\"", ! "\"{\"", ! "<token of kind 16>", ! "\"##\"", ! "<RESTOFLINE>", ! "<COMMENT_ELSE>", ! "\"$\"", ! "<QCHAR>", ! "\"\\\\\"", ! "\"#\"", ! "\"\\\"\"", ! "\"\\\'\"", ! "\"null\"", ! "\"true\"", ! "\"false\"", ! "\"undefined\"", ! "<WS>", ! "<NEWLINE>", ! "\"(\"", ! "\")\"", ! "\"[\"", ! "\"]\"", ! "\":\"", ! "\".\"", ! "\"<\"", ! "\"<=\"", ! "\">\"", ! "\">=\"", ! "\"==\"", ! "\"=\"", ! "<OP_NE>", ! "\"+\"", ! "\"-\"", ! "\"*\"", ! "\"/\"", ! "<OP_AND>", ! "<OP_OR>", ! "<OP_NOT>", ! "\",\"", ! "\";\"", ! "<WORD>", ! "<NUMBER>", ! "<OTHER>", ! "<QS_TEXT>", ! "<SQS_TEXT>", ! }; } Index: WMParser_implTokenManager.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_implTokenManager.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** WMParser_implTokenManager.java 12 Jun 2003 00:47:46 -0000 1.27 --- WMParser_implTokenManager.java 30 Jul 2003 02:28:14 -0000 1.28 *************** *** 1,1763 **** /* Generated By:JavaCC: Do not edit this line. WMParser_implTokenManager.java */ package org.webmacro.parser; ! ! public class WMParser_implTokenManager implements WMParser_implConstants { ! // Required by SetState ! void backup (int n) ! { [...3315 lines suppressed...] ! else ! error_column++; ! } ! if (!EOFSeen) { ! input_stream.backup(1); ! error_after = curPos <= 1 ? "" : input_stream.GetImage(); ! } ! throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); ! } ! } ! final void TokenLexicalActions(Token matchedToken) ! { ! switch(jjmatchedKind) ! { ! default : ! break; ! } ! } } |
From: <bri...@us...> - 2003-07-30 02:28:18
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv2401/test/unit/org/webmacro/template Modified Files: TST.properties Log Message: Replace complicated cache manager options with SimpleCacheManager (simple cache backed by ConcurrentHashMap) and ReloadingCacheManager (complicated reloading/expiring, simplified version of SMapCacheManager); replace TimeLoop (used by ReloadingCacheManager) with ClockDaemon; eliminate all the silly pseudo-optimization associated with ScalableXxx. Index: TST.properties =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TST.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TST.properties 5 May 2001 12:07:52 -0000 1.3 --- TST.properties 30 Jul 2003 02:28:15 -0000 1.4 *************** *** 9,13 **** #PropertyOperator.CacheManager: org.webmacro.resource.GenerationalCacheManager ! #CachingProvider.template.CacheManager=org.webmacro.resource.StaticSMapCacheManager ! #CachingProvider.url.CacheManager=org.webmacro.resource.StaticSMapCacheManager --- 9,13 ---- #PropertyOperator.CacheManager: org.webmacro.resource.GenerationalCacheManager ! #CachingProvider.template.CacheManager=org.webmacro.resource.ReloadingCacheManager ! #CachingProvider.url.CacheManager=org.webmacro.resource.SimpleCacheManager |
From: <bri...@us...> - 2003-07-30 02:28:18
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv2401/test/unit/org/webmacro Removed Files: TestStaticIdentityCM.java Log Message: Replace complicated cache manager options with SimpleCacheManager (simple cache backed by ConcurrentHashMap) and ReloadingCacheManager (complicated reloading/expiring, simplified version of SMapCacheManager); replace TimeLoop (used by ReloadingCacheManager) with ClockDaemon; eliminate all the silly pseudo-optimization associated with ScalableXxx. --- TestStaticIdentityCM.java DELETED --- |
From: <bri...@us...> - 2003-07-30 02:28:18
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv2401/src/org/webmacro/util Modified Files: Encoder.java Removed Files: AbstractScalableMap.java ScalableIdentityMap.java ScalableMap.java SimpleHashMap.java SimpleIdentityMap.java SimpleMap.java SimpleMapFactory.java StringArray.java TimeLoop.java Log Message: Replace complicated cache manager options with SimpleCacheManager (simple cache backed by ConcurrentHashMap) and ReloadingCacheManager (complicated reloading/expiring, simplified version of SMapCacheManager); replace TimeLoop (used by ReloadingCacheManager) with ClockDaemon; eliminate all the silly pseudo-optimization associated with ScalableXxx. Index: Encoder.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/util/Encoder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Encoder.java 12 Jun 2003 00:47:48 -0000 1.5 --- Encoder.java 30 Jul 2003 02:28:15 -0000 1.6 *************** *** 50,54 **** * * @see EncoderProvider - * @see SimpleEncoder * @since 0.96 * @author Michael Bayne --- 50,53 ---- --- AbstractScalableMap.java DELETED --- --- ScalableIdentityMap.java DELETED --- --- ScalableMap.java DELETED --- --- SimpleHashMap.java DELETED --- --- SimpleIdentityMap.java DELETED --- --- SimpleMap.java DELETED --- --- SimpleMapFactory.java DELETED --- --- StringArray.java DELETED --- --- TimeLoop.java DELETED --- |
From: <bri...@us...> - 2003-07-30 02:28:17
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/resource In directory sc8-pr-cvs1:/tmp/cvs-serv2401/src/org/webmacro/resource Added Files: ReloadingCacheManager.java SimpleCacheManager.java Removed Files: HMapCacheManager.java SMapCacheManager.java StaticIdentityCacheManager.java StaticSMapCacheManager.java Log Message: Replace complicated cache manager options with SimpleCacheManager (simple cache backed by ConcurrentHashMap) and ReloadingCacheManager (complicated reloading/expiring, simplified version of SMapCacheManager); replace TimeLoop (used by ReloadingCacheManager) with ClockDaemon; eliminate all the silly pseudo-optimization associated with ScalableXxx. --- NEW FILE: ReloadingCacheManager.java --- package org.webmacro.resource; import java.lang.ref.SoftReference; import EDU.oswego.cs.dl.util.concurrent.ClockDaemon; import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap; import EDU.oswego.cs.dl.util.concurrent.ThreadFactory; import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.Log; import org.webmacro.ResourceException; import org.webmacro.util.Settings; import org.webmacro.util.SubSettings; /** * ReloadingCacheManager -- a cache manager which supports reloading and expiration, backed * by a ConcurrentHashMap. Derived from the old SMapCacheManager, but simplified. * * @author Brian Goetz */ public class ReloadingCacheManager implements CacheManager { private static final String NAME = "ReloadingCacheManager"; private final ConcurrentHashMap _cache = new ConcurrentHashMap(); private int _cacheDuration; private String _resourceType; private boolean _reloadOnChange = true, _useSoftReferences = true; private boolean _delayReloadChecks = false; private long _checkForReloadDelay; // Use ClockDaemon instead of the original TimeLoop -- more efficient priority-queue based implementation private ClockDaemon _clockDaemon; private Log _log; private abstract class MyCacheElement extends CacheElement implements Cloneable { private CacheReloadContext reloadContext = null; public void setReloadContext (CacheReloadContext rc) { if (_delayReloadChecks && rc != null) this.reloadContext = new TimedReloadContext(rc, _checkForReloadDelay); else this.reloadContext = rc; } public abstract Object getObject (); public abstract void setObject (Object o); } private final class SoftScmCacheElement extends MyCacheElement { private SoftReference reference; public Object getObject () { return reference.get(); } public void setObject (Object o) { reference = new SoftReference(o); } } private final class DirectScmCacheElement extends MyCacheElement { private Object object; public Object getObject () { return object; } public void setObject (Object o) { object = o; } } public ReloadingCacheManager() { } public void init (Broker b, Settings config, String resourceType) throws InitException { Settings ourSettings, defaultSettings; _clockDaemon = new ClockDaemon(); _clockDaemon.setThreadFactory(new ThreadFactory() { public Thread newThread(Runnable runnable) { Thread t = new Thread(runnable); t.setDaemon(true); return t; } }); _log = b.getLog("resource", "Object loading and caching"); _resourceType = resourceType; ourSettings = new SubSettings(config, NAME + "." + _resourceType); defaultSettings = new SubSettings(config, NAME + ".*"); _cacheDuration = ourSettings.getIntegerSetting("ExpireTime", defaultSettings.getIntegerSetting("ExpireTime", config.getIntegerSetting("TemplateExpireTime", 0))); _useSoftReferences = (ourSettings.containsKey("UseSoftReferences")) ? ourSettings.getBooleanSetting("UseSoftReferences") : ((defaultSettings.containsKey("UseSoftReferences")) ? defaultSettings.getBooleanSetting("UseSoftReferences") : true); _reloadOnChange = (ourSettings.containsKey("ReloadOnChange")) ? ourSettings.getBooleanSetting("ReloadOnChange") : ((defaultSettings.containsKey("ReloadOnChange")) ? defaultSettings.getBooleanSetting("ReloadOnChange") : true); _checkForReloadDelay = (ourSettings.getIntegerSetting("CheckForReloadDelay", defaultSettings.getIntegerSetting("CheckForReloadDelay", -1))); _delayReloadChecks = _checkForReloadDelay > 0; _log.info(NAME + "." + _resourceType + ": " + "; expireTime=" + _cacheDuration + "; reload=" + _reloadOnChange + "; softReference=" + _useSoftReferences + "; checkForReloadDelay=" + _checkForReloadDelay); } private MyCacheElement newCacheElement() { if (_useSoftReferences) return new SoftScmCacheElement(); else return new DirectScmCacheElement(); } /** * Clear the cache. */ public void flush () { _cache.clear(); } /** * Close down the provider. */ public void destroy () { _cache.clear(); _clockDaemon.shutDown(); } public boolean supportsReload () { return _reloadOnChange; } private final void scheduleRemoval(final Object key) { _clockDaemon.executeAfterDelay(_cacheDuration, new Runnable() { public void run () { _cache.remove(key); if (_log.loggingDebug()) _log.debug("cache expired: " + key); } }); } /** * Get the object associated with the specific query, first * trying to look it up in a cache. If it's not there, then * call load(String) to load it into the cache. */ public Object get (final Object query, ResourceLoader helper) throws ResourceException { MyCacheElement r; Object o = null; boolean reload = false; r = (MyCacheElement) _cache.get(query); if (r != null) o = r.getObject(); // should the template be reloaded, regardless of cached status? if (o != null && r.reloadContext != null && _reloadOnChange) reload = r.reloadContext.shouldReload(); if (o == null || reload) { r = newCacheElement(); o = helper.load(query, r); if (o != null) { r.setObject(o); _cache.put(query, r); if (_log.loggingDebug()) _log.debug("cached: " + query + " for " + _cacheDuration); try { // if timeout is < 0, // then don't schedule a removal from cache if (_cacheDuration >= 0) scheduleRemoval(query); } catch (Exception e) { _log.error("CachingProvider caught an exception", e); } } } return o; } /** * Get the object associated with the specific query, * trying to look it up in a cache. If it's not there, return null. */ public Object get (final Object query) { MyCacheElement r = (MyCacheElement) _cache.get(query); if (r != null) return r.getObject(); else return null; } /** * Put an object in the cache */ public void put (final Object query, Object resource) { MyCacheElement r = newCacheElement(); r.setObject(resource); _cache.put(query, r); if (_cacheDuration >= 0) { if (_log.loggingDebug()) _log.debug("cached: " + query + " for " + _cacheDuration); scheduleRemoval(query); } } /** Removes a specific entry from the cache. */ public void invalidate (final Object query) { _cache.remove(query); } public String toString () { return NAME + "(type = " + _resourceType + ")"; } } --- HMapCacheManager.java DELETED --- --- SMapCacheManager.java DELETED --- --- StaticIdentityCacheManager.java DELETED --- --- StaticSMapCacheManager.java DELETED --- |
From: <bri...@us...> - 2003-07-30 02:28:16
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv2401/src/org/webmacro/engine Modified Files: PropertyOperatorCache.java Log Message: Replace complicated cache manager options with SimpleCacheManager (simple cache backed by ConcurrentHashMap) and ReloadingCacheManager (complicated reloading/expiring, simplified version of SMapCacheManager); replace TimeLoop (used by ReloadingCacheManager) with ClockDaemon; eliminate all the silly pseudo-optimization associated with ScalableXxx. Index: PropertyOperatorCache.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PropertyOperatorCache.java 23 Jul 2003 09:59:36 -0000 1.20 --- PropertyOperatorCache.java 30 Jul 2003 02:28:14 -0000 1.21 *************** *** 26,30 **** import org.webmacro.*; import org.webmacro.resource.CacheManager; ! import org.webmacro.resource.StaticSMapCacheManager; import org.webmacro.util.*; --- 26,30 ---- import org.webmacro.*; import org.webmacro.resource.CacheManager; ! import org.webmacro.resource.SimpleCacheManager; import org.webmacro.util.*; *************** *** 55,60 **** if (cacheManager == null || cacheManager.equals("")) { ! _log.info("CachingProvider: No cache manager specified for PropertyOperator, using StaticSMapCacheManager"); ! _cache = new StaticSMapCacheManager(); } else --- 55,60 ---- if (cacheManager == null || cacheManager.equals("")) { ! _log.info("CachingProvider: No cache manager specified for PropertyOperator, using SimpleCacheManager"); ! _cache = new SimpleCacheManager(); } else *************** *** 67,72 **** { _log.warning("Unable to load cache manager " + cacheManager ! + " for PropertyOperator, using StaticSMapCacheManager. Reason:\n" + e); ! _cache = new StaticSMapCacheManager(); } } --- 67,72 ---- { _log.warning("Unable to load cache manager " + cacheManager ! + " for PropertyOperator, using SimpleCacheManager. Reason:\n" + e); ! _cache = new SimpleCacheManager(); } } |
From: <bri...@us...> - 2003-07-30 02:28:16
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv2401/src/org/webmacro Modified Files: Broker.java Log Message: Replace complicated cache manager options with SimpleCacheManager (simple cache backed by ConcurrentHashMap) and ReloadingCacheManager (complicated reloading/expiring, simplified version of SMapCacheManager); replace TimeLoop (used by ReloadingCacheManager) with ClockDaemon; eliminate all the silly pseudo-optimization associated with ScalableXxx. Index: Broker.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/Broker.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Broker.java 17 Jul 2003 05:25:06 -0000 1.39 --- Broker.java 30 Jul 2003 02:28:13 -0000 1.40 *************** *** 38,41 **** --- 38,42 ---- import org.webmacro.util.Settings; import org.webmacro.util.SubSettings; + import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap; /** *************** *** 83,93 **** /** a local map for one to dump stuff into, specific to this Broker */ ! private Map _brokerLocal = Collections.synchronizedMap(new HashMap()); /** a local map for "global functions" */ ! private Map _functionMap = Collections.synchronizedMap(new HashMap()); /** a local map for context tools */ ! private Map _tools = Collections.synchronizedMap(new HashMap()); --- 84,94 ---- /** a local map for one to dump stuff into, specific to this Broker */ ! private Map _brokerLocal = new ConcurrentHashMap(); /** a local map for "global functions" */ ! private Map _functionMap = new ConcurrentHashMap(); /** a local map for context tools */ ! private Map _tools = new ConcurrentHashMap(); |
From: <bri...@us...> - 2003-07-30 02:28:16
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv2401 Modified Files: WebMacro.defaults Log Message: Replace complicated cache manager options with SimpleCacheManager (simple cache backed by ConcurrentHashMap) and ReloadingCacheManager (complicated reloading/expiring, simplified version of SMapCacheManager); replace TimeLoop (used by ReloadingCacheManager) with ClockDaemon; eliminate all the silly pseudo-optimization associated with ScalableXxx. Index: WebMacro.defaults =================================================================== RCS file: /cvsroot/webmacro/webmacro/WebMacro.defaults,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** WebMacro.defaults 23 Jul 2003 19:22:00 -0000 1.40 --- WebMacro.defaults 30 Jul 2003 02:28:13 -0000 1.41 *************** *** 284,289 **** # ! CachingProvider.template.CacheManager: org.webmacro.resource.SMapCacheManager ! CachingProvider.url.CacheManager: org.webmacro.resource.SMapCacheManager #CachingProvider.template.CacheManager: org.webmacro.resource.GenerationalCacheManager #CachingProvider.url.CacheManager: org.webmacro.resource.GenerationalCacheManager --- 284,289 ---- # ! CachingProvider.template.CacheManager: org.webmacro.resource.ReloadingCacheManager ! CachingProvider.url.CacheManager: org.webmacro.resource.ReloadingCacheManager #CachingProvider.template.CacheManager: org.webmacro.resource.GenerationalCacheManager #CachingProvider.url.CacheManager: org.webmacro.resource.GenerationalCacheManager *************** *** 293,305 **** # ! Encoder.*.CacheManager: org.webmacro.resource.StaticSMapCacheManager ! #Encoder.*.CacheManager: org.webmacro.resource.StaticIdentityCacheManager #Encoder.*.CacheManager: org.webmacro.resource.GenerationalCacheManager ! PropertyOperator.CacheManager: org.webmacro.resource.StaticSMapCacheManager ! # Larger bucket size for the PropertyOperator cache seems to speed test runs ! StaticSMapCacheManager.PropertyOperator.CacheBuckets: 10001 ! # SMapCacheManager properties (if used) # - An ExpireTime of 0 (zero) means WebMacro will never cache the resource # - A positive ExpireTime means WebMacro will re-fetch the resource every --- 293,302 ---- # ! Encoder.*.CacheManager: org.webmacro.resource.SimpleCacheManager #Encoder.*.CacheManager: org.webmacro.resource.GenerationalCacheManager ! PropertyOperator.CacheManager: org.webmacro.resource.SimpleCacheManager ! # ReloadingCacheManager properties (if used) # - An ExpireTime of 0 (zero) means WebMacro will never cache the resource # - A positive ExpireTime means WebMacro will re-fetch the resource every *************** *** 308,321 **** # when they change. ! SMapCacheManager.*.ExpireTime: 30000 ! SMapCacheManager.*.ReloadOnChange: true # Advanced properties: ! SMapCacheManager.*.CacheBuckets: 1001 ! SMapCacheManager.*.CacheFactor: 5 ! SMapCacheManager.*.UseSoftReferences: TRUE ! ! StaticSMapCacheManager.*.CacheBuckets: 1001 ! StaticSMapCacheManager.*.CacheFactor: 5 # CheckForReloadDelay sets, how often a cached template should --- 305,313 ---- # when they change. ! ReloadingCacheManager.*.ExpireTime: 30000 ! ReloadingCacheManager.*.ReloadOnChange: true # Advanced properties: ! ReloadingCacheManager.*.UseSoftReferences: TRUE # CheckForReloadDelay sets, how often a cached template should |
From: <bri...@us...> - 2003-07-30 02:28:16
|
Update of /cvsroot/webmacro/webmacro/lib In directory sc8-pr-cvs1:/tmp/cvs-serv2401/lib Added Files: concurrent.jar Log Message: Replace complicated cache manager options with SimpleCacheManager (simple cache backed by ConcurrentHashMap) and ReloadingCacheManager (complicated reloading/expiring, simplified version of SMapCacheManager); replace TimeLoop (used by ReloadingCacheManager) with ClockDaemon; eliminate all the silly pseudo-optimization associated with ScalableXxx. --- NEW FILE: concurrent.jar --- (This appears to be a binary file; contents omitted.) |