This patch adds an interface called HTTPCookieProcessor. If there is a HTTPCookieProcessor set then amf connection calls it each time there is a cookie in the http response.
Then you can call the method AMFConnection.setCookie(String name, String value) to pass an input cookie to the underlying http connection.
Example of usage :
------------------------------------------------------------------------------------------------------------------------------
AMFConnection connection = new AMFConnection();
connection.setCookieProcessor(new HTTPCookieProcessor() {
public void processHTTPCookie(String cookieName, String cookieValue) {
System.out.println("[Cookie] " + cookieName + " : " + cookieValue);
}
});
connection.connect("
http://xxxxxx/messagebroker/amf");
Object o = connection.call("myService.hashCode", new Object[0]);
------------------------------------------------------------------------------------------------------------------------------
Each time a cookie will be sent back by the server the cookie processor will print it.
So you can easily write a processor that stores cookies like JSESSIONID somewhere and then give it back by calling :
connection.setHTTPCookie("JSESSIONID", value);