001: /* *************************************************************************
002:
003: Millstone(TM)
004: Open Sourced User Interface Library for
005: Internet Development with Java
006:
007: Millstone is a registered trademark of IT Mill Ltd
008: Copyright (C) 2000-2005 IT Mill Ltd
009:
010: *************************************************************************
011:
012: This library is free software; you can redistribute it and/or
013: modify it under the terms of the GNU Lesser General Public
014: license version 2.1 as published by the Free Software Foundation.
015:
016: This library is distributed in the hope that it will be useful,
017: but WITHOUT ANY WARRANTY; without even the implied warranty of
018: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: Lesser General Public License for more details.
020:
021: You should have received a copy of the GNU Lesser General Public
022: License along with this library; if not, write to the Free Software
023: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:
025: *************************************************************************
026:
027: For more information, contact:
028:
029: IT Mill Ltd phone: +358 2 4802 7180
030: Ruukinkatu 2-4 fax: +358 2 4802 7181
031: 20540, Turku email: info@itmill.com
032: Finland company www: www.itmill.com
033:
034: Primary source for MillStone information and releases: www.millstone.org
035:
036: ********************************************************************** */
037:
038: package org.millstone.base.service;
039:
040: import java.io.File;
041: import java.util.Collection;
042:
043: import org.millstone.base.Application;
044:
045: /** Application context provides information about the running context of
046: * the application. Each context is shared by all applications that are open
047: * for one user. In web-environment this corresponds to HttpSession.
048: *
049: * @author IT Mill Ltd.
050: * @version 3.1.1
051: * @since 3.1
052: */
053: public interface ApplicationContext {
054:
055: /** Returns application context base directory.
056: *
057: * Typically millstone application is deployed in a such way that is
058: * has application directory. For web applications this directory is the
059: * root directory of the web applications. In some cases application
060: * might not have application directory (for example web applications
061: * running inside of war).
062: *
063: * @return The application base directory
064: */
065: public File getBaseDirectory();
066:
067: /** Get the applications in this context.
068: *
069: * Get all applications in this context. Each application context contains
070: * all applications that are open for one user.
071: *
072: * @return Collection containing all applications in this context
073: */
074: public Collection getApplications();
075:
076: /** Add transaction listener to this context.
077: * @param listener The listener to be added.
078: * @see TransactionListener
079: */
080: public void addTransactionListener(TransactionListener listener);
081:
082: /** Remove transaction listener from this context.
083: * @param listener The listener to be removed.
084: * @see TransactionListener
085: */
086: public void removeTransactionListener(TransactionListener listener);
087:
088: /** Interface for listening the application transaction events.
089: * Implementations of this interface can be used to listen all
090: * transactions between the client and the application.
091: *
092: */
093: public interface TransactionListener {
094:
095: /** Invoked at the beginning of every transaction.
096: * @param transactionData Data identifying the transaction.
097: */
098: public void transactionStart(Application application,
099: Object transactionData);
100:
101: /** Invoked at the end of every transaction.
102: * @param transactionData Data identifying the transaction.
103: */
104: public void transactionEnd(Application application,
105: Object transactionData);
106:
107: }
108: }
|