370 371 372 /* 373 * ------------------------------------------ 374 * PUBLIC METHODS 375 * ------------------------------------------ 376 */ 377 378 /** 379 * Allows the monitor MBean to perform any operations it needs 380 * before being registered in the MBean server. 381 * <P> 382 * Initializes the reference to the MBean server. 383 * 384 * @param server The MBean server in which the monitor MBean will 385 * be registered. 386 * @param name The object name of the monitor MBean. 387 * 388 * @return The name of the monitor MBean registered. 389 * 390 * @exception Exception 391 */ 392 public ObjectName preRegister(MBeanServer server, ObjectName name) 393 throws Exception { 394 395 MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(), 396 "preRegister(MBeanServer, ObjectName)", 397 "initialize the reference on the MBean server"); 398 399 this.server = server; 400 return name; 401 } 402 403 /** 404 * Allows the monitor MBean to perform any operations needed after 405 * having been registered in the MBean server or after the 406 * registration has failed. 407 * <P> 408 * Not used in this context. 409 */ 410 public void postRegister(Boolean registrationDone) { 411 } 412 413 /** 414 * Allows the monitor MBean to perform any operations it needs 415 * before being unregistered by the MBean server. 416 * <P> 417 * Stops the monitor. 418 * 419 * @exception Exception 420 */ 421 public void preDeregister() throws Exception { 422 423 MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(), 424 "preDeregister()", "stop the monitor"); 425 426 // Stop the Monitor. 427 // 428 stop(); 429 } 430 431 /** 432 * Allows the monitor MBean to perform any operations needed after 433 * having been unregistered by the MBean server. 434 * <P> 435 * Not used in this context. 436 */ 437 public void postDeregister() { 438 } 439 | 370 371 372 /* 373 * ------------------------------------------ 374 * PUBLIC METHODS 375 * ------------------------------------------ 376 */ 377 378 /** 379 * Allows the monitor MBean to perform any operations it needs 380 * before being registered in the MBean server. 381 * <P> 382 * Initializes the reference to the MBean server. 383 * 384 * @param server The MBean server in which the monitor MBean will 385 * be registered. 386 * @param name The object name of the monitor MBean. 387 * 388 * @return The name of the monitor MBean registered. 389 * 390 * @exception Exception if something goes wrong 391 */ 392 public ObjectName preRegister(MBeanServer server, ObjectName name) 393 throws Exception { 394 395 MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(), 396 "preRegister(MBeanServer, ObjectName)", 397 "initialize the reference on the MBean server"); 398 399 this.server = server; 400 return name; 401 } 402 403 /** 404 * Allows the monitor MBean to perform any operations needed after 405 * having been registered in the MBean server or after the 406 * registration has failed. 407 * <P> 408 * Not used in this context. 409 */ 410 public void postRegister(Boolean registrationDone) { 411 } 412 413 /** 414 * Allows the monitor MBean to perform any operations it needs 415 * before being unregistered by the MBean server. 416 * <P> 417 * Stops the monitor. 418 * 419 * @exception Exception if something goes wrong 420 */ 421 public void preDeregister() throws Exception { 422 423 MONITOR_LOGGER.logp(Level.FINER, Monitor.class.getName(), 424 "preDeregister()", "stop the monitor"); 425 426 // Stop the Monitor. 427 // 428 stop(); 429 } 430 431 /** 432 * Allows the monitor MBean to perform any operations needed after 433 * having been unregistered by the MBean server. 434 * <P> 435 * Not used in this context. 436 */ 437 public void postDeregister() { 438 } 439 |