public void close() throws IOException { client.destroy(); } }
@Override public void disconnect() { client.destroy(); notifyOfDisconnect(); } }
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; } } }
public void close() throws IOException { if (client != null) { client.destroy(); client = null; endpoint = null; } }
public void close() throws IOException { if (client != null) { client.destroy(); client = null; endpoint = null; } }
public void close() throws IOException { client.destroy(); } }
@Override public void close() { if (clients != null) { for (Client client : clients.values()) { client.destroy(); } } }
@Override public void close() { if (clients != null) { for (Client client : clients.values()) { client.destroy(); } } } }
@Override public void close() { if (clients != null) { for (Client client : clients.values()) { client.destroy(); } } }
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; } } }
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; }
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; } } }
@Override protected void doStop() throws Exception { super.doStop(); if (client != null) { // It will help to release the request context map client.destroy(); client = null; } }
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; } } }
final Client client = new Client(surv.getName(), surv.getPassword()); tasks.add(callable; client.destroy();
@Override public void stop() throws MuleException { disposeIfNeeded(defaultDispatcher, LOGGER); stopIfNeeded(defaultDispatcher); client.destroy(); }
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(); }
} finally { if (client != null) { client.destroy();
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(); } }
assertEquals(INPUT, output); cl.destroy();