org.jboss.webservice
Class ServiceDeployer

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.webservice.ServiceDeployer
All Implemented Interfaces:
EventListener, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, org.jboss.system.Service, org.jboss.system.ServiceMBean, ServiceDeployerMBean
Direct Known Subclasses:
ServiceDeployerEJB, ServiceDeployerJSE

public abstract class ServiceDeployer
extends org.jboss.system.ServiceMBeanSupport
implements ServiceDeployerMBean, javax.management.NotificationListener

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

Since:
15-April-2004
Author:
Thomas.Diesler@jboss.org, Scott.Stark@jboss.org

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

Field Detail

INIT_PARAM_SERVICE_ENDPOINT_ID

public static final String INIT_PARAM_SERVICE_ENDPOINT_ID
See Also:
Constant Field Values

INIT_PARAM_SERVICE_ENDPOINT_IMPL

public static final String INIT_PARAM_SERVICE_ENDPOINT_IMPL
See Also:
Constant Field Values

webservicesMap

protected Map webservicesMap
Maps the deployment url the the WebservicesMetaData

Constructor Detail

ServiceDeployer

public ServiceDeployer()
Method Detail

startService

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

Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

handleNotification

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

Specified by:
handleNotification in interface javax.management.NotificationListener
Parameters:
notification - the notification object
handback - the handback object given to the broadcaster upon listener registration

createWebservice

protected void createWebservice(org.jboss.deployment.DeploymentInfo di)
                         throws org.jboss.deployment.DeploymentException
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:
org.jboss.deployment.DeploymentException

getWebservicesDescriptor

protected abstract URL getWebservicesDescriptor(org.jboss.deployment.DeploymentInfo di)
Get the resource name of the webservices.xml descriptor.


startWebservice

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

This implementation deployes the webservices to Axis.

Throws:
org.jboss.deployment.DeploymentException

stopWebservice

protected void stopWebservice(org.jboss.deployment.DeploymentInfo 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(org.jboss.deployment.DeploymentInfo di)
Overwrite to destroy the webservice This method is called when the parent deployer sends the DESTROY_NOTIFICATION.


handleStartupException

protected void handleStartupException(org.jboss.deployment.DeploymentInfo di,
                                      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(String moduleName,
                                       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(javax.management.ObjectName serviceName)
                                     throws javax.management.InstanceNotFoundException
Register the notification listener

Throws:
javax.management.InstanceNotFoundException

unregisterNotificationListener

protected void unregisterNotificationListener(javax.management.ObjectName serviceName)
Unregister the notification listener


parseWebservicesXML

protected WebservicesMetaData parseWebservicesXML(org.jboss.deployment.DeploymentInfo di,
                                                  URL webservicesURL)
                                           throws org.jboss.deployment.DeploymentException
Unmarshal the webservices.xml

Throws:
org.jboss.deployment.DeploymentException

deployWebservices

protected void deployWebservices(org.jboss.deployment.DeploymentInfo di,
                                 WebservicesMetaData webservices)
                          throws org.jboss.deployment.DeploymentException
Deploy the webservices using the AxisService MBean

Throws:
org.jboss.deployment.DeploymentException

undeployWebservices

protected void undeployWebservices(org.jboss.deployment.DeploymentInfo di,
                                   WebservicesMetaData webservices)
Undeploy the webservices using the AxisService MBean


modifyServletConfig

protected boolean modifyServletConfig(org.dom4j.Document doc,
                                      String servletName,
                                      PortComponentInfo pcInfo)
                               throws org.jboss.deployment.DeploymentException
Modify the servlet-class element

Throws:
org.jboss.deployment.DeploymentException

initTransportGuarantee

protected void initTransportGuarantee(org.dom4j.Document doc,
                                      String servletName,
                                      PortComponentInfo pcInfo)
                               throws org.jboss.deployment.DeploymentException
Throws:
org.jboss.deployment.DeploymentException

getServiceEndpointServletName

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



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