1 19 20 package org.apache.cayenne.remote.hessian; 21 22 import java.io.IOException ; 23 import java.net.URL ; 24 import java.net.URLConnection ; 25 26 import org.apache.cayenne.remote.RemoteSession; 27 28 34 class HessianProxyFactory extends com.caucho.hessian.client.HessianProxyFactory { 35 36 static final String SESSION_COOKIE_NAME = "JSESSIONID"; 37 38 private HessianConnection clientConnection; 39 40 HessianProxyFactory(HessianConnection clientConnection) { 41 this.clientConnection = clientConnection; 42 } 43 44 protected URLConnection openConnection(URL url) throws IOException { 45 URLConnection connection = super.openConnection(url); 46 47 51 RemoteSession session = clientConnection.getSession(); 53 if (session != null && session.getSessionId() != null) { 54 connection.setRequestProperty("Cookie", SESSION_COOKIE_NAME 55 + "=" 56 + session.getSessionId()); 57 } 58 59 return connection; 60 } 61 } 62 | Popular Tags |