org.jboss.deployment
Class MainDeployer

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.deployment.MainDeployer
All Implemented Interfaces:
Deployer, DeployerMBean, MainDeployerConstants, MainDeployerMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, Service, ServiceMBean

public class MainDeployer
extends ServiceMBeanSupport
implements Deployer, MainDeployerMBean

The main/primary component for deployment.

MainDeployerMBean is generated by xdoclet.

Version:
$Revision: 1.43.2.23 $
Author:
Marc Fleury, Scott Stark, David Jencks

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.deployment.MainDeployerMBean
OBJECT_NAME
 
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
 
Fields inherited from interface org.jboss.deployment.MainDeployerConstants
ADD_DEPLOYER, REMOVE_DEPLOYER
 
Constructor Summary
MainDeployer()
          Explict no-args contsructor for JMX.
 
Method Summary
 void addDeployer(SubDeployer 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(URL src, File dest)
           
protected  void createService()
          The createService method is one of the ServiceMBean lifecyle operations.
 void deploy(DeploymentInfo deployment)
          The deploy method deploys a package represented by a DeploymentInfo object.
 void deploy(String urlspec)
          The deploy method deploys a package identified by a string representation of a URL.
 void deploy(URL url)
          The deploy method deploys a package identified by a URL
 DeploymentInfo getDeployment(URL url)
          The getDeployment method returns the DeploymentInfo object for the URL supplied.
protected  javax.management.ObjectName getObjectName(javax.management.MBeanServer server, javax.management.ObjectName name)
          Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
 URL getWatchUrl(URL url)
          The getWatchUrl method returns the URL that, when modified, indicates that a redeploy is needed.
 boolean isDeployed(String url)
          The isDeployed method tells you if a package identified by a string representation of a URL is currently deployed.
 boolean isDeployed(URL url)
          The isDeployed method tells you if a packaged identified by a URL is deployed.
 Collection listDeployed()
          The listDeployed method returns a collection of DeploymemtInfo objects for the currently deployed packages.
 String listDeployedAsString()
          Describe listDeployedAsString method here.
 Collection listDeployers()
          The listDeployers method returns a collection of ObjectNames of deployers registered with the MainDeployer.
 Collection listIncompletelyDeployed()
          The listIncompletelyDeployed method returns a list of packages that have not deployed completely.
 Collection listWaitingForDeployer()
          The listWaitingForDeployer method returns a collection of the packages that currently have no identified deployer.
 void redeploy(DeploymentInfo sdi)
          Describe redeploy method here.
 void redeploy(String urlspec)
          Describe redeploy method here.
 void redeploy(URL url)
          Describe redeploy method here.
 void removeDeployer(SubDeployer deployer)
          The removeDeployer method unregisters a deployer with the MainDeployer.
 void setServiceController(javax.management.ObjectName serviceController)
          Describe setServiceController method here.
 void shutdown()
          The shutdown method undeploys all deployed packages in reverse order of their deployement.
 void undeploy(DeploymentInfo di)
          The undeploy method undeploys a package represented by a DeploymentInfo object.
protected  void undeploy(DeploymentInfo di, boolean isShutdown)
           
 void undeploy(String urlspec)
          The undeploy method undeploys a package identified by a string representation of a URL.
 void undeploy(URL url)
          The undeploy method undeploys a package identified by a URL
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
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
addNotificationListener, getNotificationInfo, handleNotification, 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.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

MainDeployer

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

Method Detail

setServiceController

public void setServiceController(javax.management.ObjectName serviceController)
Describe setServiceController method here.

Specified by:
setServiceController in interface MainDeployerMBean
Parameters:
serviceController - an ObjectName value

listDeployed

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

Specified by:
listDeployed in interface MainDeployerMBean
Returns:
a Collection value

listDeployedAsString

public String listDeployedAsString()
Describe listDeployedAsString method here.

Specified by:
listDeployedAsString in interface MainDeployerMBean
Returns:
a String value

listIncompletelyDeployed

public 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.

Specified by:
listIncompletelyDeployed in interface MainDeployerMBean
Returns:
a Collection value

listWaitingForDeployer

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

Specified by:
listWaitingForDeployer in interface MainDeployerMBean
Returns:
a Collection value

addDeployer

public void addDeployer(SubDeployer 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.

Specified by:
addDeployer in interface MainDeployerMBean
Parameters:
deployer - a SubDeployer value

removeDeployer

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

Specified by:
removeDeployer in interface MainDeployerMBean
Parameters:
deployer - a SubDeployer value

listDeployers

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

Specified by:
listDeployers in interface MainDeployerMBean
Returns:
a Collection value

getObjectName

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

Overrides:
getObjectName in class ServiceMBeanSupport
Throws:
javax.management.MalformedObjectNameException

createService

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

Overrides:
createService in class ServiceMBeanSupport
Throws:
Exception - if an error occurs

shutdown

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

Specified by:
shutdown in interface MainDeployerMBean

redeploy

public void redeploy(String urlspec)
              throws DeploymentException,
                     MalformedURLException
Describe redeploy method here.

Specified by:
redeploy in interface MainDeployerMBean
Throws:
DeploymentException - if an error occurs
MalformedURLException - if an error occurs

redeploy

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

Specified by:
redeploy in interface MainDeployerMBean
Parameters:
url - an URL value
Throws:
DeploymentException - if an error occurs

redeploy

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

Specified by:
redeploy in interface MainDeployerMBean
Parameters:
sdi - a DeploymentInfo value
Throws:
DeploymentException - if an error occurs

undeploy

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

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

undeploy

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

Specified by:
undeploy in interface MainDeployerMBean
Parameters:
urlspec - a String value
Throws:
MalformedURLException - if an error occurs
DeploymentException

undeploy

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

Specified by:
undeploy in interface MainDeployerMBean
Parameters:
di - a DeploymentInfo value

undeploy

protected void undeploy(DeploymentInfo di,
                        boolean isShutdown)

deploy

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

Specified by:
deploy in interface MainDeployerMBean
Parameters:
urlspec - a String value
Throws:
MalformedURLException - if an error occurs
DeploymentException

deploy

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

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

deploy

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

Specified by:
deploy in interface MainDeployerMBean
Parameters:
deployment - a DeploymentInfo value
Throws:
DeploymentException - if an error occurs

copy

protected void copy(URL src,
                    File dest)
             throws IOException
Throws:
IOException

isDeployed

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

Specified by:
isDeployed in interface MainDeployerMBean
Parameters:
url - a String value
Returns:
a boolean value
Throws:
MalformedURLException - if an error occurs

isDeployed

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

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

getDeployment

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

Specified by:
getDeployment in interface MainDeployerMBean
Parameters:
url - an URL value
Returns:
a DeploymentInfo value

getWatchUrl

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

Specified by:
getWatchUrl in interface MainDeployerMBean
Parameters:
url - an URL value
Returns:
a URL value

checkIncompleteDeployments

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

Specified by:
checkIncompleteDeployments in interface MainDeployerMBean
Throws:
IncompleteDeploymentException
DeploymentException


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