Пример #1
0
 public EndpointImpl(Bus b, Object i, String bindingUri, String wsdl, WebServiceFeature f[]) {
   bus = b;
   implementor = i;
   this.bindingUri = bindingUri;
   wsdlLocation = wsdl == null ? null : new String(wsdl);
   serverFactory = new JaxWsServerFactoryBean();
   if (f != null) {
     ((JaxWsServiceFactoryBean) serverFactory.getServiceFactory()).setWsFeatures(Arrays.asList(f));
   }
 }
Пример #2
0
 public BindingConfiguration getBindingConfig() {
   return serverFactory.getBindingConfig();
 }
Пример #3
0
 public void setBindingConfig(BindingConfiguration config) {
   serverFactory.setBindingConfig(config);
 }
Пример #4
0
 public String getTransportId() {
   return serverFactory.getTransportId();
 }
Пример #5
0
 public void setTransportId(String transportId) {
   serverFactory.setTransportId(transportId);
 }
Пример #6
0
 public DataBinding getDataBinding() {
   return serverFactory.getDataBinding();
 }
Пример #7
0
 public void setDataBinding(DataBinding dataBinding) {
   serverFactory.setDataBinding(dataBinding);
 }
Пример #8
0
  public synchronized ServerImpl getServer(String addr) {
    if (server == null) {
      checkProperties();

      ClassLoaderHolder loader = null;
      try {
        if (bus != null) {
          ClassLoader newLoader = bus.getExtension(ClassLoader.class);
          if (newLoader != null) {
            loader = ClassLoaderUtils.setThreadContextClassloader(newLoader);
          }
        }

        // Initialize the endpointName so we can do configureObject
        QName origEpn = endpointName;
        if (endpointName == null) {
          JaxWsImplementorInfo implInfo = new JaxWsImplementorInfo(getImplementorClass());
          endpointName = implInfo.getEndpointName();
        }

        if (serviceFactory != null) {
          serverFactory.setServiceFactory(serviceFactory);
        }

        /*if (serviceName != null) {
            serverFactory.getServiceFactory().setServiceName(serviceName);
        }*/

        configureObject(this);
        endpointName = origEpn;

        // Set up the server factory
        serverFactory.setAddress(addr);
        serverFactory.setStart(false);
        serverFactory.setEndpointName(endpointName);
        serverFactory.setServiceBean(implementor);
        serverFactory.setBus(bus);
        serverFactory.setFeatures(getFeatures());
        serverFactory.setInvoker(invoker);
        serverFactory.setSchemaLocations(schemaLocations);
        if (serverFactory.getProperties() != null) {
          serverFactory.getProperties().putAll(properties);
        } else {
          serverFactory.setProperties(properties);
        }

        // Be careful not to override any serverfactory settings as a user might
        // have supplied their own.
        if (getWsdlLocation() != null) {
          serverFactory.setWsdlURL(getWsdlLocation());
        }

        if (bindingUri != null) {
          serverFactory.setBindingId(bindingUri);
        }

        if (serviceName != null) {
          serverFactory.getServiceFactory().setServiceName(serviceName);
        }

        if (implementorClass != null) {
          serverFactory.setServiceClass(implementorClass);
        }

        if (executor != null) {
          serverFactory.getServiceFactory().setExecutor(executor);
        }
        if (handlers.size() > 0) {
          serverFactory.addHandlers(handlers);
        }

        configureObject(serverFactory);

        server = serverFactory.create();

        org.apache.cxf.endpoint.Endpoint endpoint = getEndpoint();
        if (in != null) {
          endpoint.getInInterceptors().addAll(in);
        }
        if (out != null) {
          endpoint.getOutInterceptors().addAll(out);
        }
        if (inFault != null) {
          endpoint.getInFaultInterceptors().addAll(inFault);
        }
        if (outFault != null) {
          endpoint.getOutFaultInterceptors().addAll(outFault);
        }

        if (properties != null) {
          endpoint.putAll(properties);
        }

        configureObject(endpoint.getService());
        configureObject(endpoint);
        this.service = endpoint.getService();

        if (getWsdlLocation() == null) {
          // hold onto the wsdl location so cache won't clear till we go away
          setWsdlLocation(serverFactory.getWsdlURL());
        }

        if (serviceName == null) {
          setServiceName(serverFactory.getServiceFactory().getServiceQName());
        }
        if (endpointName == null) {
          endpointName = endpoint.getEndpointInfo().getName();
        }
      } finally {
        if (loader != null) {
          loader.reset();
        }
      }
    }
    return (ServerImpl) server;
  }