01: package org.concern.controller.spring;
02:
03: import org.springframework.beans.factory.*;
04: import org.hibernate.SessionFactory;
05: import org.concern.controller.Worklist;
06: import org.concern.controller.Collaboration;
07:
08: import javax.transaction.TransactionManager;
09:
10: public class CollaborationFactoryBean implements FactoryBean,
11: InitializingBean, DisposableBean {
12: protected Collaboration collaboration;
13:
14: public Object getObject() throws Exception {
15: return collaboration;
16: }
17:
18: public Class getObjectType() {
19: return org.concern.Collaboration.class;
20: }
21:
22: public boolean isSingleton() {
23: return false;
24: }
25:
26: public void afterPropertiesSet() throws Exception {
27: collaboration = new Collaboration();
28:
29: System.setProperty("concern.controller.lookup",
30: LocalControllerLookup.class.getName());
31: ((LocalControllerLookup) LocalControllerLookup.getInstance())
32: .setCollaboration(collaboration);
33: }
34:
35: public void destroy() throws Exception {
36: ((LocalControllerLookup) LocalControllerLookup.getInstance())
37: .setCollaboration(null);
38: }
39: }
|