| 1 |
/* |
| 2 |
* Copyright 1999-2010 University of Chicago |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in |
| 5 |
* compliance with the License. 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 distributed under the License is |
| 10 |
* distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 11 |
* express or implied. |
| 12 |
* |
| 13 |
* See the License for the specific language governing permissions and limitations under the License. |
| 14 |
*/ |
| 15 |
package org.globus.util.deactivator; |
| 16 |
|
| 17 |
import java.util.*; |
| 18 |
|
| 19 |
public class Deactivator { |
| 20 |
|
| 21 |
private static Hashtable modules = new Hashtable(); |
| 22 |
|
| 23 |
public static void deactivateAll() { |
| 24 |
DeactivationHandler handler = null; |
| 25 |
Enumeration e = modules.keys(); |
| 26 |
while(e.hasMoreElements()) { |
| 27 |
handler = (DeactivationHandler)e.nextElement(); |
| 28 |
handler.deactivate(); |
| 29 |
} |
| 30 |
modules.clear(); |
| 31 |
} |
| 32 |
|
| 33 |
public static void registerDeactivation(DeactivationHandler handler) { |
| 34 |
modules.put(handler, ""); |
| 35 |
} |
| 36 |
|
| 37 |
public static void unregisterDeactivation(DeactivationHandler handler) { |
| 38 |
modules.remove(handler); |
| 39 |
} |
| 40 |
|
| 41 |
} |