1 22 package org.jboss.aop.deployers; 23 24 import java.io.File ; 25 26 import javax.management.JMException ; 27 import javax.management.ListenerNotFoundException ; 28 import javax.management.MBeanNotificationInfo ; 29 import javax.management.MBeanServer ; 30 import javax.management.Notification ; 31 import javax.management.NotificationFilter ; 32 import javax.management.NotificationListener ; 33 import javax.management.ObjectName ; 34 35 import org.jboss.aop.AspectManager; 36 import org.jboss.aop.deployment.AspectManagerService; 37 import org.jboss.aop.deployment.AspectManagerServiceJDK5; 38 import org.jboss.deployment.DeploymentInfo; 39 import org.jboss.logging.Logger; 40 41 46 public abstract class AbstractAspectManager 47 { 48 final static String BASE_ASPECTS_XML = "base-aspects.xml"; 49 AspectManagerService delegate = null; MBeanServer server; 51 52 public void setMbeanServer(MBeanServer server) 53 { 54 this.server = server; 55 } 56 57 public MBeanServer getMbeanServer() 58 { 59 return server; 60 } 61 62 public AspectManager getAspectManager() 63 { 64 return AspectManager.getTopLevelAspectManager(); 65 } 66 67 73 public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) 74 { 75 delegate.addNotificationListener(listener, filter, handback); 76 } 77 78 82 public String aspectDefinitions() 83 { 84 return delegate.aspectDefinitions(); 85 } 86 87 91 public void attachClass(String classname) 92 { 93 delegate.attachClass(classname); 94 } 95 96 100 public String bindings() 101 { 102 return delegate.bindings(); 103 } 104 105 109 public void create() throws Exception 110 { 111 delegate.create(); 112 } 113 114 118 public void destroy() 119 { 120 delegate.destroy(); 121 } 122 123 128 public boolean equals(Object obj) 129 { 130 return delegate.equals(obj); 131 } 132 133 138 public DeploymentInfo getDeploymentInfo() throws JMException 139 { 140 return delegate.getDeploymentInfo(); 141 } 142 143 147 public boolean getEnableLoadtimeWeaving() 148 { 149 return delegate.getEnableLoadtimeWeaving(); 150 } 151 152 156 public boolean getEnableTransformer() 157 { 158 return delegate.getEnableTransformer(); 159 } 160 161 165 public String getExclude() 166 { 167 return delegate.getExclude(); 168 } 169 170 174 public String getIgnore() 175 { 176 return delegate.getIgnore(); 177 } 178 179 183 public String getInclude() 184 { 185 return delegate.getInclude(); 186 } 187 188 192 public String getInstrumentor() 193 { 194 return delegate.getInstrumentor(); 195 } 196 197 201 public Logger getLog() 202 { 203 return delegate.getLog(); 204 } 205 206 210 public String getName() 211 { 212 return delegate.getName(); 213 } 214 215 219 public MBeanNotificationInfo [] getNotificationInfo() 220 { 221 return delegate.getNotificationInfo(); 222 } 223 224 228 public boolean getOptimized() 229 { 230 return delegate.getOptimized(); 231 } 232 233 237 public boolean getPrune() 238 { 239 return delegate.getPrune(); 240 } 241 242 246 public MBeanServer getServer() 247 { 248 return delegate.getServer(); 249 } 250 251 255 public ObjectName getServiceName() 256 { 257 return delegate.getServiceName(); 258 } 259 260 264 public int getState() 265 { 266 return delegate.getState(); 267 } 268 269 273 public String getStateString() 274 { 275 return delegate.getStateString(); 276 } 277 278 282 public boolean getSuppressReferenceErrors() 283 { 284 return delegate.getSuppressReferenceErrors(); 285 } 286 287 291 public boolean getSuppressTransformationErrors() 292 { 293 return delegate.getSuppressTransformationErrors(); 294 } 295 296 300 public File getTmpClassesDir() 301 { 302 return delegate.getTmpClassesDir(); 303 } 304 305 309 public boolean getVerbose() 310 { 311 return delegate.getVerbose(); 312 } 313 314 320 public void handleNotification(NotificationListener listener, Notification notification, Object handback) 321 { 322 delegate.handleNotification(listener, notification, handback); 323 } 324 325 329 public int hashCode() 330 { 331 return delegate.hashCode(); 332 } 333 334 338 public String interceptorFactories() 339 { 340 return delegate.interceptorFactories(); 341 } 342 343 347 public String introductions() 348 { 349 return delegate.introductions(); 350 } 351 352 357 public void jbossInternalLifecycle(String method) throws Exception 358 { 359 delegate.jbossInternalLifecycle(method); 360 } 361 362 366 public long nextNotificationSequenceNumber() 367 { 368 return delegate.nextNotificationSequenceNumber(); 369 } 370 371 375 public void postDeregister() 376 { 377 delegate.postDeregister(); 378 } 379 380 384 public void postRegister(Boolean registrationDone) 385 { 386 delegate.postRegister(registrationDone); 387 } 388 389 393 public void preDeregister() throws Exception 394 { 395 delegate.preDeregister(); 396 } 397 398 405 public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception 406 { 407 return delegate.preRegister(server, name); 408 } 409 410 414 public String registeredClassLoaders() 415 { 416 return delegate.registeredClassLoaders(); 417 } 418 419 426 public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException 427 { 428 delegate.removeNotificationListener(listener, filter, handback); 429 } 430 431 436 public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException 437 { 438 delegate.removeNotificationListener(listener); 439 } 440 441 445 public void sendNotification(Notification notification) 446 { 447 delegate.sendNotification(notification); 448 } 449 450 454 public void setEnableLoadtimeWeaving(boolean enableTransformer) 455 { 456 delegate.setEnableLoadtimeWeaving(enableTransformer); 457 } 458 459 463 public void setEnableTransformer(boolean enableTransformer) 464 { 465 delegate.setEnableTransformer(enableTransformer); 466 } 467 468 472 public void setExclude(String exclude) 473 { 474 delegate.setExclude(exclude); 475 } 476 477 481 public void setIgnore(String ignore) 482 { 483 delegate.setIgnore(ignore); 484 } 485 486 490 public void setInclude(String include) 491 { 492 delegate.setInclude(include); 493 } 494 495 499 public void setInstrumentor(String instrumentor) 500 { 501 delegate.setInstrumentor(instrumentor); 502 } 503 504 508 public void setOptimized(boolean verbose) 509 { 510 delegate.setOptimized(verbose); 511 } 512 513 517 public void setPrune(boolean prune) 518 { 519 delegate.setPrune(prune); 520 } 521 522 526 public void setSuppressReferenceErrors(boolean suppressReferenceErrors) 527 { 528 delegate.setSuppressReferenceErrors(suppressReferenceErrors); 529 } 530 531 535 public void setSuppressTransformationErrors(boolean suppressTransformationErrors) 536 { 537 delegate.setSuppressTransformationErrors(suppressTransformationErrors); 538 } 539 540 544 public void setTmpClassesDir(File tmpClassesDir) 545 { 546 delegate.setTmpClassesDir(tmpClassesDir); 547 } 548 549 553 public void setVerbose(boolean verbose) 554 { 555 delegate.setVerbose(verbose); 556 } 557 558 562 public String stacks() 563 { 564 return delegate.stacks(); 565 } 566 567 571 public void start() throws Exception 572 { 573 try 574 { 575 server.registerMBean(delegate, new ObjectName ("jboss.aop:service=AspectManager")); 576 } 577 catch (Exception e) 578 { 579 throw new RuntimeException ("Problem registering jboss.aop:service=AspectManager with JMXServer", e); 580 } 581 delegate.start(); 582 } 583 584 588 public void stop() 589 { 590 if (this.server == null) 591 { 592 try 593 { 594 server.unregisterMBean(new ObjectName ("jboss.aop:service=AspectManager")); 595 } 596 catch (Exception e) 597 { 598 throw new RuntimeException ("Problem unregistering jboss.aop:service=AspectManager with JMXServer", e); 600 } 601 } 602 delegate.stop(); 603 } 604 605 609 public String toString() 610 { 611 return delegate.toString(); 612 } 613 614 615 } 616 | Popular Tags |