01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.spring.bean;
05:
06: public class CrashSingleton {
07: private volatile int counter = 0;
08:
09: synchronized public int getCounter() {
10: return counter;
11: }
12:
13: synchronized public void incrementCounter() {
14: this .counter++;
15: }
16:
17: public String toString() {
18: return "CrashSingleton:" + counter;
19: }
20: }
|