01: /**
02: * Copyright (C) 2001-2004 France Telecom R&D
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * 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: */package org.objectweb.speedo.workingset.lib;
18:
19: import org.objectweb.fractal.api.control.BindingController;
20: import org.objectweb.perseus.persistence.api.PersistenceException;
21: import org.objectweb.perseus.persistence.api.WorkingSet;
22: import org.objectweb.perseus.persistence.api.WorkingSetManager;
23: import org.objectweb.util.monolog.api.Logger;
24:
25: /**
26: * The class is an implementation of the WorkingSetManager interface. This
27: * implementation is empty and do nothing. Indeed a WorkingSet is a fractal
28: * component linked to a POManagerItf instance. The WorkingSet instances are
29: * pooled in same time that the POManagerItf instance. Then Speedo never asks to
30: * the TransactionalPersistenceManager (Perseus) to create WorkingSet instances.
31: *
32: * @author S.Chassande-Barrioz
33: */
34: public class WorkingSetManagerImpl implements WorkingSetManager,
35: BindingController {
36:
37: private Logger logger;
38:
39: // IMPLEMENTATION OF THE UserBindingController INTERFACE //
40: //-------------------------------------------------------//
41:
42: public String[] listFc() {
43: return new String[] {};
44: }
45:
46: public Object lookupFc(String c) {
47: return null;
48: }
49:
50: public void bindFc(String c, Object s) {
51: if ("logger".equals(c)) {
52: logger = (Logger) s;
53: }
54: }
55:
56: public void unbindFc(String c) {
57: }
58:
59: public WorkingSet createWS(Object userObject)
60: throws PersistenceException {
61: return userObject instanceof WorkingSet ? (WorkingSet) userObject
62: : null;
63: }
64:
65: public WorkingSet createWS(Object userObject, Object workingSetType)
66: throws PersistenceException {
67: return userObject instanceof WorkingSet ? (WorkingSet) userObject
68: : null;
69: }
70:
71: public void closeWS(WorkingSet ws) {
72: }
73: }
|