You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ScopedClassPoolRepository.java 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Javassist, a Java-bytecode translator toolkit.
  3. * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. Alternatively, the contents of this file may be used under
  8. * the terms of the GNU Lesser General Public License Version 2.1 or later,
  9. * or the Apache License Version 2.0.
  10. *
  11. * Software distributed under the License is distributed on an "AS IS" basis,
  12. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. * for the specific language governing rights and limitations under the
  14. * License.
  15. */
  16. package javassist.scopedpool;
  17. import java.util.Map;
  18. import javassist.ClassPool;
  19. /**
  20. * An interface to <code>ScopedClassPoolRepositoryImpl</code>.
  21. *
  22. * @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
  23. * @version $Revision: 1.4 $
  24. */
  25. public interface ScopedClassPoolRepository {
  26. /**
  27. * Records a factory.
  28. */
  29. void setClassPoolFactory(ScopedClassPoolFactory factory);
  30. /**
  31. * Obtains the recorded factory.
  32. */
  33. ScopedClassPoolFactory getClassPoolFactory();
  34. /**
  35. * Returns whether or not the class pool is pruned.
  36. *
  37. * @return the prune.
  38. */
  39. boolean isPrune();
  40. /**
  41. * Sets the prune flag.
  42. *
  43. * @param prune a new value.
  44. */
  45. void setPrune(boolean prune);
  46. /**
  47. * Create a scoped classpool.
  48. *
  49. * @param cl the classloader.
  50. * @param src the original classpool.
  51. * @return the classpool.
  52. */
  53. ScopedClassPool createScopedClassPool(ClassLoader cl, ClassPool src);
  54. /**
  55. * Finds a scoped classpool registered under the passed in classloader.
  56. *
  57. * @param cl the classloader.
  58. * @return the classpool.
  59. */
  60. ClassPool findClassPool(ClassLoader cl);
  61. /**
  62. * Register a classloader.
  63. *
  64. * @param ucl the classloader.
  65. * @return the classpool.
  66. */
  67. ClassPool registerClassLoader(ClassLoader ucl);
  68. /**
  69. * Get the registered classloaders.
  70. *
  71. * @return the registered classloaders.
  72. */
  73. Map<ClassLoader,ScopedClassPool> getRegisteredCLs();
  74. /**
  75. * This method will check to see if a register classloader has been
  76. * undeployed (as in JBoss).
  77. */
  78. void clearUnregisteredClassLoaders();
  79. /**
  80. * Unregisters a classpool and unregisters its classloader.
  81. *
  82. * @param cl the classloader the pool is stored under.
  83. */
  84. void unregisterClassLoader(ClassLoader cl);
  85. }