1 /** 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.geronimo.clustering; 18 19 /** 20 * Callback listener for inbound and outbound Session migration. 21 * <p> 22 * A Session is preemptively moved between its associated set of SessionManagers. For instance, when a 23 * ClusteredInvocation for a given Session is invoked on a Node where the local SessionManager, RequestingSM, does not 24 * own the targeted Session, the SessionManager owning the Session, OwningSM, the Session may be moved from OwningSM 25 * to RequestingSM. OwningSM, prior to relinquish the Session, executes notifyOutboundSessionMigration and provides 26 * the Session under migration. RequestingRM, after having acquired the Session ownership, executes 27 * notifyInboundSessionMigration and provides the Session under migration. 28 * <p> 29 * The typical usage of these migration callbacks are to allow a wrapping SessionManager, e.g. an HTTPSession manager, 30 * to perform bookkeeping operations. 31 * 32 * @version $Rev$ $Date$ 33 */ 34 public interface SessionListener { 35 36 /** 37 * Calls when the ownership of the provided Session is acquired by the SessionManager to which this listener 38 * is attached. 39 * 40 * @param session New Session now owned by the attached SessionManager. 41 */ 42 void notifyInboundSessionMigration(Session session); 43 44 /** 45 * Calls when the ownership of the provided Session is relinquished to another SessionManager. 46 * 47 * @param session Session now owned by another SessionManager. 48 */ 49 void notifyOutboundSessionMigration(Session session); 50 51 } 52