org.jboss.deployment
Class SubDeployerInterceptorSupport

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.system.InterceptorServiceMBeanSupport
              extended by org.jboss.deployment.SubDeployerInterceptorSupport
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, SubDeployerInterceptorMBean, InterceptorServiceMBean, Service, ServiceMBean

public abstract class SubDeployerInterceptorSupport
extends InterceptorServiceMBeanSupport
implements SubDeployerInterceptorMBean

Base class that can be used for writing services that dynamically hook to other interceptable deployers in order to add functionality in the deployment cycle. We override attach() to install a different interceptor from that of the base class that understands SubDeployer calls. Note that the baseclass invoke(Invocation) won't be called, so no need to override it. Simply call attach()/detach() from createService()/destroyService() or startService()/stopService() pair methods to attach/detach the interceptor to the configured Interceptable SubDeployer(s). Then override any of the init/create/start/stop/destroy methods to apply the extra interception functionality. Inside those methods don't forget to forward the call using invokeNext().

Version:
$Revision: 1.2.2.5 $
Author:
Dimitris Andreadis

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
SubDeployerInterceptorSupport()
          Constructs an SubDeployerInterceptorSupport.
SubDeployerInterceptorSupport(Class type)
          Constructs an SubDeployerInterceptorSupport.
SubDeployerInterceptorSupport(org.jboss.logging.Logger log)
          Constructs an SubDeployerInterceptorSupport.
SubDeployerInterceptorSupport(String category)
          Constructs an SubDeployerInterceptorSupport.
 
Method Summary
protected  void attach()
          We override attach() from InterceptorServiceMBeanSupport to attach a different interceptor that knows how to switch init/create/start/stop/destroy SubDeployer calls.
protected  Object create(org.jboss.mx.server.Invocation invocation, DeploymentInfo di)
          Override
protected  Object destroy(org.jboss.mx.server.Invocation invocation, DeploymentInfo di)
          Override
protected  Object init(org.jboss.mx.server.Invocation invocation, DeploymentInfo di)
          Override
protected  Object start(org.jboss.mx.server.Invocation invocation, DeploymentInfo di)
          Override
protected  Object stop(org.jboss.mx.server.Invocation invocation, DeploymentInfo di)
          Override
 
Methods inherited from class org.jboss.system.InterceptorServiceMBeanSupport
attach, detach, getInterceptables, invoke, invokeNext, setInterceptables
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.InterceptorServiceMBean
getInterceptables, setInterceptables
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

SubDeployerInterceptorSupport

public SubDeployerInterceptorSupport()
Constructs an SubDeployerInterceptorSupport.


SubDeployerInterceptorSupport

public SubDeployerInterceptorSupport(Class type)
Constructs an SubDeployerInterceptorSupport. Pass-through to InterceptorServiceMBeanSupport.

Parameters:
type - The class type to determine Logger name from.

SubDeployerInterceptorSupport

public SubDeployerInterceptorSupport(String category)
Constructs an SubDeployerInterceptorSupport. Pass-through to InterceptorServiceMBeanSupport.

Parameters:
category - The logger category name.

SubDeployerInterceptorSupport

public SubDeployerInterceptorSupport(org.jboss.logging.Logger log)
Constructs an SubDeployerInterceptorSupport. Pass-through to InterceptorServiceMBeanSupport.

Parameters:
log - The logger to use.
Method Detail

attach

protected void attach()
               throws Exception
We override attach() from InterceptorServiceMBeanSupport to attach a different interceptor that knows how to switch init/create/start/stop/destroy SubDeployer calls.

Overrides:
attach in class InterceptorServiceMBeanSupport
Throws:
Exception - thrown on any interceptor registration error

init

protected Object init(org.jboss.mx.server.Invocation invocation,
                      DeploymentInfo di)
               throws Throwable
Override

Throws:
Throwable

create

protected Object create(org.jboss.mx.server.Invocation invocation,
                        DeploymentInfo di)
                 throws Throwable
Override

Throws:
Throwable

start

protected Object start(org.jboss.mx.server.Invocation invocation,
                       DeploymentInfo di)
                throws Throwable
Override

Throws:
Throwable

stop

protected Object stop(org.jboss.mx.server.Invocation invocation,
                      DeploymentInfo di)
               throws Throwable
Override

Throws:
Throwable

destroy

protected Object destroy(org.jboss.mx.server.Invocation invocation,
                         DeploymentInfo di)
                  throws Throwable
Override

Throws:
Throwable


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.