KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.io.InputStream JavaDoc;
7
8 public class RedeploymentBeanImpl implements RedeploymentBean {
9
10   private int value;
11
12   public int getValue() {
13     synchronized(this) {
14       return value;
15     }
16   }
17
18   public void setValue(int value) {
19     synchronized(this) {
20       this.value = value;
21     }
22   }
23
24   public boolean hasResource(String JavaDoc resource) {
25     InputStream JavaDoc is;
26     try {
27       is = getClass().getResourceAsStream(resource);
28       return is!=null;
29     } catch (Exception JavaDoc e) {
30       return false;
31     }
32   }
33   
34 }
35
Popular Tags