org.apache.cxf.endpoint.Client.destroy()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(334)

本文整理了Java中org.apache.cxf.endpoint.Client.destroy()方法的一些代码示例,展示了Client.destroy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Client.destroy()方法的具体详情如下:
包路径:org.apache.cxf.endpoint.Client
类名称:Client
方法名:destroy

Client.destroy介绍

[英]Indicates that the client is no longer needed and that any resources it holds can now be freed.
[中]指示不再需要客户端,并且现在可以释放它所拥有的任何资源。

代码示例

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

public void close() throws IOException {
    client.destroy();
  }
}

代码示例来源:origin: opensourceBIM/BIMserver

@Override
  public void disconnect() {
    client.destroy();
    notifyOfDisconnect();
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

public void destroy() throws Exception {
    if (obj != null) {
      if (obj instanceof Closeable) {
        ((Closeable)obj).close();
      } else {
        Client c = ClientProxy.getClient(obj);
        c.destroy();
      }
      obj = null;
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-simple

public void close() throws IOException {
  if (client != null) {
    client.destroy();
    client = null;
    endpoint = null;
  }
}

代码示例来源:origin: apache/cxf

public void close() throws IOException {
  if (client != null) {
    client.destroy();
    client = null;
    endpoint = null;
  }
}

代码示例来源:origin: apache/cxf

public void close() throws IOException {
    client.destroy();
  }
}

代码示例来源:origin: org.jbpm/jbpm-workitems-webservice

@Override
public void close() {
  if (clients != null) {
    for (Client client : clients.values()) {
      client.destroy();
    }
  }
}

代码示例来源:origin: org.jbpm/jbpm-workitems-bpmn2

@Override
  public void close() {
    if (clients != null) {
      for (Client client : clients.values()) {
        client.destroy();
      }
    }
  }
}

代码示例来源:origin: org.jbpm/jbpm-workitems-webservice

@Override
public void close() {
  if (clients != null) {
    for (Client client : clients.values()) {
      client.destroy();
    }
  }
}

代码示例来源:origin: apache/cxf

public void destroy() throws Exception {
    if (obj != null) {
      if (obj instanceof Closeable) {
        ((Closeable)obj).close();
      } else {
        Client c = ClientProxy.getClient(obj);
        c.destroy();
      }
      obj = null;
    }
  }
}

代码示例来源:origin: apache/cxf

public void destroy() throws ResourceException {
  if (LOG.isLoggable(Level.FINER)) {
    LOG.finer("destroy");
  }
  Client client = ClientProxy.getClient(clientProxy);
  client.destroy();
  handles.clear();
  isClosed = false;
  bus = null;
  connReqInfo = null;
}

代码示例来源:origin: apache/cxf

public void destroy() throws Exception {
    if (obj != null) {
      if (obj instanceof Closeable) {
        ((Closeable)obj).close();
      } else {
        Client c = ClientProxy.getClient(obj);
        c.destroy();
      }
      obj = null;
    }
  }
}

代码示例来源:origin: org.apache.camel/camel-cxf

@Override
protected void doStop() throws Exception {
  super.doStop();
  if (client != null) {
    // It will help to release the request context map
    client.destroy();
    client = null;
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-simple

public void destroy() throws Exception {
    if (obj != null) {
      if (obj instanceof Closeable) {
        ((Closeable)obj).close();
      } else {
        Client c = ClientProxy.getClient(obj);
        c.destroy();
      }
      obj = null;
    }
  }
}

代码示例来源:origin: stackoverflow.com

final Client client = new Client(surv.getName(), surv.getPassword());
tasks.add(callable;
client.destroy();

代码示例来源:origin: org.mule.services/mule-service-soap

@Override
public void stop() throws MuleException {
 disposeIfNeeded(defaultDispatcher, LOGGER);
 stopIfNeeded(defaultDispatcher);
 client.destroy();
}

代码示例来源:origin: stackoverflow.com

private void sendJSONObject() throws JSONException{
   ClientConfig config = new DefaultClientConfig();
   Client client = Client.create(config);
   client.addFilter(new LoggingFilter());
   WebResource service = client.resource("*your_adress_and_path*");
   JSONObject data= new JSONObject();
   dados.put("Name", "John");
   dados.put("Age", "30");
   dados.put("City", "Tokyo");
   ClientResponse client_response = service.accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, data);
   System.out.println("Status: "+client_response.getStatus());
   client.destroy();
 }

代码示例来源:origin: stackoverflow.com

} finally {
  if (client != null) {
    client.destroy();

代码示例来源:origin: stackoverflow.com

public class Test {

  private static URI getBaseURI() {
    return UriBuilder.fromUri("http://localhost:8080/restfullwebservice/resources/generic").build("");
  }

  public static void main(String[] args) throws FileNotFoundException {
    final ClientConfig config = new DefaultClientConfig();
    final Client client = Client.create(config);

    final WebResource resource = client.resource(getBaseURI()).path("upload");

    final File fileToUpload = new File("C:/Users/Public/Pictures/Desert.jpg");

    final FormDataMultiPart multiPart = new FormDataMultiPart();
    if (fileToUpload != null) {
      multiPart.bodyPart(new FileDataBodyPart("file", fileToUpload,
          MediaType.APPLICATION_OCTET_STREAM_TYPE));
    }

    final ClientResponse clientResp = resource.type(
        MediaType.MULTIPART_FORM_DATA_TYPE).post(ClientResponse.class,
        multiPart);
    System.out.println("Response: " + clientResp.getClientResponseStatus());

    client.destroy();
  }
}

代码示例来源:origin: apache/cxf

assertEquals(INPUT, output);
cl.destroy();

相关文章