1 23 24 29 30 package com.sun.enterprise.admin.selfmanagement.event; 31 32 33 import javax.management.NotificationEmitter ; 34 import javax.management.monitor.CounterMonitor ; 35 import javax.management.monitor.GaugeMonitor ; 36 import javax.management.monitor.StringMonitor ; 37 import javax.management.monitor.Monitor ; 38 import javax.management.MBeanServer ; 39 import java.util.Hashtable ; 40 import javax.management.ObjectName ; 41 import java.util.logging.Level ; 42 43 import com.sun.enterprise.server.ApplicationServer; 44 import com.sun.enterprise.config.serverbeans.ElementProperty; 45 import java.util.regex.Pattern ; 46 import java.util.regex.Matcher ; 47 import static com.sun.enterprise.admin.selfmanagement.event.ManagementRuleConstants.*; 48 49 55 56 public class MonitorEventFactory extends EventAbstractFactory { 57 58 private MonitorEventFactory( ) { 59 super(); 60 EventBuilder.getInstance().addEventFactory(EVENT_MONITOR, this); 61 } 62 63 64 public Event instrumentEvent( 65 ElementProperty[] properties, String description ) { 66 if( properties == null ){ 67 throw new IllegalArgumentException ( 68 sm.getString("selfmgmt_event.invalid_event_property","null properties","monitor")); 69 } 70 Hashtable <String , String > table = new Hashtable <String ,String >(); 71 for( int i = 0; i < properties.length; i++ ){ 72 table.put( properties[i].getName( ).toLowerCase(), properties[i].getValue()); 73 } 74 75 boolean isMustang = false; 76 boolean isComplexType = false; 77 78 String monitorType = table.get(PROPERTY_MONITOR_TYPE); 79 if (monitorType == null) 80 monitorType = PROPERTY_MONITOR_COUNTER; 81 else 82 monitorType = monitorType.toLowerCase(); 83 84 String observedAttribute = table.get(PROPERTY_MONITOR_OBSERVED_ATTRIBUTE); 85 if (observedAttribute == null) { 86 throw new IllegalArgumentException ( 87 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_OBSERVED_ATTRIBUTE,"monitor")); 88 } 89 90 if (observedAttribute.indexOf('.') != -1) { 91 isComplexType = true; 92 } 93 Float jdkVersion = new Float ( System.getProperty("java.specification.version") ); 94 if( jdkVersion != null ) { 95 if( jdkVersion.floatValue() >= 1.5 ) 96 isMustang = true; 97 } else { 98 Float javaVersion = new Float ( System.getProperty("java.version") ); 99 if( javaVersion.floatValue() >= 1.5 ) 100 isMustang = true; 101 } 102 103 if( isMustang && isComplexType ) { 104 StatisticMonitor monitor = null; 105 if( monitorType.equals(PROPERTY_MONITOR_COUNTER)){ 106 monitor = createCounterStatisticMonitor(table); 107 } else if( monitorType.equals(PROPERTY_MONITOR_GAUGE)){ 108 monitor = createGaugeStatisticMonitor(table); 109 } else if( monitorType.equals(PROPERTY_MONITOR_STRING)) { 110 monitor = createStringStatisticMonitor(table); 111 } 112 if( monitor == null ){ 113 _logger.log(Level.WARNING,"smgt.internal_error"); 114 return null; 115 } 116 try { 117 String sourceMbeanObjName = null; 118 String sourceMbeanName = null; 119 if (table.containsKey(PROPERTY_MONITOR_OBSERVED_OBJ)) { 120 sourceMbeanObjName = table.get(PROPERTY_MONITOR_OBSERVED_OBJ); 121 } else if (table.containsKey(PROPERTY_MONITOR_OBSERVED_OBJ_MBEAN_NAME)) { 122 sourceMbeanName = table.get(PROPERTY_MONITOR_OBSERVED_OBJ_MBEAN_NAME); 123 } 124 if (sourceMbeanName == null && sourceMbeanObjName == null) { 125 throw new IllegalArgumentException ( 126 sm.getString("selfmgmt_event.invalid_event_property","observedobject","monitor")); 127 } 128 String sourceMbean = null; 129 if(sourceMbeanObjName != null) { 130 Pattern pat = Pattern.compile("\\$\\{instance.name\\}"); 132 Matcher m = pat.matcher(sourceMbeanObjName); 133 if(m.find()) { 134 sourceMbean = m.replaceAll(instanceName); 135 } else { 136 sourceMbean = sourceMbeanObjName; 137 } 138 } else if(sourceMbeanName != null) { 139 sourceMbean = ManagementRulesMBeanHelper.getObjName(sourceMbeanName); 140 } 141 144 ObjectName objName = new ObjectName (sourceMbean); 145 monitor.addObservedObject(objName); 147 } catch (Exception ex) { 148 throw new IllegalArgumentException ( 149 sm.getString("selfmgmt_event.invalid_event_property","observedobject","monitor"), ex); 150 } 151 152 monitor.setObservedAttribute(observedAttribute); 153 154 String granularityPeriod = table.get(PROPERTY_MONITOR_GRANULARITY_PERIOD); 155 if (granularityPeriod != null) { 156 try { 157 long gPeriod = Long.parseLong(granularityPeriod); 158 monitor.setGranularityPeriod(gPeriod); 159 } catch (Exception ex) { 160 throw new IllegalArgumentException ( 161 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_GRANULARITY_PERIOD,"monitor"), ex); 162 } 163 } 164 165 ObjectName objName = null; 166 try { 167 table.put("version",getNewVersionString()); 168 Hashtable <String ,String > t = (Hashtable <String ,String >)table.clone(); 169 if(t.containsKey(PROPERTY_MONITOR_OBSERVED_OBJ_MBEAN_NAME)) { 170 t.remove(PROPERTY_MONITOR_OBSERVED_OBJ_MBEAN_NAME); 171 } else if(t.containsKey(PROPERTY_MONITOR_OBSERVED_OBJ)) { 172 t.remove(PROPERTY_MONITOR_OBSERVED_OBJ); 173 } 174 objName = new ObjectName (MonitorEvent.DOMAIN_NAME,t); 175 } catch (Exception ex) { 176 _logger.log(Level.WARNING,"smgt.internal_error", ex); 177 } 178 return new MonitorEvent(monitor,objName,description); 179 180 } else { 181 Monitor monitor = null; 182 if( monitorType.equals(PROPERTY_MONITOR_COUNTER)){ 183 monitor = createCounterMonitor(table); 184 } else if( monitorType.equals(PROPERTY_MONITOR_GAUGE)){ 185 monitor = createGaugeMonitor(table); 186 } else if( monitorType.equals(PROPERTY_MONITOR_STRING)) { 187 monitor = createStringMonitor(table); 188 } 189 if( monitor == null ){ 190 _logger.log(Level.WARNING,"smgt.internal_error"); 191 return null; 192 } 193 try { 194 String sourceMbeanObjName = null; 195 String sourceMbeanName = null; 196 if (table.containsKey(PROPERTY_MONITOR_OBSERVED_OBJ)) { 197 sourceMbeanObjName = table.get(PROPERTY_MONITOR_OBSERVED_OBJ); 198 } else if (table.containsKey(PROPERTY_MONITOR_OBSERVED_OBJ_MBEAN_NAME)) { 199 sourceMbeanName = table.get(PROPERTY_MONITOR_OBSERVED_OBJ_MBEAN_NAME); 200 } 201 if (sourceMbeanName == null && sourceMbeanObjName == null) { 202 throw new IllegalArgumentException ( 203 sm.getString("selfmgmt_event.invalid_event_property","observedobject","monitor")); 204 } 205 String sourceMbean = null; 206 if(sourceMbeanObjName != null) { 207 Pattern pat = Pattern.compile("\\$\\{instance.name\\}"); 209 Matcher m = pat.matcher(sourceMbeanObjName); 210 if(m.find()) { 211 sourceMbean = m.replaceAll(instanceName); 212 } else { 213 sourceMbean = sourceMbeanObjName; 214 } 215 } else if(sourceMbeanName != null) { 216 sourceMbean = ManagementRulesMBeanHelper.getObjName(sourceMbeanName); 217 } 218 221 ObjectName objName = new ObjectName (sourceMbean); 222 monitor.addObservedObject(objName); 224 } catch (Exception ex) { 225 throw new IllegalArgumentException ( 226 sm.getString("selfmgmt_event.invalid_event_property","observedobject","monitor"), ex); 227 } 228 monitor.setObservedAttribute(observedAttribute); 229 String granularityPeriod = table.get(PROPERTY_MONITOR_GRANULARITY_PERIOD); 230 if (granularityPeriod != null) { 231 try { 232 long gPeriod = Long.parseLong(granularityPeriod); 233 monitor.setGranularityPeriod(gPeriod); 234 } catch (Exception ex) { 235 throw new IllegalArgumentException ( 236 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_GRANULARITY_PERIOD,"monitor"), ex); 237 } 238 } 239 240 ObjectName objName = null; 241 try { 242 table.put("version",getNewVersionString()); 243 Hashtable <String ,String > t = (Hashtable <String ,String >)table.clone(); 244 if(t.containsKey(PROPERTY_MONITOR_OBSERVED_OBJ_MBEAN_NAME)) { 245 t.remove(PROPERTY_MONITOR_OBSERVED_OBJ_MBEAN_NAME); 246 } else if(t.containsKey(PROPERTY_MONITOR_OBSERVED_OBJ)) { 247 t.remove(PROPERTY_MONITOR_OBSERVED_OBJ); 248 } 249 objName = new ObjectName (MonitorEvent.DOMAIN_NAME,t); 251 } catch (Exception ex) { 252 _logger.log(Level.WARNING,"smgt.internal_error", ex); 253 } 254 return new MonitorEvent(monitor,objName,description); 255 256 } 257 } 258 259 private Monitor createCounterMonitor(Hashtable <String ,String > table) { 260 CounterMonitor monitor = null; 261 try { 262 monitor = (CounterMonitor )getMBeanServer().instantiate("javax.management.monitor.CounterMonitor"); 263 } catch ( Exception rex) { 264 _logger.log(Level.WARNING,"smgt.internal_error", rex); 265 } 266 String strDiffMode = table.get(PROPERTY_MONITOR_DIFFERENCEMODE); 267 if (strDiffMode != null) { 268 try { 269 boolean diffMode = Boolean.parseBoolean(strDiffMode); 270 monitor.setDifferenceMode(diffMode); 271 } catch (Exception ex) { 272 throw new IllegalArgumentException ( 273 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_DIFFERENCEMODE,"monitor"), ex); 274 } 275 } 276 277 String numberType = table.get(PROPERTY_MONITOR_NUMBERTYPE); 278 if (numberType == null) 279 numberType = "long"; 280 String initTheshold = table.get(PROPERTY_MONITOR_INIT_THRESHOLD); 281 String strOffset = table.get(PROPERTY_MONITOR_OFFSET); 282 String strModulus = table.get(PROPERTY_MONITOR_MODULUS); 283 Number threshold = null; 284 Number offset = null; 285 Number modulus = null; 286 if (initTheshold == null) { 287 throw new IllegalArgumentException ( 288 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_INIT_THRESHOLD,"monitor")); 289 } else { 290 try { 291 if (numberType.equals("long")) { 292 threshold = Long.parseLong(initTheshold); 293 if (strOffset != null) 294 offset = Long.parseLong(strOffset); 295 else 296 offset = 0L; 297 if (strModulus != null) 298 modulus = Long.parseLong(strModulus); 299 else 300 modulus = 0L; 301 } else if (numberType.equals("int")) { 302 threshold = Integer.parseInt(initTheshold); 303 if (strOffset != null) 304 offset = Integer.parseInt(strOffset); 305 else offset = 0; 306 if (strModulus != null) 307 modulus = Integer.parseInt(strModulus); 308 else modulus = 0; 309 } else if (numberType.equals("short")) { 310 threshold = Short.parseShort(initTheshold); 311 if (strOffset != null) 312 offset = Short.parseShort(strOffset); 313 else offset = 0; 314 if (strModulus != null) 315 modulus = Short.parseShort(strModulus); 316 else modulus = 0; 317 } else if (numberType.equals("byte")) { 318 threshold = Byte.parseByte(initTheshold); 319 if (strOffset != null) 320 offset = Byte.parseByte(strOffset); 321 else offset = 0; 322 if (strModulus != null) 323 modulus = Byte.parseByte(strModulus); 324 else modulus = 0; 325 } 326 monitor.setInitThreshold(threshold); 327 if (offset != null) 328 monitor.setOffset(offset); 329 if (modulus != null) 330 monitor.setModulus(modulus); 331 }catch (Exception ex) { 332 throw new IllegalArgumentException ( 333 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_INIT_THRESHOLD,"monitor"),ex); 334 } 335 } 336 if (!monitor.getNotify()) { 337 monitor.setNotify(true); 338 } 339 return monitor; 340 } 341 342 private StatisticMonitor createCounterStatisticMonitor(Hashtable <String ,String > table) { 343 CounterStatisticMonitor monitor = null; 344 try { 345 monitor = (CounterStatisticMonitor)getMBeanServer().instantiate("com.sun.enterprise.admin.selfmanagement.event.CounterStatisticMonitor"); 346 } catch ( Exception rex) { 347 _logger.log(Level.WARNING,"smgt.internal_error", rex); 348 } 349 String strDiffMode = table.get(PROPERTY_MONITOR_DIFFERENCEMODE); 350 if (strDiffMode != null) { 351 try { 352 boolean diffMode = Boolean.parseBoolean(strDiffMode); 353 monitor.setDifferenceMode(diffMode); 354 } catch (Exception ex) { 355 throw new IllegalArgumentException ( 356 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_DIFFERENCEMODE,"monitor"), ex); 357 } 358 } 359 360 String numberType = table.get(PROPERTY_MONITOR_NUMBERTYPE); 361 if (numberType == null) 362 numberType = "long"; 363 String initTheshold = table.get(PROPERTY_MONITOR_INIT_THRESHOLD); 364 String strOffset = table.get(PROPERTY_MONITOR_OFFSET); 365 String strModulus = table.get(PROPERTY_MONITOR_MODULUS); 366 Number threshold = null; 367 Number offset = null; 368 Number modulus = null; 369 if (initTheshold == null) { 370 throw new IllegalArgumentException ( 371 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_INIT_THRESHOLD,"monitor")); 372 } else { 373 try { 374 if (numberType.equals("long")) { 375 threshold = Long.parseLong(initTheshold); 376 if (strOffset != null) 377 offset = Long.parseLong(strOffset); 378 else 379 offset = 0L; 380 if (strModulus != null) 381 modulus = Long.parseLong(strModulus); 382 else 383 modulus = 0L; 384 } else if (numberType.equals("int")) { 385 threshold = Integer.parseInt(initTheshold); 386 if (strOffset != null) 387 offset = Integer.parseInt(strOffset); 388 else offset = 0; 389 if (strModulus != null) 390 modulus = Integer.parseInt(strModulus); 391 else modulus = 0; 392 } else if (numberType.equals("short")) { 393 threshold = Short.parseShort(initTheshold); 394 if (strOffset != null) 395 offset = Short.parseShort(strOffset); 396 else offset = 0; 397 if (strModulus != null) 398 modulus = Short.parseShort(strModulus); 399 else modulus = 0; 400 } else if (numberType.equals("byte")) { 401 threshold = Byte.parseByte(initTheshold); 402 if (strOffset != null) 403 offset = Byte.parseByte(strOffset); 404 else offset = 0; 405 if (strModulus != null) 406 modulus = Byte.parseByte(strModulus); 407 else modulus = 0; 408 } 409 monitor.setInitThreshold(threshold); 410 if (offset != null) 411 monitor.setOffset(offset); 412 if (modulus != null) 413 monitor.setModulus(modulus); 414 }catch (Exception ex) { 415 throw new IllegalArgumentException ( 416 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_INIT_THRESHOLD,"monitor"),ex); 417 } 418 } 419 if (!monitor.getNotify()) { 420 monitor.setNotify(true); 421 } 422 return monitor; 423 } 424 425 private Monitor createGaugeMonitor(Hashtable <String ,String > table) { 426 GaugeMonitor monitor = null; 427 try { 428 monitor = (GaugeMonitor )getMBeanServer().instantiate("javax.management.monitor.GaugeMonitor"); 429 } catch( Exception ex ) { 430 _logger.log(Level.WARNING, "sgmt.internal_error", ex); 431 } 432 433 String strDiffMode = table.get(PROPERTY_MONITOR_DIFFERENCEMODE); 434 if (strDiffMode != null) { 435 try { 436 boolean diffMode = Boolean.parseBoolean(strDiffMode); 437 monitor.setDifferenceMode(diffMode); 438 } catch (Exception ex) { 439 throw new IllegalArgumentException ( 440 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_DIFFERENCEMODE,"monitor"), ex); 441 } 442 } 443 String numberType = table.get(PROPERTY_MONITOR_NUMBERTYPE); 444 if (numberType == null) 445 numberType = "long"; 446 String lowTheshold = table.get(PROPERTY_MONITOR_LOW_THRESHOLD); 447 String highTheshold = table.get(PROPERTY_MONITOR_HIGH_THRESHOLD); 448 if ( (lowTheshold == null) || (highTheshold == null)) { 449 throw new IllegalArgumentException ( 450 sm.getString("selfmgmt_event.invalid_event_property","lowthreshold or highthreshold","monitor")); 451 } 452 Number lThreshold = null; 453 Number hThreshold = null; 454 try { 455 if (numberType.equals("long")) { 456 lThreshold = Long.parseLong(lowTheshold); 457 hThreshold = Long.parseLong(highTheshold); 458 } else if (numberType.equals("int")) { 459 lThreshold = Integer.parseInt(lowTheshold); 460 hThreshold = Integer.parseInt(highTheshold); 461 } else if (numberType.equals("short")) { 462 lThreshold = Short.parseShort(lowTheshold); 463 hThreshold = Short.parseShort(highTheshold); 464 } else if (numberType.equals("double")) { 465 lThreshold = Double.parseDouble(lowTheshold); 466 hThreshold = Double.parseDouble(highTheshold); 467 } else if (numberType.equals("float")) { 468 lThreshold = Float.parseFloat(lowTheshold); 469 hThreshold = Float.parseFloat(highTheshold); 470 } else if (numberType.equals("byte")) { 471 lThreshold = Byte.parseByte(lowTheshold); 472 hThreshold = Byte.parseByte(highTheshold); 473 } 474 monitor.setThresholds(hThreshold, lThreshold); 475 }catch (Exception ex) { 476 throw new IllegalArgumentException ( 477 sm.getString("selfmgmt_event.invalid_event_property","lowthreshold or highthreshold","monitor"),ex); 478 } 479 if (!monitor.getNotifyHigh()) { 480 monitor.setNotifyHigh(true); 481 } 482 if (!monitor.getNotifyLow()) { 483 monitor.setNotifyLow(true); 484 } 485 return monitor; 486 } 487 488 private StatisticMonitor createGaugeStatisticMonitor(Hashtable <String ,String > table) { 489 GaugeStatisticMonitor monitor = null; 490 try { 491 monitor = (GaugeStatisticMonitor)getMBeanServer().instantiate("com.sun.enterprise.admin.selfmanagement.event.GaugeStatisticMonitor"); 492 } catch( Exception ex ) { 493 _logger.log(Level.WARNING, "sgmt.internal_error", ex); 494 } 495 496 String strDiffMode = table.get(PROPERTY_MONITOR_DIFFERENCEMODE); 497 if (strDiffMode != null) { 498 try { 499 boolean diffMode = Boolean.parseBoolean(strDiffMode); 500 monitor.setDifferenceMode(diffMode); 501 } catch (Exception ex) { 502 throw new IllegalArgumentException ( 503 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_DIFFERENCEMODE,"monitor"), ex); 504 } 505 } 506 String numberType = table.get(PROPERTY_MONITOR_NUMBERTYPE); 507 if (numberType == null) 508 numberType = "long"; 509 String lowTheshold = table.get(PROPERTY_MONITOR_LOW_THRESHOLD); 510 String highTheshold = table.get(PROPERTY_MONITOR_HIGH_THRESHOLD); 511 if ( (lowTheshold == null) || (highTheshold == null)) { 512 throw new IllegalArgumentException ( 513 sm.getString("selfmgmt_event.invalid_event_property","lowthreshold or highthreshold","monitor")); 514 } 515 Number lThreshold = null; 516 Number hThreshold = null; 517 try { 518 if (numberType.equals("long")) { 519 lThreshold = Long.parseLong(lowTheshold); 520 hThreshold = Long.parseLong(highTheshold); 521 } else if (numberType.equals("int")) { 522 lThreshold = Integer.parseInt(lowTheshold); 523 hThreshold = Integer.parseInt(highTheshold); 524 } else if (numberType.equals("short")) { 525 lThreshold = Short.parseShort(lowTheshold); 526 hThreshold = Short.parseShort(highTheshold); 527 } else if (numberType.equals("double")) { 528 lThreshold = Double.parseDouble(lowTheshold); 529 hThreshold = Double.parseDouble(highTheshold); 530 } else if (numberType.equals("float")) { 531 lThreshold = Float.parseFloat(lowTheshold); 532 hThreshold = Float.parseFloat(highTheshold); 533 } else if (numberType.equals("byte")) { 534 lThreshold = Byte.parseByte(lowTheshold); 535 hThreshold = Byte.parseByte(highTheshold); 536 } 537 monitor.setThresholds(hThreshold, lThreshold); 538 }catch (Exception ex) { 539 throw new IllegalArgumentException ( 540 sm.getString("selfmgmt_event.invalid_event_property","lowthreshold or highthreshold","monitor"),ex); 541 } 542 if (!monitor.getNotifyHigh()) { 543 monitor.setNotifyHigh(true); 544 } 545 if (!monitor.getNotifyLow()) { 546 monitor.setNotifyLow(true); 547 } 548 return monitor; 549 } 550 551 private Monitor createStringMonitor(Hashtable <String ,String > table) { 552 StringMonitor monitor = null; 553 try { 554 monitor = (StringMonitor )getMBeanServer().instantiate("javax.management.monitor.StringMonitor"); 555 } catch( Exception ex ) { 556 _logger.log(Level.WARNING, "sgmt.internal_error", ex); 557 } 558 559 String strToCompare = table.get(PROPERTY_MONITOR_STRING_TO_COMPARE); 560 String strNotify = table.get(PROPERTY_MONITOR_STRING_NOTIFY); 561 if (strToCompare == null) { 562 throw new IllegalArgumentException ( 563 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_STRING_TO_COMPARE,"monitor")); 564 } 565 monitor.setStringToCompare(strToCompare); 566 if(strNotify == null || strNotify.equals(PROPERTY_MONITOR_STRING_NOTIFY_MATCH)) { monitor.setNotifyMatch(true); 568 return monitor; 569 } else if(strNotify.equals(PROPERTY_MONITOR_STRING_NOTIFY_DIFFER)) 570 monitor.setNotifyDiffer(true); 571 572 return monitor; 573 } 574 575 private StatisticMonitor createStringStatisticMonitor(Hashtable <String ,String > table) { 576 StringStatisticMonitor monitor = null; 577 try { 578 monitor = (StringStatisticMonitor)getMBeanServer().instantiate("com.sun.enterprise.admin.selfmanagement.event.StringStatisticMonitor"); 579 } catch( Exception ex ) { 580 _logger.log(Level.WARNING, "sgmt.internal_error", ex); 581 } 582 583 String strToCompare = table.get(PROPERTY_MONITOR_STRING_TO_COMPARE); 584 String strNotify = table.get(PROPERTY_MONITOR_STRING_NOTIFY); 585 if (strToCompare == null) { 586 throw new IllegalArgumentException ( 587 sm.getString("selfmgmt_event.invalid_event_property",PROPERTY_MONITOR_STRING_TO_COMPARE,"monitor")); 588 } 589 monitor.setStringToCompare(strToCompare); 590 if(strNotify == null || strNotify.equals(PROPERTY_MONITOR_STRING_NOTIFY_MATCH)) { monitor.setNotifyMatch(true); 592 return monitor; 593 } else if(strNotify.equals(PROPERTY_MONITOR_STRING_NOTIFY_DIFFER)) 594 monitor.setNotifyDiffer(true); 595 return monitor; 596 } 597 598 static MonitorEventFactory getInstance() { 599 return instance; 600 } 601 602 603 private synchronized String getNewVersionString() { 604 seqno++; 605 return seqno.toString(); 606 } 607 private static MonitorEventFactory instance = new MonitorEventFactory(); 608 private Long seqno = 0L; 609 private static String instanceName = (ApplicationServer.getServerContext()).getInstanceName(); 610 } 611 | Popular Tags |