1
2
3
4
5
6
7
8
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.config.MuleProperties;
17 import org.mule.api.transport.SessionHandler;
18
19 import org.apache.commons.logging.Log;
20 import org.apache.commons.logging.LogFactory;
21
22
23
24
25
26
27
28 public class SimpleSessionHandler implements SessionHandler
29 {
30 protected transient Log logger = LogFactory.getLog(getClass());
31
32 public MuleSession retrieveSessionInfoFromMessage(MuleMessage message) throws MuleException
33 {
34 return message.getInboundProperty(MuleProperties.MULE_SESSION_PROPERTY);
35 }
36
37
38
39
40 public void retrieveSessionInfoFromMessage(MuleMessage message, MuleSession session) throws MuleException
41 {
42 session = retrieveSessionInfoFromMessage(message);
43 }
44
45 public void storeSessionInfoToMessage(MuleSession session, MuleMessage message) throws MuleException
46 {
47 message.setOutboundProperty(MuleProperties.MULE_SESSION_PROPERTY, session);
48 }
49
50
51
52
53 public String getSessionIDKey()
54 {
55 return "ID";
56 }
57 }