1 /* 2 Copyright 2008 Ramon Servadei 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 package fulmine.context; 17 18 import fulmine.ILifeCycle; 19 20 /** 21 * Receives notifications when a fault tolerant context changes state; 22 * transitioning into the active or stand-by state. Implementations should 23 * perform the necessary resource allocation/de-allocation for the FT context 24 * instance transitioning into either of these states. 25 * <p> 26 * A state listener should <b>not</b> make any assumptions that once in the 27 * active state, the context will not go into stand-by; the context may switch 28 * between these states. 29 * 30 * @see FTContext 31 * @author Ramon Servadei 32 */ 33 public interface IFTContextStateListener extends ILifeCycle 34 { 35 36 /** 37 * Called <b>before</b> the fault tolerant context becomes the active 38 * context in the fault tolerant cluster. 39 */ 40 void willActivate(); 41 42 /** 43 * Called <b>after</b> the fault tolerant context becomes the active context 44 * in the fault tolerant cluster. 45 */ 46 void didActivate(); 47 48 /** 49 * Called <b>before</b> the fault tolerant context goes into stand-by mode. 50 */ 51 void willStandby(); 52 53 /** 54 * Called <b>after</b> the fault tolerant context goes into stand-by mode. 55 */ 56 void didStandby(); 57 }