org.jboss.deployment
Class MainDeployer

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.deployment.MainDeployer
All Implemented Interfaces:
Deployer (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class MainDeployer
extends ServiceMBeanSupport (src)
implements Deployer (src)

The main/primary component for deployment.

MainDeployerMBean is generated by xdoclet.


Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
MainDeployer()
          Explict no-args contsructor for JMX.
 
Method Summary
 void addDeployer(SubDeployer (src)  deployer)
          The addDeployer method registers a deployer with the main deployer.
 void checkIncompleteDeployments()
          Check the current deployment states and generate a IncompleteDeploymentException if there are mbeans waiting for depedencies.
protected  void copy(java.net.URL src, java.io.File dest)
           
protected  void createService()
          The createService method is one of the ServiceMBean lifecyle operations.
 void deploy(DeploymentInfo (src)  deployment)
          The deploy method deploys a package represented by a DeploymentInfo object.
 void deploy(java.lang.String urlspec)
          The deploy method deploys a package identified by a string representation of a URL.
 void deploy(java.net.URL url)
          The deploy method deploys a package identified by a URL
 boolean getCopyFiles()
          Get the flag indicating whether directory content will be deployed
 DeploymentInfo (src) getDeployment(java.net.URL url)
          The getDeployment method returns the DeploymentInfo object for the URL supplied.
 java.lang.String[] getEnhancedSuffixOrder()
          Get the enhanced suffix order
protected  ObjectName (src) getObjectName(MBeanServer (src)  server, ObjectName (src)  name)
          Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
 java.lang.String[] getSuffixOrder()
          Get the ordering of the deployment suffixes
 java.io.File getTempDir()
          Get the temp directory
 java.lang.String getTempDirString()
          Get the temp directory
 java.net.URL getWatchUrl(java.net.URL url)
          The getWatchUrl method returns the URL that, when modified, indicates that a redeploy is needed.
 boolean isDeployed(java.lang.String url)
          The isDeployed method tells you if a package identified by a string representation of a URL is currently deployed.
 boolean isDeployed(java.net.URL url)
          The isDeployed method tells you if a packaged identified by a URL is deployed.
 java.util.Collection listDeployed()
          The listDeployed method returns a collection of DeploymemtInfo objects for the currently deployed packages.
 java.lang.String listDeployedAsString()
          Describe listDeployedAsString method here.
 java.util.Collection listDeployedModules()
          The listDeployedModules method returns a collection of SerializableDeploymentInfo objects for the currently deployed packages.
 java.util.Collection listDeployers()
          The listDeployers method returns a collection of ObjectNames of deployers registered with the MainDeployer.
 java.util.Collection listIncompletelyDeployed()
          The listIncompletelyDeployed method returns a list of packages that have not deployed completely.
 java.util.Collection listWaitingForDeployer()
          The listWaitingForDeployer method returns a collection of the packages that currently have no identified deployer.
 void redeploy(DeploymentInfo (src)  sdi)
          Describe redeploy method here.
 void redeploy(java.lang.String urlspec)
          Describe redeploy method here.
 void redeploy(java.net.URL url)
          Describe redeploy method here.
 void removeDeployer(SubDeployer (src)  deployer)
          The removeDeployer method unregisters a deployer with the MainDeployer.
 void setCopyFiles(boolean copyFiles)
          Set the flag indicating whether directory content will be deployed.
 void setEnhancedSuffixOrder(java.lang.String[] enhancedSuffixOrder)
          Set the enhanced suffix order
 void setServiceController(ObjectName (src)  serviceController)
          Describe setServiceController method here.
 void setTempDir(java.io.File tempDir)
          Set the temp directory
 void shutdown()
          The shutdown method undeploys all deployed packages in reverse order of their deployement.
 void undeploy(DeploymentInfo (src)  di)
          The undeploy method undeploys a package represented by a DeploymentInfo object.
protected  void undeploy(DeploymentInfo (src)  di, boolean isShutdown)
           
 void undeploy(java.lang.String urlspec)
          The undeploy method undeploys a package identified by a string representation of a URL.
 void undeploy(java.net.URL url)
          The undeploy method undeploys a package identified by a URL
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, 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 (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainDeployer

public MainDeployer()
Explict no-args contsructor for JMX.

Method Detail

getCopyFiles

public boolean getCopyFiles()
Get the flag indicating whether directory content will be deployed

Returns:
the file copy flag

setCopyFiles

public void setCopyFiles(boolean copyFiles)
Set the flag indicating whether directory content will be deployed. The default value is taken from the jboss.deploy.localcopy system property.

Parameters:
copyFiles - the local copy flag value

getTempDir

public java.io.File getTempDir()
Get the temp directory

Returns:
the path to the local tmp directory

setTempDir

public void setTempDir(java.io.File tempDir)
Set the temp directory

Parameters:
tempDir - the path to the local tmp directory

getTempDirString

public java.lang.String getTempDirString()
Get the temp directory

Returns:
the path to the local tmp directory

getSuffixOrder

public java.lang.String[] getSuffixOrder()
Get the ordering of the deployment suffixes

Returns:
the ordering of the deployment suffixes

getEnhancedSuffixOrder

public java.lang.String[] getEnhancedSuffixOrder()
Get the enhanced suffix order

Returns:
the enhanced suffix order

setEnhancedSuffixOrder

public void setEnhancedSuffixOrder(java.lang.String[] enhancedSuffixOrder)
Set the enhanced suffix order

Parameters:
enhancedSuffixOrder - the enhanced suffix order

setServiceController

public void setServiceController(ObjectName (src)  serviceController)
Describe setServiceController method here.

Parameters:
serviceController - an ObjectName value

listDeployed

public java.util.Collection listDeployed()
The listDeployed method returns a collection of DeploymemtInfo objects for the currently deployed packages.

Returns:
a Collection value

listDeployedModules

public java.util.Collection listDeployedModules()
The listDeployedModules method returns a collection of SerializableDeploymentInfo objects for the currently deployed packages.

Returns:
a Collection value

listDeployedAsString

public java.lang.String listDeployedAsString()
Describe listDeployedAsString method here.

Returns:
a String value

listIncompletelyDeployed

public java.util.Collection listIncompletelyDeployed()
The listIncompletelyDeployed method returns a list of packages that have not deployed completely. The toString method will include any exception in the status field.

Returns:
a Collection value

listWaitingForDeployer

public java.util.Collection listWaitingForDeployer()
The listWaitingForDeployer method returns a collection of the packages that currently have no identified deployer.

Returns:
a Collection value

addDeployer

public void addDeployer(SubDeployer (src)  deployer)
The addDeployer method registers a deployer with the main deployer. Any waiting packages are tested to see if the new deployer will deploy them.

Parameters:
deployer - a SubDeployer value

removeDeployer

public void removeDeployer(SubDeployer (src)  deployer)
The removeDeployer method unregisters a deployer with the MainDeployer. Deployed packages deployed with this deployer are undeployed.

Parameters:
deployer - a SubDeployer value

listDeployers

public java.util.Collection listDeployers()
The listDeployers method returns a collection of ObjectNames of deployers registered with the MainDeployer.

Returns:
a Collection value

getObjectName

protected ObjectName (src)  getObjectName(MBeanServer (src)  server,
                                   ObjectName (src)  name)
                            throws MalformedObjectNameException (src) 
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration.

Overrides:
getObjectName in class ServiceMBeanSupport (src)
Throws:
MalformedObjectNameException (src)

createService

protected void createService()
                      throws java.lang.Exception
The createService method is one of the ServiceMBean lifecyle operations. (no jmx tag needed from superinterface)

Overrides:
createService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception - if an error occurs

shutdown

public void shutdown()
The shutdown method undeploys all deployed packages in reverse order of their deployement.


redeploy

public void redeploy(java.lang.String urlspec)
              throws DeploymentException (src) ,
                     java.net.MalformedURLException
Describe redeploy method here.

Parameters:
urlspec - a String value
Throws:
DeploymentException (src) - if an error occurs
java.net.MalformedURLException - if an error occurs

redeploy

public void redeploy(java.net.URL url)
              throws DeploymentException (src) 
Describe redeploy method here.

Parameters:
url - an URL value
Throws:
DeploymentException (src) - if an error occurs

redeploy

public void redeploy(DeploymentInfo (src)  sdi)
              throws DeploymentException (src) 
Describe redeploy method here.

Parameters:
sdi - a DeploymentInfo value
Throws:
DeploymentException (src) - if an error occurs

undeploy

public void undeploy(java.net.URL url)
              throws DeploymentException (src) 
The undeploy method undeploys a package identified by a URL

Specified by:
undeploy in interface Deployer (src)
Parameters:
url - an URL value
Throws:
DeploymentException (src) - Failed to undeploy URL.

undeploy

public void undeploy(java.lang.String urlspec)
              throws DeploymentException (src) ,
                     java.net.MalformedURLException
The undeploy method undeploys a package identified by a string representation of a URL.

Parameters:
urlspec - a String value
Throws:
java.net.MalformedURLException - if an error occurs
DeploymentException (src)

undeploy

public void undeploy(DeploymentInfo (src)  di)
The undeploy method undeploys a package represented by a DeploymentInfo object.

Parameters:
di - a DeploymentInfo value

undeploy

protected void undeploy(DeploymentInfo (src)  di,
                        boolean isShutdown)

deploy

public void deploy(java.lang.String urlspec)
            throws DeploymentException (src) ,
                   java.net.MalformedURLException
The deploy method deploys a package identified by a string representation of a URL.

Parameters:
urlspec - a String value
Throws:
java.net.MalformedURLException - if an error occurs
DeploymentException (src)

deploy

public void deploy(java.net.URL url)
            throws DeploymentException (src) 
The deploy method deploys a package identified by a URL

Specified by:
deploy in interface Deployer (src)
Parameters:
url - an URL value
Throws:
DeploymentException (src) - Failed to deploy URL.

deploy

public void deploy(DeploymentInfo (src)  deployment)
            throws DeploymentException (src) 
The deploy method deploys a package represented by a DeploymentInfo object.

Parameters:
deployment - a DeploymentInfo value
Throws:
DeploymentException (src) - if an error occurs

copy

protected void copy(java.net.URL src,
                    java.io.File dest)
             throws java.io.IOException
Throws:
java.io.IOException

isDeployed

public boolean isDeployed(java.lang.String url)
                   throws java.net.MalformedURLException
The isDeployed method tells you if a package identified by a string representation of a URL is currently deployed.

Parameters:
url - a String value
Returns:
a boolean value
Throws:
java.net.MalformedURLException - if an error occurs

isDeployed

public boolean isDeployed(java.net.URL url)
The isDeployed method tells you if a packaged identified by a URL is deployed.

Specified by:
isDeployed in interface Deployer (src)
Parameters:
url - an URL value
Returns:
a boolean value

getDeployment

public DeploymentInfo (src)  getDeployment(java.net.URL url)
The getDeployment method returns the DeploymentInfo object for the URL supplied.

Parameters:
url - an URL value
Returns:
a DeploymentInfo value

getWatchUrl

public java.net.URL getWatchUrl(java.net.URL url)
The getWatchUrl method returns the URL that, when modified, indicates that a redeploy is needed.

Parameters:
url - an URL value
Returns:
a URL value

checkIncompleteDeployments

public void checkIncompleteDeployments()
                                throws DeploymentException (src) 
Check the current deployment states and generate a IncompleteDeploymentException if there are mbeans waiting for depedencies.

Throws:
IncompleteDeploymentException (src)
DeploymentException (src)