@Override public void close() { releaseConnection(); }
@Override // this is synchronized to protect against premature finalize called by the GC protected synchronized final void finalize() throws Throwable { releaseConnection(); }
@Override // this is synchronized to protect against premature finalize called by the GC protected synchronized final void finalize() throws Throwable { releaseConnection(); }
@Override public void close() { releaseConnection(); }
@Override public <T2> T2 getEntity(Class<T2> type, Type genericType, Annotation[] anns) { if (exception != null) { throw new RuntimeException(Messages.MESSAGES.unableToUnmarshalResponse(attributeExceptionsTo), exception); } if (unmarshaledEntity != null && !type.isInstance(this.unmarshaledEntity)) throw new RuntimeException(Messages.MESSAGES.entityAlreadyRead(unmarshaledEntity.getClass())); if (unmarshaledEntity == null) { if (status == HttpResponseCodes.SC_NO_CONTENT) return null; unmarshaledEntity = readFrom(type, genericType, getMediaType(), anns); // only release connection if we actually unmarshalled something and if the object is *NOT* an InputStream // If it is an input stream, the user may be doing their own stream processing. if (unmarshaledEntity != null && !InputStream.class.isInstance(unmarshaledEntity)) releaseConnection(); } return (T2) unmarshaledEntity; }
@Override public <T2> T2 getEntity(Class<T2> type, Type genericType, Annotation[] anns) { if (exception != null) { throw new RuntimeException(Messages.MESSAGES.unableToUnmarshalResponse(attributeExceptionsTo), exception); } if (unmarshaledEntity != null && !type.isInstance(this.unmarshaledEntity)) throw new RuntimeException(Messages.MESSAGES.entityAlreadyRead(unmarshaledEntity.getClass())); if (unmarshaledEntity == null) { if (status == HttpResponseCodes.SC_NO_CONTENT) return null; unmarshaledEntity = readFrom(type, genericType, getMediaType(), anns); // only release connection if we actually unmarshalled something and if the object is *NOT* an InputStream // If it is an input stream, the user may be doing their own stream processing. if (unmarshaledEntity != null && !InputStream.class.isInstance(unmarshaledEntity)) releaseConnection(); } return (T2) unmarshaledEntity; }
public Response.Status extractEntity(ClientRequestContext context, Object... args) { if (release) context.getClientResponse().releaseConnection(); return context.getClientResponse().getResponseStatus(); } };
public Response.Status extractEntity(ClientRequestContext context, Object... args) { if (release) context.getClientResponse().releaseConnection(); return context.getClientResponse().getResponseStatus(); } };
public Object extractEntity(ClientRequestContext context, Object... args) { try { context.getClientResponse().checkFailureStatus(); } catch (ClientResponseFailure ce) { // If ClientResponseFailure do a copy of the response and then release the connection, // we need to use the copy here and not the original response context.getErrorHandler().clientErrorHandling((BaseClientResponse) ce.getResponse(), ce); } catch (RuntimeException e) { context.getErrorHandler().clientErrorHandling(context.getClientResponse(), e); } if (release) context.getClientResponse().releaseConnection(); return null; } };
public Object extractEntity(ClientRequestContext context, Object... args) { try { context.getClientResponse().checkFailureStatus(); } catch (ClientResponseFailure ce) { // If ClientResponseFailure do a copy of the response and then release the connection, // we need to use the copy here and not the original response context.getErrorHandler().clientErrorHandling((BaseClientResponse) ce.getResponse(), ce); } catch (RuntimeException e) { context.getErrorHandler().clientErrorHandling(context.getClientResponse(), e); } if (release) context.getClientResponse().releaseConnection(); return null; } };