1 /*
2 * $Id: NullSessionHandler.java 19191 2010-08-25 21:05:23Z tcarlson $
3 * --------------------------------------------------------------------------------------
4 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.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.session;
12
13 import org.mule.api.MuleException;
14 import org.mule.api.MuleMessage;
15 import org.mule.api.MuleSession;
16 import org.mule.api.transport.SessionHandler;
17
18 /**
19 * A session handler that ignores any session information
20 */
21 public class NullSessionHandler implements SessionHandler
22 {
23 public MuleSession retrieveSessionInfoFromMessage(MuleMessage message) throws MuleException
24 {
25 return null;
26 }
27
28 /**
29 * @deprecated Use retrieveSessionInfoFromMessage(MuleMessage message) instead
30 */
31 @Deprecated
32 public void retrieveSessionInfoFromMessage(MuleMessage message, MuleSession session) throws MuleException
33 {
34 retrieveSessionInfoFromMessage(message);
35 }
36
37 public void storeSessionInfoToMessage(MuleSession session, MuleMessage message) throws MuleException
38 {
39 // noop
40 }
41
42 /**
43 * The property name of the session id to use when creating the Mule session. by
44 * default the property name "ID" will be used. If no property was set on the
45 * session called "ID" a session id will be automatically generated
46 *
47 * @return the property name of the session id that is set on the session
48 */
49 public String getSessionIDKey()
50 {
51 return "ID";
52 }
53 }