View Javadoc

1   /*
2    * Jour - java profiler and monitoring library
3    *
4    * Copyright (C) 2004 Jour team
5    *
6    * This library is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Library General Public
8    * License as published by the Free Software Foundation; either
9    * version 2 of the License, or (at your option) any later version.
10   *
11   * This library is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   * Library General Public License for more details.
15   *
16   * You should have received a copy of the GNU Library General Public
17   * License along with this library; if not, write to the
18   * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19   * Boston, MA  02111-1307, USA.
20   */
21  package net.sf.jour.rt.agent;
22  
23  /***
24   * @author Misha TODO To change the template for this generated type comment go
25   *         to Window - Preferences - Java - Code Style - Code Templates
26   */
27  public class InstanceCounterEvent implements Event {
28      /***   DOCUMENT ME!   */
29      private boolean isConstructed;
30  
31      /***   DOCUMENT ME!   */
32      private Class instanceClass;
33  
34      /***
35       * Creates a new InstanceCounterEvent object.
36       *
37       * @param instanceClass DOCUMENT ME!
38       * @param isConstructed DOCUMENT ME!
39       */
40      public InstanceCounterEvent(Class instanceClass, boolean isConstructed) {
41          this.instanceClass = instanceClass;
42          this.isConstructed = isConstructed;
43      }
44  
45      /***
46       * DOCUMENT ME!
47       *
48       * @return DOCUMENT ME!
49       */
50      public boolean isInstanceConstructed() {
51          return isConstructed;
52      }
53  
54      /***
55       * DOCUMENT ME!
56       *
57       * @return DOCUMENT ME!
58       */
59      public Class getInstanceClass() {
60          return instanceClass;
61      }
62  
63      /***
64       * DOCUMENT ME!
65       *
66       * @return DOCUMENT ME!
67       */
68      public String toString() {
69          return (new StringBuffer(instanceClass.toString()).append(isConstructed
70              ? " is constructed" : " is destroyed")).toString();
71      }
72  }