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 BarServiceImpl implements FooService {
07:
08: private transient BarServiceHelper serviceHelper;
09: private int counter;
10:
11: public BarServiceImpl(BarServiceHelper serviceHelper) {
12: this .serviceHelper = serviceHelper;
13: }
14:
15: public String serviceMethod() {
16: return nextValue() + "-" + serviceHelper.serviceMethod();
17: }
18:
19: private synchronized int nextValue() {
20: return counter++;
21: }
22:
23: public int getCounter() {
24: return counter;
25: }
26:
27: }
|