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