org.jboss.webservice
Class ServiceDeployer

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.webservice.ServiceDeployer
All Implemented Interfaces:
java.util.EventListener, MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , NotificationListener (src) , Service (src) , ServiceMBean (src)
Direct Known Subclasses:
ServiceDeployerEJB (src) , ServiceDeployerJSE (src)

public abstract class ServiceDeployer
extends ServiceMBeanSupport (src)
implements NotificationListener (src)

A deployer service that manages WS4EE compliant Web-Services within JMX by translating/delegating to an axis deployer.

This service receives deployment notifications from the EJBDeployer and AbstractWebContainer and deploys the webservices using the AxisService (src)

Since:
15-April-2004

Nested Class Summary
 class ServiceDeployer.ServiceLocationResolver (src)
          This guy resolves the service location, when ask to do so
 
Field Summary
static java.lang.String INIT_PARAM_SERVICE_ENDPOINT_IMPL
           
static java.lang.String INIT_PARAM_WEBSERVICE_ID
           
static java.lang.String WEBSERVICE_CONTEXT_ROOT
           
protected  java.util.Map webservicesMap
          Maps the deployment url the the WebservicesMetaData
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
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
ServiceDeployer()
           
 
Method Summary
protected  void createWebservice(DeploymentInfo (src)  di)
          Overwrite to create the webservice Is called when the parent deployer sends the CREATE_NOTIFICATION.
protected  void deployWebservices(DeploymentInfo (src)  di, WebservicesMetaData (src)  webservices)
          Deploy the webservices using the AxisService MBean
protected  void destroyWebservice(DeploymentInfo (src)  di)
          Overwrite to destroy the webservice This method is called when the parent deployer sends the DESTROY_NOTIFICATION.
protected abstract  java.lang.String getServiceEndpointServletName()
          Override to return the name of the service endpoint servlet
protected abstract  java.net.URL getWebservicesDescriptor(DeploymentInfo (src)  di)
          Get the resource name of the webservices.xml descriptor.
 void handleNotification(Notification (src)  notification, java.lang.Object handback)
          Callback method from the broadcaster MBean this listener implementation is registered to.
protected  void handleShutdownException(java.lang.String moduleName, java.lang.Throwable th)
          Handle all webservice deployment exceptions.
protected  void handleStartupException(DeploymentInfo (src)  di, java.lang.Throwable th)
          Handle all webservice deployment exceptions.
protected  void initWebservice(DeploymentInfo (src)  di)
          Overwrite to initialize the webservice Is called when the parent deployer sends the INIT_NOTIFICATION.
protected  boolean modifyServletConfig(Document doc, java.lang.String servletName, PortComponentInfo (src)  pcInfo)
          Modify the servlet-class element
protected  WebservicesMetaData (src) parseWebservicesXML(DeploymentInfo (src)  di, java.net.URL webservicesURL)
          Unmarshal the webservices.xml
protected  void registerNotificationListener(ObjectName (src)  serviceName)
          Register the notification listener
protected  void startService()
          Get a proxy to AxisService
protected  void startWebservice(DeploymentInfo (src)  di)
          Overwrite to start the webservice Is called when the parent deployer sends the START_NOTIFICATION.
protected  void stopWebservice(DeploymentInfo (src)  di)
          Overwrite to stop the webservice Is called when the parent deployer sends the STOP_NOTIFICATION.
protected  void undeployWebservices(DeploymentInfo (src)  di, WebservicesMetaData (src)  webservices)
          Undeploy the webservices using the AxisService MBean
protected  void unregisterNotificationListener(ObjectName (src)  serviceName)
          Unregister the notification listener
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, 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
 

Field Detail

INIT_PARAM_WEBSERVICE_ID

public static final java.lang.String INIT_PARAM_WEBSERVICE_ID
See Also:
Constant Field Values (src)

INIT_PARAM_SERVICE_ENDPOINT_IMPL

public static final java.lang.String INIT_PARAM_SERVICE_ENDPOINT_IMPL
See Also:
Constant Field Values (src)

WEBSERVICE_CONTEXT_ROOT

