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: ParticipantMemoryUsers.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.rep.participants;
09:
10: import com.uwyn.rife.authentication.credentialsmanagers.MemoryUsers;
11: import com.uwyn.rife.authentication.exceptions.CredentialsManagerException;
12: import com.uwyn.rife.rep.BlockingParticipant;
13:
14: public class ParticipantMemoryUsers extends BlockingParticipant {
15: private MemoryUsers mUsers = null;
16:
17: public ParticipantMemoryUsers() {
18: setInitializationMessage("Creating in-memory user credentials ...");
19: setCleanupMessage("Cleaning up in-memory user credentials ...");
20: }
21:
22: protected void initialize() {
23: try {
24: mUsers = new MemoryUsers(this .getParameter(),
25: getResourceFinder());
26: } catch (CredentialsManagerException e) {
27: throw new RuntimeException(
28: "Fatal error during the initialization while creating the memory users object.",
29: e);
30: }
31: }
32:
33: protected Object _getObject(Object key) {
34: return mUsers;
35: }
36: }
|