001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019
020package org.apache.commons.jcs3.engine.behavior;
021
022/**
023 * ShutdownObservers can observe ShutdownObservable objects.
024 * The CacheManager is the primary observable that this is intended for.
025 * <p>
026 * Most shutdown operations will occur outside this framework for now.  The initial
027 * goal is to allow background threads that are not reachable through any reference
028 * that the cache manager maintains to be killed on shutdown.
029 * </p>
030 * <p>
031 * Perhaps the composite cache itself should be the observable object.
032 * It doesn't make much of a difference.  There are some problems with
033 * region by region shutdown.  Some auxiliaries are local.  They will
034 * need to track when every region has shutdown before doing things like
035 * closing the socket with a lateral.
036 * </p>
037 */
038public interface IShutdownObservable
039{
040
041    /**
042     * Registers an observer with the observable object.
043     * @param observer
044     */
045    void registerShutdownObserver( IShutdownObserver observer );
046
047    /**
048     * Deregister the observer with the observable.
049     *
050     * @param observer
051     */
052    void deregisterShutdownObserver( IShutdownObserver observer );
053
054}