Changeset 295
- Timestamp:
- 03/20/06 00:38:10
- Files:
-
- trunk/calendar3/appcommon/src/org/bedework/appcommon/DateTimeFormatter.java (modified) (6 diffs)
- trunk/calendar3/calEnv/src/org/bedework/calenv/CalEnv.java (modified) (1 diff)
- trunk/calendar3/deployment/build.xml (modified) (5 diffs)
- trunk/calendar3/deployment/termination/jboss/build.xml (modified) (1 diff)
- trunk/calendar3/icalendar/src/org/bedework/icalendar/IcalTranslator.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/appcommon/src/org/bedework/appcommon/DateTimeFormatter.java
r278 r295 85 85 private GregorianCalendar cal; 86 86 87 private static HashMap formattersTbl = new HashMap();87 private static volatile HashMap formattersTbl = new HashMap(); 88 88 89 89 /* What we store in the table */ … … 224 224 * @return String month name for this object 225 225 */ 226 public synchronizedString getMonthName() {226 public String getMonthName() { 227 227 Formatters fmt = getFormatters(); 228 228 FieldPosition f = new FieldPosition(DateFormat.MONTH_FIELD); 229 StringBuffer s = fmt.longDateFormatter.format(cal.getTime(), new StringBuffer(), f); 230 return s.substring(f.getBeginIndex(), f.getEndIndex()); 229 synchronized (fmt) { 230 StringBuffer s = fmt.longDateFormatter.format(cal.getTime(), new StringBuffer(), f); 231 return s.substring(f.getBeginIndex(), f.getEndIndex()); 232 } 231 233 } 232 234 … … 410 412 * represented by this object. 411 413 */ 412 public synchronizedString getDateString() {414 public String getDateString() { 413 415 Formatters fmt = getFormatters(); 414 return fmt.shortDateFormatter.format(cal.getTime()); 416 417 synchronized (fmt) { 418 return fmt.shortDateFormatter.format(cal.getTime()); 419 } 415 420 } 416 421 … … 420 425 * represented by this object. 421 426 */ 422 public synchronizedString getLongDateString() {427 public String getLongDateString() { 423 428 Formatters fmt = getFormatters(); 424 return fmt.longDateFormatter.format(cal.getTime()); 429 430 synchronized (fmt) { 431 return fmt.longDateFormatter.format(cal.getTime()); 432 } 425 433 } 426 434 … … 431 439 * If there is no time, returns a zero length string. 432 440 */ 433 public synchronizedString getTimeString() {441 public String getTimeString() { 434 442 Formatters fmt = getFormatters(); 435 return fmt.shortTimeFormatter.format(cal.getTime()); 443 444 synchronized (fmt) { 445 return fmt.shortTimeFormatter.format(cal.getTime()); 446 } 436 447 } 437 448 … … 439 450 Locale loc = calInfo.getLocale(); 440 451 441 Formatters fmt = (Formatters)formattersTbl.get(loc); 442 443 if (fmt == null) { 444 fmt = new Formatters(loc); 445 formattersTbl.put(loc, fmt); 446 } 447 448 return fmt; 452 return getFormatters(loc); 449 453 } 450 454 451 455 private static Formatters getFormatters(Locale loc) { 452 Formatters fmt = (Formatters)formattersTbl.get(loc); 453 454 if (fmt == null) { 455 fmt = new Formatters(loc); 456 formattersTbl.put(loc, fmt); 457 } 458 459 return fmt; 456 synchronized (formattersTbl) { 457 Formatters fmt = (Formatters)formattersTbl.get(loc); 458 459 if (fmt == null) { 460 fmt = new Formatters(loc); 461 formattersTbl.put(loc, fmt); 462 } 463 464 return fmt; 465 } 460 466 } 461 467 } trunk/calendar3/calEnv/src/org/bedework/calenv/CalEnv.java
r293 r295 56 56 "/properties/calendar/env.properties"; 57 57 58 private static Properties pr;58 private static volatile Properties pr; 59 59 60 60 private static volatile Integer lockit = new Integer(0); trunk/calendar3/deployment/build.xml
r293 r295 119 119 inheritrefs="true" target="build.configured" /> 120 120 121 <build.configured.apps kind="webapp" /> 121 <property name="org.bedework.deploy.kind" value="webapp" /> 122 <antcall target="build.configured.apps" inheritrefs="true" /> 122 123 </target> 123 124 124 125 <target name="build.portal.apps" if="org.bedework.global.portal.platform" > 125 <build.configured.apps kind="${org.bedework.global.portal.platform}" /> 126 <property name="org.bedework.deploy.kind" 127 value="${org.bedework.global.portal.platform}" /> 128 <antcall target="build.configured.apps" inheritrefs="true" /> 126 129 </target> 127 130 128 131 <target name="build.j2ee.apps" if="org.bedework.global.j2ee.platform" > 129 <build.configured.apps kind="${org.bedework.global.j2ee.platform}" /> 132 <property name="org.bedework.deploy.kind" 133 value="${org.bedework.global.j2ee.platform}" /> 134 <antcall target="build.configured.apps" inheritrefs="true" /> 130 135 </target> 131 136 … … 161 166 <target name="deploy.standalone.apps" if="org.bedework.global.build.standalone.app" > 162 167 <property name="org.bedework.deploy.kind" value="webapp" /> 163 <antcall target="deploy.apps .target" inheritrefs="true" />168 <antcall target="deploy.apps" inheritrefs="true" /> 164 169 </target> 165 170 166 171 <target name="deploy.portal.apps" if="org.bedework.global.portal.platform" > 167 <deploy.apps kind="${org.bedework.global.portal.platform}" /> 172 <property name="org.bedework.deploy.kind" 173 value="${org.bedework.global.portal.platform}" /> 174 <antcall target="deploy.apps" inheritrefs="true" /> 168 175 </target> 169 176 170 177 <target name="deploy.j2ee.apps" if="org.bedework.global.j2ee.platform" > 171 <deploy.apps kind="${org.bedework.global.j2ee.platform}" /> 178 <property name="org.bedework.deploy.kind" 179 value="${org.bedework.global.j2ee.platform}" /> 180 <antcall target="deploy.apps" inheritrefs="true" /> 172 181 </target> 173 182 … … 196 205 this component. 197 206 ================================================================= --> 198 <macrodef name="build.configured.apps"> 199 <attribute name="kind" /> 200 <sequential> 201 <!-- ======================= webadmin ================= --> 202 <ant antfile="${org.bedework.deployment.base}/webadmin/@{kind}/build.xml" 203 inheritrefs="true" target="build.configured" /> 204 205 <!-- ======================= pubevents ================= --> 206 <ant antfile="${org.bedework.deployment.base}/webpublic/@{kind}/build.xml" 207 inheritrefs="true" target="build.configured" /> 208 209 <!-- ======================= personal ================= --> 210 <ant antfile="${org.bedework.deployment.base}/webuser/@{kind}/build.xml" 211 inheritrefs="true" target="build.configured" /> 212 213 <!-- ======================= caldav - public ================= --> 214 <ant antfile="${org.bedework.deployment.base}/publiccaldav/@{kind}/build.xml" 215 inheritrefs="true" target="build.configured" /> 216 217 <!-- ======================= caldav - user ================= --> 218 <ant antfile="${org.bedework.deployment.base}/usercaldav/@{kind}/build.xml" 219 inheritrefs="true" target="build.configured" /> 220 221 <!-- ======================= termination tasks ================= --> 222 <ant antfile="${org.bedework.deployment.base}/termination/@{kind}/build.xml" 223 inheritrefs="true" target="build.configured" /> 224 </sequential> 225 </macrodef> 226 227 <target name="deploy.apps.target"> 207 <target name="build.configured.apps"> 228 208 <forEachApp names="${org.bedework.install.app.names}" 229 209 types="${org.bedework.install.app.types}" … … 236 216 237 217 <ant antfile="${org.bedework.deployment.base}/${org.bedework.deploy.type}/${org.bedework.deploy.kind}/build.xml" 218 inheritrefs="true" target="build.configured" > 219 <propertyset refid="app-properties" /> 220 </ant> 221 </sequential> 222 </forEachApp> 223 224 <!-- ======================= termination tasks ================= --> 225 <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml" 226 inheritrefs="true" target="build.configured" /> 227 </target> 228 229 <target name="deploy.apps"> 230 <forEachApp names="${org.bedework.install.app.names}" 231 types="${org.bedework.install.app.types}" 232 prefix="org.bedework.deploy"> 233 <sequential> 234 <propertyset id="app-properties"> 235 <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/> 236 <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/> 237 </propertyset> 238 239 <ant antfile="${org.bedework.deployment.base}/${org.bedework.deploy.type}/${org.bedework.deploy.kind}/build.xml" 238 240 inheritrefs="true" target="deploy" > 239 241 <propertyset refid="app-properties" /> … … 241 243 </sequential> 242 244 </forEachApp> 243 </target> 244 245 <macrodef name="deploy.apps"> 246 <attribute name="kind" /> 247 <sequential> 248 <forEachApp names="${org.bedework.install.app.names}" 249 types="${org.bedework.install.app.types}" 250 prefix="org.bedework.deploy"> 251 <sequential> 252 <property name="prefix" value="org.bedework.${org.bedework.deploy.type}" /> 253 <propertyset id="app-properties"> 254 <propertyref prefix="${prefix}"/> 255 <globmapper from="${prefix}*" to="propval*"/> 256 </propertyset> 257 </sequential> 258 </forEachApp> 259 260 <!-- ======================= webadmin ================= --> 261 <ant antfile="${org.bedework.deployment.base}/webadmin/@{kind}/build.xml" 262 inheritrefs="true" target="deploy" /> 263 264 <!-- ======================= pubevents ================= --> 265 <ant antfile="${org.bedework.deployment.base}/webpublic/@{kind}/build.xml" 266 inheritrefs="true" target="deploy" /> 267 268 <!-- ======================= personal ================= --> 269 <ant antfile="${org.bedework.deployment.base}/webuser/@{kind}/build.xml" 270 inheritrefs="true" target="deploy" /> 271 272 <!-- ======================= caldav - public ================= --> 273 <ant antfile="${org.bedework.deployment.base}/publiccaldav/@{kind}/build.xml" 274 inheritrefs="true" target="deploy" /> 275 276 <!-- ======================= caldav - user ================= --> 277 <ant antfile="${org.bedework.deployment.base}/usercaldav/@{kind}/build.xml" 278 inheritrefs="true" target="deploy" /> 279 280 <!-- ======================= termination tasks ================= --> 281 <ant antfile="${org.bedework.deployment.base}/termination/@{kind}/build.xml" 282 inheritrefs="true" target="deploy" /> 283 </sequential> 284 </macrodef> 245 246 <!-- ======================= termination tasks ================= --> 247 <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml" 248 inheritrefs="true" target="deploy" /> 249 </target> 285 250 </project> trunk/calendar3/deployment/termination/jboss/build.xml
r293 r295 10 10 11 11 <property name="app.ear.file" 12 location="${dist.home}/${ propval.app.ear.name}.ear" />12 location="${dist.home}/${org.bedework.global.ear.name}.ear" /> 13 13 <property name="app.resources.dir" 14 14 location="${this.dir}/../webapp/resources" /> trunk/calendar3/icalendar/src/org/bedework/icalendar/IcalTranslator.java
r270 r295 65 65 import net.fortuna.ical4j.data.CalendarParserImpl; 66 66 import net.fortuna.ical4j.data.ParserException; 67 import net.fortuna.ical4j.data.UnfoldingReader; 67 68 //import net.fortuna.ical4j.data.UnfoldingReader; 68 69 import net.fortuna.ical4j.model.Calendar; … … 273 274 CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); 274 275 276 UnfoldingReader ufrdr = new UnfoldingReader(new StringReader(val), true); 277 275 278 //return fromIcal(cal, bldr.build(new UnfoldingReader(new StringReader(val)))); 276 return fromIcal(cal, bldr.build( new StringReader(val), true));279 return fromIcal(cal, bldr.build(ufrdr)); 277 280 } catch (ParserException pe) { 278 281 if (debug) { … … 300 303 301 304 //return fromIcal(cal, bldr.build(new UnfoldingReader(rdr))); 302 return fromIcal(cal, bldr.build( rdr, true));305 return fromIcal(cal, bldr.build(new UnfoldingReader(rdr, true))); 303 306 } catch (ParserException pe) { 304 307 if (debug) { … … 359 362 CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); 360 363 361 return bldr.build(new StringReader(val), true); 364 UnfoldingReader ufrdr = new UnfoldingReader(new StringReader(val), true); 365 366 return bldr.build(ufrdr); 362 367 } catch (Throwable t) { 363 368 throw new CalFacadeException(t); … … 379 384 CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); 380 385 381 Calendar cal = bldr.build(new StringReader(val), true); 386 UnfoldingReader ufrdr = new UnfoldingReader(new StringReader(val), true); 387 388 Calendar cal = bldr.build(ufrdr); 382 389 Vector evs = new Vector(); 383 390
