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. package javax.imageio.spi;
  8. /**
  9. * An optional interface that may be provided by service provider
  10. * objects that will be registered with a
  11. * <code>ServiceRegistry</code>. If this interface is present,
  12. * notification of registration and deregistration will be performed.
  13. *
  14. * @see ServiceRegistry
  15. *
  16. * @version 0.5
  17. */
  18. public interface RegisterableService {
  19. /**
  20. * Called when an object implementing this interface is added to
  21. * the given <code>category</code> of the given
  22. * <code>registry</code>. The object may already be registered
  23. * under another category or categories.
  24. *
  25. * @param registry a <code>ServiceRegistry</code> where this
  26. * object has been registered.
  27. * @param category a <code>Class</code> object indicating the
  28. * registry category under which this object has been registered.
  29. */
  30. void onRegistration(ServiceRegistry registry, Class<?> category);
  31. /**
  32. * Called when an object implementing this interface is removed
  33. * from the given <code>category</code> of the given
  34. * <code>registry</code>. The object may still be registered
  35. * under another category or categories.
  36. *
  37. * @param registry a <code>ServiceRegistry</code> from which this
  38. * object is being (wholly or partially) deregistered.
  39. * @param category a <code>Class</code> object indicating the
  40. * registry category from which this object is being deregistered.
  41. */
  42. void onDeregistration(ServiceRegistry registry, Class<?> category);
  43. }