Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ApplicationContext.java 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  3. */
  4. package com.itmill.toolkit.service;
  5. import java.io.File;
  6. import java.util.Collection;
  7. import com.itmill.toolkit.Application;
  8. /**
  9. * <code>ApplicationContext</code> provides information about the running
  10. * context of the application. Each context is shared by all applications that
  11. * are open for one user. In web-environment this corresponds to HttpSession.
  12. *
  13. * @author IT Mill Ltd.
  14. * @version
  15. * @VERSION@
  16. * @since 3.1
  17. */
  18. public interface ApplicationContext {
  19. /**
  20. * Returns application context base directory.
  21. *
  22. * Typically an application is deployed in a such way that is has
  23. * application directory. For web applications this directory is the root
  24. * directory of the web applications. In some cases application might not
  25. * have application directory (for example web applications running inside
  26. * of war).
  27. *
  28. * @return The application base directory
  29. */
  30. public File getBaseDirectory();
  31. /**
  32. * Gets the applications in this context.
  33. *
  34. * Gets all applications in this context. Each application context contains
  35. * all applications that are open for one user.
  36. *
  37. * @return Collection containing all applications in this context
  38. */
  39. public Collection getApplications();
  40. /**
  41. * Adds transaction listener to this context.
  42. *
  43. * @param listener
  44. * the listener to be added.
  45. * @see TransactionListener
  46. */
  47. public void addTransactionListener(TransactionListener listener);
  48. /**
  49. * Removes transaction listener from this context.
  50. *
  51. * @param listener
  52. * the listener to be removed.
  53. * @see TransactionListener
  54. */
  55. public void removeTransactionListener(TransactionListener listener);
  56. /**
  57. * Interface for listening the application transaction events.
  58. * Implementations of this interface can be used to listen all transactions
  59. * between the client and the application.
  60. *
  61. */
  62. public interface TransactionListener {
  63. /**
  64. * Invoked at the beginning of every transaction.
  65. *
  66. * @param application
  67. * the Application object.
  68. * @param transactionData
  69. * the Data identifying the transaction.
  70. */
  71. public void transactionStart(Application application,
  72. Object transactionData);
  73. /**
  74. * Invoked at the end of every transaction.
  75. *
  76. * @param applcation
  77. * the Application object.
  78. * @param transactionData
  79. * the Data identifying the transaction.
  80. */
  81. public void transactionEnd(Application application,
  82. Object transactionData);
  83. }
  84. }