/** * File: BasicStateHandlerBaseImpl.java * Content: Defines an abstract rmi class to implement the BasicStateHandler interface * Author: LuisM Pena * Date: 28th October 2001 * Version: 0.51.00 * Last change: * **/ package sensei.middleware.domains; import java.rmi.server.UnicastRemoteObject; /** * Implementation of the BasicStateHandler RMI interface. **/ public abstract class BasicStateHandlerBaseImpl extends UnicastRemoteObject implements BasicStateHandler { public BasicStateHandlerBaseImpl() throws Exception { thisBasicStateHandler=this; } public BasicStateHandlerBaseImpl(boolean activate) throws Exception { if (!activate) deactivate(); } public void activate() throws Exception { if (thisBasicStateHandler==null) { thisBasicStateHandler=this; exportObject(this); } } public void deactivate() throws Exception { synchronized (this) { if (thisBasicStateHandler!=null) unexportObject(thisBasicStateHandler,true); thisBasicStateHandler=null; } } public final BasicStateHandler theBasicStateHandler() { return thisBasicStateHandler; } protected BasicStateHandler thisBasicStateHandler; };