01: /*
02: * $Id: CxfMuleSession.java 11405 2008-03-18 00:13:00Z dirk.olmes $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
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: MuleSession session;
22:
23: public CxfMuleSession(MuleSession session) {
24: if (session == null) {
25: throw new IllegalArgumentException("MuleSession");
26: }
27: this .session = session;
28: }
29:
30: /**
31: * Get a variable from the session by the key.
32: *
33: * @param key
34: * @return Value
35: */
36: public Object get(Object key) {
37: return session.getProperty(key);
38: }
39:
40: /**
41: * Put a variable into the session with a key.
42: *
43: * @param key
44: * @param value
45: */
46: public void put(Object key, Object value) {
47: session.setProperty(key, value);
48: }
49: }
|