All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zkoss.zkplus.cluster.ClusterSessionPatch Maven / Gradle / Ivy

There is a newer version: 10.0.0-jakarta
Show newest version
/* ClusterSessionPatch.java

	Purpose:
		
	Description:
		
	History:
		Jun 27, 2011 4:00:01 PM, Created by jimmy

Copyright (C) 2011 Potix Corporation. All Rights Reserved.

This program is distributed under GPL Version 3.0 in the hope that
it will be useful, but WITHOUT ANY WARRANTY.
*/
package org.zkoss.zkplus.cluster;

import java.util.List;

import org.zkoss.zk.ui.Execution;
import org.zkoss.zk.ui.Session;
import org.zkoss.zk.ui.impl.Attributes;
import org.zkoss.zk.ui.util.ExecutionCleanup;

/**
 * 

* This listener is used with Weblogic clustering server * or cloud environment (such as Google App Engine). *

then you have to add following lines in application's WEB-INF/zk.xml:

*

 * 	<listener>
 *		<listener-class>org.zkoss.zkplus.cluster.ClusterSessionPatch</listener-class>
 *	</listener>
 * 
* @author jimmy * @since 5.0.8 * */ public class ClusterSessionPatch implements ExecutionCleanup { public void cleanup(Execution exec, Execution parent, List errs) throws Exception { Session sess = exec.getSession(); //enforce GAE to write session //enforce Weblogic to sync session if (sess != null) sess.setAttribute(Attributes.ZK_SESSION, sess.getAttribute(Attributes.ZK_SESSION)); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy