Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ImageCache.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.image;
  19. // FOP
  20. import org.apache.fop.apps.FOUserAgent;
  21. /**
  22. * Image cache holder.
  23. * This interface is used for caching images.
  24. */
  25. public interface ImageCache {
  26. /**
  27. * Get an image from the cache.
  28. *
  29. * @param url the url and key for the image
  30. * @param context the user agent context
  31. * @return the requested image
  32. */
  33. FopImage getImage(String url, FOUserAgent context);
  34. /**
  35. * Release an image in the current context.
  36. *
  37. * @param url the url and key for the image
  38. * @param context the user agent context
  39. */
  40. void releaseImage(String url, FOUserAgent context);
  41. /**
  42. * Invalidate image.
  43. * If during loading this image is found to be invalid
  44. * it will be invalidated to prevent further attempts at
  45. * loading the image.
  46. *
  47. * @param url the url and key for the image
  48. * @param context the user agent context
  49. */
  50. void invalidateImage(String url, FOUserAgent context);
  51. /**
  52. * Remove a context and handle all images in the context.
  53. *
  54. * @param context the user agent context
  55. */
  56. void removeContext(FOUserAgent context);
  57. /**
  58. * Forces the cache to fully cleared.
  59. */
  60. void clearAll();
  61. }