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: DatabaseLogoutDeployer.java 3643 2007-01-12 15:29:45Z gbevin $
07: */
08: package com.uwyn.rife.authentication.elements;
09:
10: import com.uwyn.rife.authentication.remembermanagers.DatabaseRememberFactory;
11: import com.uwyn.rife.authentication.remembermanagers.RememberManagerFactoryFactory;
12: import com.uwyn.rife.authentication.sessionmanagers.DatabaseSessionsFactory;
13: import com.uwyn.rife.authentication.sessionmanagers.SessionManagerFactoryFactory;
14: import com.uwyn.rife.engine.ElementDeployer;
15: import com.uwyn.rife.engine.exceptions.EngineException;
16: import com.uwyn.rife.ioc.HierarchicalProperties;
17:
18: /**
19: * Deployer for logout elements that by default sets up all the
20: * authentication managers for database storage.
21: *
22: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
23: * @version $Revision: 3643 $
24: * @since 1.6
25: */
26: public class DatabaseLogoutDeployer extends ElementDeployer {
27: public void deploy() throws EngineException {
28: HierarchicalProperties properties = getElementInfo()
29: .getProperties();
30: if (getElementInfo()
31: .isPropertyEmpty(
32: SessionManagerFactoryFactory.PROPERTYNAME_FACTORY_CLASS)) {
33: properties
34: .put(
35: SessionManagerFactoryFactory.PROPERTYNAME_FACTORY_CLASS,
36: DatabaseSessionsFactory.class.getName());
37: }
38: if (getElementInfo()
39: .isPropertyEmpty(
40: RememberManagerFactoryFactory.PROPERTYNAME_FACTORY_CLASS)) {
41: properties
42: .put(
43: RememberManagerFactoryFactory.PROPERTYNAME_FACTORY_CLASS,
44: DatabaseRememberFactory.class.getName());
45: }
46: }
47: }
|