1 /*
2 * $Id: CxfMuleSession.java 11405 2008-03-18 00:13:00Z dirk.olmes $
3 * --------------------------------------------------------------------------------------
4 * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5 *
6 * The software in this package is published under the terms of the CPAL v1.0
7 * license, a copy of which has been included with this distribution in the
8 * LICENSE.txt file.
9 */
10
11 package org.mule.transport.cxf;
12
13 import org.mule.api.MuleSession;
14
15 import org.apache.cxf.transport.Session;
16
17 /**
18 * Mules session wrapper for XFire
19 */
20 public class CxfMuleSession implements Session
21 {
22 MuleSession session;
23
24 public CxfMuleSession(MuleSession session)
25 {
26 if (session == null)
27 {
28 throw new IllegalArgumentException("MuleSession");
29 }
30 this.session = session;
31 }
32
33 /**
34 * Get a variable from the session by the key.
35 *
36 * @param key
37 * @return Value
38 */
39 public Object get(Object key)
40 {
41 return session.getProperty(key);
42 }
43
44 /**
45 * Put a variable into the session with a key.
46 *
47 * @param key
48 * @param value
49 */
50 public void put(Object key, Object value)
51 {
52 session.setProperty(key, value);
53 }
54 }