Home » JBoss-5.1.0 » org » jboss » deployment » [javadoc | source]
org.jboss.deployment
abstract public class: SubDeployerSupport [javadoc | source]
java.lang.Object
   org.jboss.mx.util.JBossNotificationBroadcasterSupport
      org.jboss.system.ServiceMBeanSupport
         org.jboss.deployment.SubDeployerSupport

All Implemented Interfaces:
    SubDeployerExtMBean, SubDeployerExt, KernelControllerContextAware, ServiceMBean, MBeanRegistration, NotificationEmitter

An abstract SubDeployer . Provides registration with MainDeployer as well as implementations of init, create, start, stop and destroy that generate JMX notifications on completion of the method.
Nested Class Summary:
protected static class  SubDeployerSupport.ClassConfiguration  Static configuration properties for this class. Allows easy access to change defaults with system properties. 
Field Summary
protected static final  String nativeSuffix    Holds the native library suffix for this system. Determined by examining the result of System.mapLibraryName(specialToken). The special token defaults to "XxX", but can be changed by setting the system property: org.jboss.deployment.SubDeployerSupport.nativeLibToken
protected static final  String nativePrefix    Holds the native library prefix for this system. 
protected  MainDeployerMBean mainDeployer    A proxy to the MainDeployer. 
protected  File tempDeployDir    The temporary directory into which deployments are unpacked 
protected  String[] enhancedSuffixes    The list of enhancedSuffixes for this subdeployer 
protected  String[] suffixes    The suffixes of interest to this subdeployer 
protected  int relativeOrder    The relative order of this subdeployer - not really used 
protected static final  ClassConfiguration CONFIGURATION    The singleton class configuration object for this class. 
Fields inherited from org.jboss.system.ServiceMBeanSupport:
SERVICE_CONTROLLER_SIG,  log,  server,  serviceName
Method from org.jboss.deployment.SubDeployerSupport Summary:
accepts,   addDeployableFiles,   addDeployableJar,   create,   createService,   deployUrl,   destroy,   destroyService,   emitNotification,   getEnhancedSuffixes,   getRelativeOrder,   getSuffixes,   init,   isDeployable,   processNestedDeployments,   setEnhancedSuffixes,   setRelativeOrder,   setSuffixes,   start,   startService,   stop,   stopService
Methods from org.jboss.system.ServiceMBeanSupport:
create,   createService,   destroy,   destroyService,   getDeploymentInfo,   getLog,   getName,   getNextNotificationSequenceNumber,   getObjectName,   getServer,   getServiceName,   getState,   getStateString,   jbossInternalCreate,   jbossInternalDescription,   jbossInternalDestroy,   jbossInternalLifecycle,   jbossInternalStart,   jbossInternalStop,   pojoChange,   pojoCreate,   pojoDestroy,   pojoStart,   pojoStop,   postDeregister,   postRegister,   preDeregister,   preRegister,   setKernelControllerContext,   start,   startService,   stop,   stopService,   unsetKernelControllerContext
Methods from org.jboss.mx.util.JBossNotificationBroadcasterSupport:
addNotificationListener,   getNotificationInfo,   handleNotification,   nextNotificationSequenceNumber,   removeNotificationListener,   removeNotificationListener,   sendNotification
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.deployment.SubDeployerSupport Detail:
 public boolean accepts(DeploymentInfo sdi) 
    A default implementation that uses the suffixes registered through either setSuffixes() or setEnhancedSuffixes(), to decide if a module is deployable by this deployer. If (according to DeploymentInfo) the deployment refers to a directory, but not an xml or script deployment, then the deployment suffix will be checked also against the registered suffixes + "/".
 protected  void addDeployableFiles(DeploymentInfo di,
    File dir) throws DeploymentException 
    This method recursively searches the directory structure for any files that are deployable (@see isDeployable). If a directory is found to be deployable, then its subfiles and subdirectories are not searched.
 protected  void addDeployableJar(DeploymentInfo di,
    JarFile jarFile) throws DeploymentException 
    This method searches the entire jar file for any deployable files (@see isDeployable).
 public  void create(DeploymentInfo di) throws DeploymentException 
    Sub-classes should override this method to provide custom 'create' logic. This method issues a JMX notification of type SubDeployer.CREATE_NOTIFICATION.
 protected  void createService() throws Exception 
    The createService method is one of the ServiceMBean lifecyle operations. (no jmx tag needed from superinterface)
 protected  void deployUrl(DeploymentInfo di,
    URL url,
    String name) throws DeploymentException 
 public  void destroy(DeploymentInfo di) throws DeploymentException 
    Sub-classes should override this method to provide custom 'destroy' logic. This method issues a JMX notification of type SubDeployer.DESTROY_NOTIFICATION.
 protected  void destroyService() throws Exception 
    Clean up.
 protected  void emitNotification(String type,
    DeploymentInfo di) 
    Simple helper to emit a subdeployer notification containing DeploymentInfo
 public String[] getEnhancedSuffixes() 
    Get an array of enhancedSuffixes
 public int getRelativeOrder() 
    Get the relative order of the specified suffixes
 public String[] getSuffixes() 
    Get an array of suffixes of interest to this subdeployer
 public  void init(DeploymentInfo di) throws DeploymentException 
    Sub-classes should override this method to provide custom 'init' logic.

    This method calls the processNestedDeployments(di) method and then issues a JMX notification of type SubDeployer.INIT_NOTIFICATION. This behaviour can overridden by concrete sub-classes. If further initialization needs to be done, and you wish to preserve the functionality, be sure to call super.init(di) at the end of your implementation.

 protected boolean isDeployable(String name,
    URL url) 
    This method returns true if the name is a recognized archive file. It will query the MainDeployer that keeps a dynamically updated list of known archive extensions.
 protected  void processNestedDeployments(DeploymentInfo di) throws DeploymentException 
    The processNestedDeployments method searches for any nested and deployable elements. Only Directories and Zipped archives are processed, and those are delegated to the addDeployableFiles and addDeployableJar methods respectively. This method can be overridden for alternate behaviour.
 public  void setEnhancedSuffixes(String[] enhancedSuffixes) 
    Set the enhanced suffixes list for this deployer, causing also the supported suffixes list to be updated. Each enhanced suffix entries has the form: [order:]suffix No need to register twice suffixes that may refer to unpacked deployments (e.g. .sar, .sar/).
 protected  void setRelativeOrder(int relativeOrder) 
    Set the relative order of the specified suffixes all to the same value.
 protected  void setSuffixes(String[] suffixes) 
    Set an array of suffixes of interest to this subdeployer. No need to register twice suffixes that may refer to unpacked deployments (e.g. .sar, .sar/).
 public  void start(DeploymentInfo di) throws DeploymentException 
    Sub-classes should override this method to provide custom 'start' logic. This method issues a JMX notification of type SubDeployer.START_NOTIFICATION.
 protected  void startService() throws Exception 
    Performs SubDeployer registration.
 public  void stop(DeploymentInfo di) throws DeploymentException 
    Sub-classes should override this method to provide custom 'stop' logic. This method issues a JMX notification of type SubDeployer.START_NOTIFICATION.
 protected  void stopService() throws Exception 
    Performs SubDeployer deregistration.