001// Copyright 2004, 2005 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007//     http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014
015package org.apache.tapestry.engine;
016
017/**
018 * Basic support for application monitoring and metrics. This interface defines events; the
019 * implementation decides what to do with them (such as record them to a database).
020 * 
021 * @author Howard Lewis Ship
022 * @deprecated To be removed in 4.1 with no direct replacement.
023 */
024
025public interface IMonitor
026{
027    /**
028     * Invoked before constructing a page.
029     */
030
031    public void pageCreateBegin(String pageName);
032
033    /**
034     * Invoked after successfully constructing a page and all of its components.
035     */
036
037    public void pageCreateEnd(String pageName);
038
039    /**
040     * Invoked when a page is loaded. This includes time to locate or create an instance of the page
041     * and rollback its state (to any previously recorded value).
042     */
043
044    public void pageLoadBegin(String pageName);
045
046    /**
047     * Invoked once a page is completely loaded and rolled back to its prior state.
048     */
049
050    public void pageLoadEnd(String pageName);
051
052    /**
053     * Invoked before a page render begins.
054     */
055
056    public void pageRenderBegin(String pageName);
057
058    /**
059     * Invoked after a page has succesfully rendered.
060     */
061
062    public void pageRenderEnd(String pageName);
063
064    /**
065     * Invoked before a page rewind (to respond to an action) begins.
066     */
067
068    public void pageRewindBegin(String pageName);
069
070    /**
071     * Invoked after a page has succesfully been rewound (which includes any activity related to the
072     * action listener).
073     */
074
075    public void pageRewindEnd(String pageName);
076
077    /**
078     * Invoked when a service begins processing.
079     */
080
081    public void serviceBegin(String serviceName, String detailMessage);
082
083    /**
084     * Invoked when a service successfully ends.
085     */
086
087    public void serviceEnd(String serviceName);
088
089    /**
090     * Invoked when a service throws an exception rather than completing normally. Processing of the
091     * request may continue with the display of an exception page.
092     * <p>
093     * serviceException() is always invoked <em>before</em> {@link #serviceEnd(String)}.
094     */
095
096    public void serviceException(Throwable exception);
097
098    /**
099     * Invoked when a session is initiated. This is typically done from the implementation of the
100     * home service.
101     */
102
103    public void sessionBegin();
104}