KickJava   Java API By Example, From Geeks To Geeks.

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


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 FooServiceImpl implements FooService {
8   private int counter;
9   private String JavaDoc prefix = "rawValue";
10   
11   
12   public void setPrefix(String JavaDoc prefix) {
13     this.prefix = prefix;
14   }
15
16   public String JavaDoc serviceMethod() {
17     return prefix + "-" + nextValue();
18   }
19  
20   private synchronized int nextValue() {
21     return counter++;
22   }
23
24 }
25
Popular Tags