1 19 20 package org.netbeans.modules.web.monitor.data; 21 22 import org.w3c.dom.*; 23 import org.netbeans.modules.schema2beans.*; 24 import java.beans.*; 25 import java.util.*; 26 27 public class SessionData extends BaseBean { 28 29 static Vector comparators = new Vector(); 30 31 static public final String SESSIONIN = "SessionIn"; static public final String SESSIONOUT = "SessionOut"; 34 public SessionData() { 35 this(Common.USE_DEFAULT_VALUES); 36 } 37 38 public SessionData(int options) { 39 super(SessionData.comparators, new org.netbeans.modules.schema2beans.Version(1, 0, 6)); 40 this.createProperty("SessionIn", SESSIONIN, Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 43 SessionIn.class); 44 this.createAttribute(SESSIONIN, 45 "lastAccessed", "LastAccessed", AttrProp.CDATA | AttrProp.IMPLIED, 48 null, null); 49 this.createAttribute(SESSIONIN, 50 "inactiveInterval", "InactiveInterval", AttrProp.NMTOKEN | AttrProp.IMPLIED, 53 null, null); 54 this.createProperty("SessionOut", SESSIONOUT, Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 56 SessionOut.class); 57 this.createAttribute(SESSIONOUT, 58 "lastAccessed", "LastAccessed", AttrProp.CDATA | AttrProp.IMPLIED, 61 null, null); 62 this.createAttribute(SESSIONOUT, 63 "inactiveInterval", "InactiveInterval", AttrProp.NMTOKEN | AttrProp.IMPLIED, 66 null, null); 67 this.initialize(options); 68 } 69 70 void initialize(int options) { 72 73 } 74 75 public void setSessionIn(SessionIn value) { 77 this.setValue(SESSIONIN, value); 78 } 79 80 public SessionIn getSessionIn() { 82 return (SessionIn)this.getValue(SESSIONIN); 83 } 84 85 public void setSessionOut(SessionOut value) { 87 this.setValue(SESSIONOUT, value); 88 } 89 90 public SessionOut getSessionOut() { 92 return (SessionOut)this.getValue(SESSIONOUT); 93 } 94 95 public boolean verify() { 97 return true; 98 } 99 100 static public void addComparator(BeanComparator c) { 102 SessionData.comparators.add(c); 103 } 104 105 static public void removeComparator(BeanComparator c) { 107 SessionData.comparators.remove(c); 108 } 109 public void addPropertyChangeListener(PropertyChangeListener l) { 111 BeanProp p = this.beanProp(); 112 if (p != null) 113 p.addPCListener(l); 114 } 115 116 public void removePropertyChangeListener(PropertyChangeListener l) { 118 BeanProp p = this.beanProp(); 119 if (p != null) 120 p.removePCListener(l); 121 } 122 123 public void addPropertyChangeListener(String n, PropertyChangeListener l) { 125 BeanProp p = this.beanProp(n); 126 if (p != null) 127 p.addPCListener(l); 128 } 129 130 public void removePropertyChangeListener(String n, 132 PropertyChangeListener l) { 133 BeanProp p = this.beanProp(n); 134 if (p != null) 135 p.removePCListener(l); 136 } 137 138 public void dump(StringBuffer str, String indent) { 140 String s; 141 BaseBean n; 142 str.append(indent); 143 str.append("SessionIn"); n = this.getSessionIn(); 145 if (n != null) 146 n.dump(str, indent + "\t"); else 148 str.append(indent+"\tnull"); this.dumpAttributes(SESSIONIN, 0, str, indent); 150 151 str.append(indent); 152 str.append("SessionOut"); n = this.getSessionOut(); 154 if (n != null) 155 n.dump(str, indent + "\t"); else 157 str.append(indent+"\tnull"); this.dumpAttributes(SESSIONOUT, 0, str, indent); 159 160 } 161 162 public String dumpBeanNode() { 163 StringBuffer str = new StringBuffer (); 164 str.append("SessionData\n"); this.dump(str, "\n "); return str.toString(); 167 } 168 } 169 | Popular Tags |