KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > Discardable


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.hivemind;
16
17 /**
18  * Implemented by a core service implementationsthat require notification when they are
19  * discarded. This interface is only used by the
20  * {@link org.apache.hivemind.impl.servicemodel.ThreadedServiceModel threaded service model},
21  * which creates a service for a short period, then discards it when notified
22  * by the {@link org.apache.hivemind.service.ThreadEventNotifier}.
23  *
24  * <p>
25  * The service instance will be discarded regardless; this interface allows
26  * the core service implementation to know immediately when this happens,
27  * so that it can release any acquired resources.
28  *
29  * @author Howard Lewis Ship
30  */

31 public interface Discardable
32 {
33     /**
34      * Invoked when a service is being discarded.
35      */

36     public void threadDidDiscardService();
37 }
38
Popular Tags