1/*
2 * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package javax.imageio.spi;
27
28/**
29 * An optional interface that may be provided by service provider
30 * objects that will be registered with a
31 * {@code ServiceRegistry}.  If this interface is present,
32 * notification of registration and deregistration will be performed.
33 *
34 * @see ServiceRegistry
35 *
36 */
37public interface RegisterableService {
38
39    /**
40     * Called when an object implementing this interface is added to
41     * the given {@code category} of the given
42     * {@code registry}.  The object may already be registered
43     * under another category or categories.
44     *
45     * @param registry a {@code ServiceRegistry} where this
46     * object has been registered.
47     * @param category a {@code Class} object indicating the
48     * registry category under which this object has been registered.
49     */
50    void onRegistration(ServiceRegistry registry, Class<?> category);
51
52    /**
53     * Called when an object implementing this interface is removed
54     * from the given {@code category} of the given
55     * {@code registry}.  The object may still be registered
56     * under another category or categories.
57     *
58     * @param registry a {@code ServiceRegistry} from which this
59     * object is being (wholly or partially) deregistered.
60     * @param category a {@code Class} object indicating the
61     * registry category from which this object is being deregistered.
62     */
63    void onDeregistration(ServiceRegistry registry, Class<?> category);
64}
65