站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 webservice API Documentation 英文版文档

ServiceDeployer (JBossWS API) - JBoss 4.0.1 sp1 webservice API Documentation 英文版文档


org.jboss.webservice
Class ServiceDeployer

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.webservice.ServiceDeployer
All Implemented Interfaces:
EventListener, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, org.jboss.system.Service, ServiceDeployerMBean, org.jboss.system.ServiceMBean
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
Version:
$Revision: 1.18.2.7 $
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_WEBSERVICE_ID
           
static String WEBSERVICE_CONTEXT_ROOT
           
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(String moduleName, Throwable th)
          Handle all webservice deployment exceptions.
protected  void initWebservice(org.jboss.deployment.DeploymentInfo di)
          Overwrite to initialize the webservice Is called when the parent deployer sends the INIT_NOTIFICATION.
protected  void 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()
          Register this service as NotificationListener to the EJBDeployer, WARDeployer
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 stopService()
          Unregister this service as NotificationListener from the EJBDeployer, WARDeployer
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, 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, 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_WEBSERVICE_ID

public static final String INIT_PARAM_WEBSERVICE_ID
See Also:
Constant Field Values

WEBSERVICE_CONTEXT_ROOT

public static final String WEBSERVICE_CONTEXT_ROOT
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
Register this service as NotificationListener to the EJBDeployer, WARDeployer

Throws:
Exception

stopService

protected void stopService()
Unregister this service as NotificationListener from the EJBDeployer, WARDeployer


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

initWebservice

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

This implementation does nothing

Throws:
org.jboss.deployment.DeploymentException

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


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 void modifyServletConfig(org.dom4j.Document doc,
                                   String servletName,
                                   PortComponentInfo pcInfo)
                            throws org.jboss.deployment.DeploymentException
Modify the servlet-class element

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.