View Javadoc

1   /*
2    * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3    * the spring framework, http://el4j.sf.net
4    * Copyright (C) 2005 by ELCA Informatique SA, Av. de la Harpe 22-24,
5    * 1000 Lausanne, Switzerland, http://www.elca.ch
6    *
7    * EL4J is published under the GNU Lesser General Public License (LGPL)
8    * Version 2.1. See http://www.gnu.org/licenses/
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   * GNU Lesser General Public License for more details.
14   *
15   * For alternative licensing, please contact info@elca.ch
16   */
17  
18  package ch.elca.el4j.tests.remoting.service;
19  
20  import java.util.HashMap;
21  import java.util.Map;
22  
23  import org.slf4j.Logger;
24  import org.slf4j.LoggerFactory;
25  
26  import ch.elca.el4j.core.contextpassing.ImplicitContextPasser;
27  import ch.elca.el4j.core.contextpassing.ImplicitContextPassingRegistry;
28  
29  /**
30   * This class is used to test if the implicit context passing works.
31   *
32   * @svnLink $Revision: 3884 $;$Date: 2009-08-04 15:48:31 +0200 (Di, 04. Aug 2009) $;$Author: swismer $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/tests/remoting/web/jar/src/main/java/ch/elca/el4j/tests/remoting/service/TestImplicitContextPassingRegistry.java $
33   *
34   * @author Martin Zeltner (MZE)
35   */
36  public class TestImplicitContextPassingRegistry implements
37  		ImplicitContextPassingRegistry {
38  	/**
39  	 * Private logger.
40  	 */
41  	private static Logger s_logger = LoggerFactory.getLogger(
42  		TestImplicitContextPassingRegistry.class);
43  
44  	/**
45  	 * {@inheritDoc}
46  	 */
47  	public void registerImplicitContextPasser(
48  		ImplicitContextPasser passer) {
49  		// Do nothing.
50  	}
51  
52  	/**
53  	 * {@inheritDoc}
54  	 */
55  	public void unregisterImplicitContextPasser(
56  		ImplicitContextPasser passer) {
57  		// Do nothing.
58  	}
59  	
60  	/**
61  	 * {@inheritDoc}
62  	 */
63  	public Map getAssembledImplicitContext() {
64  		Map map = new HashMap();
65  		map.put("testMessage", "Hello everybody, I am THE test message.");
66  		return map;
67  	}
68  
69  	/**
70  	 * {@inheritDoc}
71  	 */
72  	public void pushAssembledImplicitContext(Map contexts) {
73  		s_logger.info("Test message: " + contexts.get("testMessage"));
74  	}
75  }