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.core.contextpassing;
19
20 import ch.elca.el4j.core.contextpassing.AbstractImplicitContextPasser;
21
22 /**
23 * This is the test implicit context passer B on client side.
24 *
25 * @svnLink $Revision: 4010 $;$Date: 2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) $;$Author: jonasha $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/modules/core/src/test/java/ch/elca/el4j/tests/core/contextpassing/ImplicitContextPasserB.java $
26 *
27 * @author Martin Zeltner (MZE)
28 */
29 public class ImplicitContextPasserB extends AbstractImplicitContextPasser {
30 /**
31 * Test data.
32 */
33 private static final double m_testData = 974366.96;
34
35 /**
36 * Received data.
37 */
38 private double m_receivedData = 0;
39
40 /**
41 * {@inheritDoc}
42 */
43 public Object getImplicitlyPassedContext() {
44 return new Double(m_testData);
45 }
46
47 /**
48 * {@inheritDoc}
49 */
50 public void pushImplicitlyPassedContext(Object context) {
51 if (context != null) {
52 m_receivedData = ((Double) context).doubleValue();
53 }
54 }
55
56 /**
57 * @return Returns the receivedData.
58 */
59 public double getReceivedData() {
60 return m_receivedData;
61 }
62
63 /**
64 * @return Returns the testData.
65 */
66 public double getTestData() {
67 return m_testData;
68 }
69 }