KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > workingset > lib > SpeedoWorkingSetManager


1 /**
2  * Copyright (C) 2001-2004 France Telecom R&D
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package org.objectweb.speedo.workingset.lib;
19
20 import org.objectweb.fractal.api.control.BindingController;
21 import org.objectweb.perseus.persistence.api.PersistenceException;
22 import org.objectweb.perseus.persistence.api.WorkingSet;
23 import org.objectweb.perseus.persistence.api.WorkingSetManager;
24 import org.objectweb.util.monolog.api.Logger;
25
26 /**
27  * The class is an implementation of the WorkingSetManager interface. This
28  * implementation is empty and do nothing. Indeed a WorkingSet is a fractal
29  * component linked to a ProxyManager instance. The the WorkingSet instances are
30  * pooled in same time that the ProxyManager instance. Then Speedo never asks to
31  * the TransactionalPersistenceManager (Perseus) to create WorkingSet instances.
32  *
33  * @author S.Chassande-Barrioz
34  */

35 public class SpeedoWorkingSetManager
36         implements WorkingSetManager, BindingController {
37
38     private Logger logger;
39
40     // IMPLEMENTATION OF THE UserBindingController INTERFACE //
41
//-------------------------------------------------------//
42

43     public String JavaDoc[] listFc() {
44         return new String JavaDoc[] {};
45     }
46
47     public Object JavaDoc lookupFc(String JavaDoc c) {
48         return null;
49     }
50
51     public void bindFc(String JavaDoc c, Object JavaDoc s) {
52         if ("logger".equals(c)) {
53             logger = (Logger) s;
54         }
55     }
56
57     public void unbindFc(String JavaDoc c) {
58     }
59
60
61     public WorkingSet createWS(Object JavaDoc userObject)
62             throws PersistenceException {
63         return userObject instanceof WorkingSet ? (WorkingSet) userObject : null;
64     }
65
66     public WorkingSet createWS(Object JavaDoc userObject,
67                                Object JavaDoc workingSetType)
68             throws PersistenceException {
69         return userObject instanceof WorkingSet ? (WorkingSet) userObject : null;
70     }
71
72     public void closeWS(WorkingSet ws) {
73     }
74 }
75
Popular Tags