KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.springframework.beans.factory.FactoryBean;
7
8 public class SingletonFactoryBean implements FactoryBean {
9
10   private Object JavaDoc singleton;
11
12   public Object JavaDoc getObject() throws Exception JavaDoc {
13     return singleton;
14   }
15
16   public Class JavaDoc getObjectType() {
17     return Singleton.class;
18   }
19
20   public boolean isSingleton() {
21     return true;
22   }
23   
24   public void setObject(Object JavaDoc singleton) {
25     this.singleton = singleton;
26   }
27
28 }
29
30
Popular Tags