public static final java.lang.String WEBSERVICE_CONTEXT_ROOT
See Also:
Constant Field Values (src)

webservicesMap

protected java.util.Map webservicesMap
Maps the deployment url the the WebservicesMetaData

Constructor Detail

ServiceDeployer

public ServiceDeployer()
Method Detail

startService

protected void startService()
                     throws java.lang.Exception
Get a proxy to AxisService

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

handleNotification

public void handleNotification(Notification (src)  notification,
                               java.lang.Object handback)
Callback method from the broadcaster MBean this listener implementation is registered to.

Specified by:
handleNotification in interface NotificationListener (src)
Parameters:
notification - the notification object
handback - the handback object given to the broadcaster upon listener registration

initWebservice

protected void initWebservice(DeploymentInfo (src)  di)
                       throws DeploymentException (src) 
Overwrite to initialize the webservice Is called when the parent deployer sends the INIT_NOTIFICATION.

This implementation does nothing

Throws:
DeploymentException (src)

createWebservice

protected void createWebservice(DeploymentInfo (src)  di)
                         throws DeploymentException (src) 
Overwrite to create the webservice Is called when the parent deployer sends the CREATE_NOTIFICATION.

This implementation parses webservices.xml and puts it in the local registry.

Throws:
DeploymentException (src)

getWebservicesDescriptor

protected abstract java.net.URL getWebservicesDescriptor(DeploymentInfo (src)  di)
Get the resource name of the webservices.xml descriptor.


startWebservice

protected void startWebservice(DeploymentInfo (src)  di)
                        throws DeploymentException (src) 
Overwrite to start the webservice Is called when the parent deployer sends the START_NOTIFICATION.

This implementation deployes the webservices to Axis.

Throws:
DeploymentException (src)

stopWebservice

protected void stopWebservice(DeploymentInfo (src)  di)
Overwrite to stop the webservice Is called when the parent deployer sends the STOP_NOTIFICATION.

This implementation undeployes the webservices to Axis and removes the webservices.xml from the local registry.


destroyWebservice

protected void destroyWebservice(DeploymentInfo (src)  di)
Overwrite to destroy the webservice This method is called when the parent deployer sends the DESTROY_NOTIFICATION.


handleStartupException

protected void handleStartupException(DeploymentInfo (src)  di,
                                      java.lang.Throwable th)
Handle all webservice deployment exceptions.

You can either simply logs the problem and keep the EJB/WAR module alive or undeploy properly.


handleShutdownException

protected void handleShutdownException(java.lang.String moduleName,
                                       java.lang.Throwable th)
Handle all webservice deployment exceptions.

You can either simply logs the problem and keep the EJB/WAR module alive or undeploy properly.


registerNotificationListener

protected void registerNotificationListener(ObjectName (src)  serviceName)
                                     throws InstanceNotFoundException (src) 
Register the notification listener

Throws:
InstanceNotFoundException (src)

unregisterNotificationListener

protected void unregisterNotificationListener(ObjectName (src)  serviceName)
Unregister the notification listener


parseWebservicesXML

protected WebservicesMetaData (src)  parseWebservicesXML(DeploymentInfo (src)  di,
                                                  java.net.URL webservicesURL)
                                           throws DeploymentException (src) 
Unmarshal the webservices.xml

Throws:
DeploymentException (src)

deployWebservices

protected void deployWebservices(DeploymentInfo (src)  di,
                                 WebservicesMetaData (src)  webservices)
                          throws DeploymentException (src) 
Deploy the webservices using the AxisService MBean

Throws:
DeploymentException (src)

undeployWebservices

protected void undeployWebservices(DeploymentInfo (src)  di,
                                   WebservicesMetaData (src)  webservices)
Undeploy the webservices using the AxisService MBean


modifyServletConfig

protected boolean modifyServletConfig(Document doc,
                                      java.lang.String servletName,
                                      PortComponentInfo (src)  pcInfo)
                               throws DeploymentException (src) 
Modify the servlet-class element

Throws:
DeploymentException (src)

getServiceEndpointServletName

protected abstract java.lang.String getServiceEndpointServletName()
Override to return the name of the service endpoint servlet