Path: blob/master/src/java.desktop/share/classes/javax/imageio/spi/RegisterableService.java
51476 views
/*1* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.imageio.spi;2627/**28* An optional interface that may be provided by service provider29* objects that will be registered with a30* {@code ServiceRegistry}. If this interface is present,31* notification of registration and deregistration will be performed.32*33* @see ServiceRegistry34*35*/36public interface RegisterableService {3738/**39* Called when an object implementing this interface is added to40* the given {@code category} of the given41* {@code registry}. The object may already be registered42* under another category or categories.43*44* @param registry a {@code ServiceRegistry} where this45* object has been registered.46* @param category a {@code Class} object indicating the47* registry category under which this object has been registered.48*/49void onRegistration(ServiceRegistry registry, Class<?> category);5051/**52* Called when an object implementing this interface is removed53* from the given {@code category} of the given54* {@code registry}. The object may still be registered55* under another category or categories.56*57* @param registry a {@code ServiceRegistry} from which this58* object is being (wholly or partially) deregistered.59* @param category a {@code Class} object indicating the60* registry category from which this object is being deregistered.61*/62void onDeregistration(ServiceRegistry registry, Class<?> category);63}646566