KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > spring > bean > BarServiceImpl


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tctest.spring.bean;
5
6
7 public class BarServiceImpl implements FooService {
8
9   private transient BarServiceHelper serviceHelper;
10   private int counter;
11   
12   public BarServiceImpl(BarServiceHelper serviceHelper) {
13     this.serviceHelper = serviceHelper;
14   }
15
16   public String JavaDoc serviceMethod() {
17     return nextValue() + "-" + serviceHelper.serviceMethod();
18   }
19
20   private synchronized int nextValue() {
21     return counter++;
22   }
23
24 }
25
Popular Tags