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.

ApplicationContext.java 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* *************************************************************************
  2. IT Mill Toolkit
  3. Development of Browser User Intarfaces Made Easy
  4. Copyright (C) 2000-2006 IT Mill Ltd
  5. *************************************************************************
  6. This product is distributed under commercial license that can be found
  7. from the product package on license/license.txt. Use of this product might
  8. require purchasing a commercial license from IT Mill Ltd. For guidelines
  9. on usage, see license/licensing-guidelines.html
  10. *************************************************************************
  11. For more information, contact:
  12. IT Mill Ltd phone: +358 2 4802 7180
  13. Ruukinkatu 2-4 fax: +358 2 4802 7181
  14. 20540, Turku email: info@itmill.com
  15. Finland company www: www.itmill.com
  16. Primary source for information and releases: www.itmill.com
  17. ********************************************************************** */
  18. package com.itmill.toolkit.service;
  19. import java.io.File;
  20. import java.util.Collection;
  21. import com.itmill.toolkit.Application;
  22. /** Application context provides information about the running context of
  23. * the application. Each context is shared by all applications that are open
  24. * for one user. In web-environment this corresponds to HttpSession.
  25. *
  26. * @author IT Mill Ltd.
  27. * @version @VERSION@
  28. * @since 3.1
  29. */
  30. public interface ApplicationContext {
  31. /** Returns application context base directory.
  32. *
  33. * Typically an application is deployed in a such way that is
  34. * has application directory. For web applications this directory is the
  35. * root directory of the web applications. In some cases application
  36. * might not have application directory (for example web applications
  37. * running inside of war).
  38. *
  39. * @return The application base directory
  40. */
  41. public File getBaseDirectory();
  42. /** Get the applications in this context.
  43. *
  44. * Get all applications in this context. Each application context contains
  45. * all applications that are open for one user.
  46. *
  47. * @return Collection containing all applications in this context
  48. */
  49. public Collection getApplications();
  50. /** Add transaction listener to this context.
  51. * @param listener The listener to be added.
  52. * @see TransactionListener
  53. */
  54. public void addTransactionListener(TransactionListener listener);
  55. /** Remove transaction listener from this context.
  56. * @param listener The listener to be removed.
  57. * @see TransactionListener
  58. */
  59. public void removeTransactionListener(TransactionListener listener);
  60. /** Interface for listening the application transaction events.
  61. * Implementations of this interface can be used to listen all
  62. * transactions between the client and the application.
  63. *
  64. */
  65. public interface TransactionListener {
  66. /** Invoked at the beginning of every transaction.
  67. * @param transactionData Data identifying the transaction.
  68. */
  69. public void transactionStart(Application application, Object transactionData);
  70. /** Invoked at the end of every transaction.
  71. * @param transactionData Data identifying the transaction.
  72. */
  73. public void transactionEnd(Application application, Object transactionData);
  74. }
  75. }