1. /*
  2. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package com.sun.corba.se.spi.orbutil.threadpool;
  6. public interface ThreadPoolManager
  7. {
  8. /**
  9. * This method will return an instance of the threadpool given a threadpoolId,
  10. * that can be used by any component in the app. server.
  11. *
  12. * @throws NoSuchThreadPoolException thrown when invalid threadpoolId is passed
  13. * as a parameter
  14. */
  15. public ThreadPool getThreadPool(String threadpoolId) throws NoSuchThreadPoolException;
  16. /**
  17. * This method will return an instance of the threadpool given a numeric threadpoolId.
  18. * This method will be used by the ORB to support the functionality of
  19. * dedicated threadpool for EJB beans
  20. *
  21. * @throws NoSuchThreadPoolException thrown when invalidnumericIdForThreadpool is passed
  22. * as a parameter
  23. */
  24. public ThreadPool getThreadPool(int numericIdForThreadpool) throws NoSuchThreadPoolException;
  25. /**
  26. * This method is used to return the numeric id of the threadpool, given a String
  27. * threadpoolId. This is used by the POA interceptors to add the numeric threadpool
  28. * Id, as a tagged component in the IOR. This is used to provide the functionality of
  29. * dedicated threadpool for EJB beans
  30. */
  31. public int getThreadPoolNumericId(String threadpoolId);
  32. /**
  33. * Return a String Id for a numericId of a threadpool managed by the threadpool
  34. * manager
  35. */
  36. public String getThreadPoolStringId(int numericIdForThreadpool);
  37. /**
  38. * Returns the first instance of ThreadPool in the ThreadPoolManager
  39. */
  40. public ThreadPool getDefaultThreadPool();
  41. /**
  42. * Return an instance of ThreadPoolChooser based on the componentId that was
  43. * passed as argument
  44. */
  45. public ThreadPoolChooser getThreadPoolChooser(String componentId);
  46. /**
  47. * Return an instance of ThreadPoolChooser based on the componentIndex that was
  48. * passed as argument. This is added for improved performance so that the caller
  49. * does not have to pay the cost of computing hashcode for the componentId
  50. */
  51. public ThreadPoolChooser getThreadPoolChooser(int componentIndex);
  52. /**
  53. * Sets a ThreadPoolChooser for a particular componentId in the ThreadPoolManager. This
  54. * would enable any component to add a ThreadPoolChooser for their specific use
  55. */
  56. public void setThreadPoolChooser(String componentId, ThreadPoolChooser aThreadPoolChooser);
  57. /**
  58. * Gets the numeric index associated with the componentId specified for a
  59. * ThreadPoolChooser. This method would help the component call the more
  60. * efficient implementation i.e. getThreadPoolChooser(int componentIndex)
  61. */
  62. public int getThreadPoolChooserNumericId(String componentId);
  63. }
  64. // End of file.