01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: MemoryLogoutDeployer.java 3643 2007-01-12 15:29:45Z gbevin $
07: */
08: package com.uwyn.rife.authentication.elements;
09:
10: import com.uwyn.rife.authentication.sessionmanagers.MemorySessions;
11: import com.uwyn.rife.authentication.sessionmanagers.SessionManagerFactoryFactory;
12: import com.uwyn.rife.authentication.sessionmanagers.SimpleSessionManagerFactory;
13: import com.uwyn.rife.engine.ElementDeployer;
14: import com.uwyn.rife.engine.exceptions.EngineException;
15: import com.uwyn.rife.ioc.HierarchicalProperties;
16:
17: /**
18: * Deployer for logout elements that by default sets up all the
19: * authentication managers for memory storage.
20: *
21: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
22: * @version $Revision: 3643 $
23: * @since 1.6
24: */
25: public class MemoryLogoutDeployer extends ElementDeployer {
26: public void deploy() throws EngineException {
27: HierarchicalProperties properties = getElementInfo()
28: .getProperties();
29: if (getElementInfo()
30: .isPropertyEmpty(
31: SessionManagerFactoryFactory.PROPERTYNAME_FACTORY_CLASS)) {
32: properties
33: .put(
34: SessionManagerFactoryFactory.PROPERTYNAME_FACTORY_CLASS,
35: SimpleSessionManagerFactory.class.getName());
36: }
37: if (getElementInfo().isPropertyEmpty(
38: SimpleSessionManagerFactory.PROPERTYNAME_MANAGER_CLASS)) {
39: properties
40: .put(
41: SimpleSessionManagerFactory.PROPERTYNAME_MANAGER_CLASS,
42: MemorySessions.class.getName());
43: }
44: }
45: }
|