1 /* 2 * @(#)RegisterableService.java 1.9 04/05/05 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package javax.imageio.spi; 9 10 /** 11 * An optional interface that may be provided by service provider 12 * objects that will be registered with a 13 * <code>ServiceRegistry</code>. If this interface is present, 14 * notification of registration and deregistration will be performed. 15 * 16 * @see ServiceRegistry 17 * 18 * @version 0.5 19 */ 20 public interface RegisterableService { 21 22 /** 23 * Called when an object implementing this interface is added to 24 * the given <code>category</code> of the given 25 * <code>registry</code>. The object may already be registered 26 * under another category or categories. 27 * 28 * @param registry a <code>ServiceRegistry</code> where this 29 * object has been registered. 30 * @param category a <code>Class</code> object indicating the 31 * registry category under which this object has been registered. 32 */ 33 void onRegistration(ServiceRegistry registry, Class<?> category); 34 35 /** 36 * Called when an object implementing this interface is removed 37 * from the given <code>category</code> of the given 38 * <code>registry</code>. The object may still be registered 39 * under another category or categories. 40 * 41 * @param registry a <code>ServiceRegistry</code> from which this 42 * object is being (wholly or partially) deregistered. 43 * @param category a <code>Class</code> object indicating the 44 * registry category from which this object is being deregistered. 45 */ 46 void onDeregistration(ServiceRegistry registry, Class<?> category); 47 } 48