@Override
  protected void startListeningForService(AxisService service) throws AxisFault {
    E endpoint = createEndpoint(service);
    endpoint.setListener(this);
    endpoint.setService(service);
    endpoint.setContentType(
        ParamUtils.getRequiredParam(service, "transport." + getTransportName() + ".contentType"));
    endpoint.setMetrics(metrics);

    try {
      dispatcher.addEndpoint(endpoint);
    } catch (IOException ex) {
      throw new AxisFault(
          "Unable to listen on endpoint " + endpoint.getEndpointReference(defaultIp), ex);
    }
    if (log.isDebugEnabled()) {
      log.debug(
          "Started listening on endpoint "
              + endpoint.getEndpointReference(defaultIp)
              + " [contentType="
              + endpoint.getContentType()
              + "; service="
              + service.getName()
              + "]");
    }
    endpoints.put(service.getName(), endpoint);
  }
 @Override
 protected void stopListeningForService(AxisService service) {
   try {
     dispatcher.removeEndpoint(endpoints.get(service.getName()));
   } catch (IOException ex) {
     log.error("I/O exception while stopping listener for service " + service.getName(), ex);
   }
   endpoints.remove(service.getName());
 }
 @Override
 protected void stopEndpoint(E endpoint) {
   try {
     dispatcher.removeEndpoint(endpoint);
   } catch (IOException ex) {
     log.error(
         "I/O exception while stopping listener for service " + endpoint.getServiceName(), ex);
   }
 }
 @Override
 public void destroy() {
   super.destroy();
   try {
     dispatcher.stop();
   } catch (IOException ex) {
     log.error("Failed to stop dispatcher", ex);
   }
 }
 @Override
 protected void startEndpoint(E endpoint) throws AxisFault {
   try {
     dispatcher.addEndpoint(endpoint);
   } catch (IOException ex) {
     // TODO: passing endpoint.getService() is not correct because it may be null
     throw new AxisFault("Unable to listen on endpoint " + endpoint.getDescription(), ex);
   }
   if (log.isDebugEnabled()) {
     log.debug(
         "Started listening on endpoint "
             + endpoint.getDescription()
             + " [contentType="
             + endpoint.getContentType()
             + "; service="
             + endpoint.getServiceName()
             + "]");
   }
 }