|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport org.jboss.deployment.SubDeployerSupport
public abstract class SubDeployerSupport
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. |
Field Summary | |
---|---|
protected static SubDeployerSupport.ClassConfiguration |
CONFIGURATION
The singleton class configuration object for this class. |
protected String[] |
enhancedSuffixes
The list of enhancedSuffixes for this subdeployer |
protected MainDeployerMBean |
mainDeployer
A proxy to the MainDeployer. |
protected static String |
nativePrefix
Holds the native library prefix for this system. |
protected static String |
nativeSuffix
Holds the native library suffix for this system. |
protected int |
relativeOrder
The relative order of this subdeployer - not really used |
protected String[] |
suffixes
The suffixes of interest to this subdeployer |
protected File |
tempDeployDir
The temporary directory into which deployments are unpacked |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.deployment.SubDeployer |
---|
CREATE_NOTIFICATION, DESTROY_NOTIFICATION, INIT_NOTIFICATION, RELATIVE_ORDER_100, RELATIVE_ORDER_200, RELATIVE_ORDER_300, RELATIVE_ORDER_400, RELATIVE_ORDER_500, RELATIVE_ORDER_600, RELATIVE_ORDER_700, RELATIVE_ORDER_800, RELATIVE_ORDER_900, START_NOTIFICATION, STOP_NOTIFICATION |
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 | |
---|---|
SubDeployerSupport()
|
Method Summary | |
---|---|
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. |
protected void |
addDeployableFiles(DeploymentInfo di,
File dir)
This method recursively searches the directory structure for any files that are deployable (@see isDeployable). |
protected void |
addDeployableJar(DeploymentInfo di,
JarFile jarFile)
This method searches the entire jar file for any deployable files (@see isDeployable). |
void |
create(DeploymentInfo di)
Sub-classes should override this method to provide custom 'create' logic. |
protected void |
createService()
The createService method is one of the ServiceMBean lifecyle operations. |
protected void |
deployUrl(DeploymentInfo di,
URL url,
String name)
|
void |
destroy(DeploymentInfo di)
Sub-classes should override this method to provide custom 'destroy' logic. |
protected void |
destroyService()
Clean up. |
protected void |
emitNotification(String type,
DeploymentInfo di)
Simple helper to emit a subdeployer notification containing DeploymentInfo |
String[] |
getEnhancedSuffixes()
Get an array of enhancedSuffixes |
int |
getRelativeOrder()
Get the relative order of the specified suffixes |
String[] |
getSuffixes()
Get an array of suffixes of interest to this subdeployer |
void |
init(DeploymentInfo di)
Sub-classes should override this method to provide custom 'init' logic. |
protected boolean |
isDeployable(String name,
URL url)
This method returns true if the name is a recognized archive file. |
protected void |
processNestedDeployments(DeploymentInfo di)
The processNestedDeployments method searches for any nested and
deployable elements. |
void |
setEnhancedSuffixes(String[] enhancedSuffixes)
Set the enhanced suffixes list for this deployer, causing also the supported suffixes list to be updated. |
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. |
void |
start(DeploymentInfo di)
Sub-classes should override this method to provide custom 'start' logic. |
protected void |
startService()
Performs SubDeployer registration. |
void |
stop(DeploymentInfo di)
Sub-classes should override this method to provide custom 'stop' logic. |
protected void |
stopService()
Performs SubDeployer deregistration. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
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.deployment.SubDeployer |
---|
getServiceName |
Methods inherited from interface org.jboss.deployment.SubDeployerMBean |
---|
getServiceName |
Methods inherited from interface org.jboss.system.ServiceMBean |
---|
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
---|
create, destroy, start, stop |
Field Detail |
---|
protected static final String nativeSuffix
protected static final String nativePrefix
nativeSuffix
protected MainDeployerMBean mainDeployer
protected File tempDeployDir
protected String[] enhancedSuffixes
protected String[] suffixes
protected int relativeOrder
protected static final SubDeployerSupport.ClassConfiguration CONFIGURATION
Constructor Detail |
---|
public SubDeployerSupport()
Method Detail |
---|
protected void createService() throws Exception
createService
method is one of the ServiceMBean lifecyle operations.
(no jmx tag needed from superinterface)
createService
in class ServiceMBeanSupport
Exception
- if an error occursprotected void startService() throws Exception
startService
in class ServiceMBeanSupport
Exception
protected void stopService() throws Exception
stopService
in class ServiceMBeanSupport
Exception
protected void destroyService() throws Exception
destroyService
in class ServiceMBeanSupport
Exception
protected void setSuffixes(String[] suffixes)
suffixes
- array of suffix stringsprotected void setRelativeOrder(int relativeOrder)
relativeOrder
- the relative order of the specified suffixespublic void setEnhancedSuffixes(String[] enhancedSuffixes)
setEnhancedSuffixes
in interface SubDeployerExt
setEnhancedSuffixes
in interface SubDeployerExtMBean
enhancedSuffixes
- public String[] getEnhancedSuffixes()
getEnhancedSuffixes
in interface SubDeployerExt
getEnhancedSuffixes
in interface SubDeployerExtMBean
public String[] getSuffixes()
getSuffixes
in interface SubDeployer
getSuffixes
in interface SubDeployerMBean
public int getRelativeOrder()
getRelativeOrder
in interface SubDeployer
getRelativeOrder
in interface SubDeployerMBean
public boolean accepts(DeploymentInfo sdi)
accepts
in interface SubDeployer
accepts
in interface SubDeployerMBean
sdi
- the DeploymentInfo to check
public void init(DeploymentInfo di) throws DeploymentException
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.
init
in interface SubDeployer
init
in interface SubDeployerMBean
di
- a DeploymentInfo
value
DeploymentException
- if an error occurspublic void create(DeploymentInfo di) throws DeploymentException
create
in interface SubDeployer
create
in interface SubDeployerMBean
di
- a DeploymentInfo
value
DeploymentException
- if an error occurspublic void start(DeploymentInfo di) throws DeploymentException
start
in interface SubDeployer
start
in interface SubDeployerMBean
di
- a DeploymentInfo
value
DeploymentException
- if an error occurspublic void stop(DeploymentInfo di) throws DeploymentException
stop
in interface SubDeployer
stop
in interface SubDeployerMBean
di
- a DeploymentInfo
value
DeploymentException
- if an error occurspublic void destroy(DeploymentInfo di) throws DeploymentException
destroy
in interface SubDeployer
destroy
in interface SubDeployerMBean
di
- a DeploymentInfo
value
DeploymentException
- if an error occursprotected void emitNotification(String type, DeploymentInfo di)
protected void processNestedDeployments(DeploymentInfo di) throws DeploymentException
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.
DeploymentException
protected boolean isDeployable(String name, URL url)
name
- The "short-name" of the URL. It will have any trailing '/'
characters removed, and any directory structure has been removed.url
- The full url.
protected void addDeployableFiles(DeploymentInfo di, File dir) throws DeploymentException
di
- the DeploymentInfodir
- The root directory to start searching.
DeploymentException
protected void addDeployableJar(DeploymentInfo di, JarFile jarFile) throws DeploymentException
di
- the DeploymentInfojarFile
- the jar file to process.
DeploymentException
protected void deployUrl(DeploymentInfo di, URL url, String name) throws DeploymentException
DeploymentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |