Package org.restlet.representation

Examples of org.restlet.representation.Representation.release()


                            "An error occured during the communication with the remote HTTP server.",
                            ioe);
            result = new Status(Status.CONNECTOR_ERROR_COMMUNICATION, ioe);
        } finally {
            if (entity != null) {
                entity.release();
            }

            // Call-back after writing
            if (connectorService != null) {
                connectorService.afterSend(entity);
View Full Code Here


                            "An error occured during the communication with the remote HTTP server.",
                            ioe);
            result = new Status(Status.CONNECTOR_ERROR_COMMUNICATION, ioe);
        } finally {
            if (entity != null) {
                entity.release();
            }

            // Call-back after writing
            if (connectorService != null) {
                connectorService.afterSend(entity);
View Full Code Here

                        }
                    }
                }
            } finally {
                if (responseEntity != null) {
                    responseEntity.release();
                }

                if (connectorService != null) {
                    connectorService.afterSend(responseEntity);
                }
View Full Code Here

        } catch (RequestHandledException e) {
            // Exception was handled and data were set into the Response.
        } finally {
            Representation entity = request.getEntity();
            if (entity != null)
                entity.release();
        }
    }

    /**
     * Handles the given Exception, catched by an invoke of a resource method or
View Full Code Here

                        auth = true;
                    }
                }

                getLogger().info("Before sns release");
                body.release();
            } catch (ResourceException re) {
                getLogger().warning("Could not find token resource.");
            }
            tokenResource.release();
        }
View Full Code Here

            page = tmpPage.getText();
        } catch (IOException e) {
            page = e.getLocalizedMessage();
        }
        type = tmpPage.getMediaType();
        tmpPage.release();
        local.release();
    }

    @Override
    public ServerResource find(Request request, Response response) {
View Full Code Here

                getLogger().info("In Auth Filer -> " + authenticated);

                // Clean-up
                returned.release();
                r.release();
                authResource.release();

                if (authenticated)
                    return true;
View Full Code Here

        if (authResource.getStatus().isSuccess()) {
            result = authResource.getCookieSettings();
        }

        r.release();
        authResource.release();

        return result;
    }
}
View Full Code Here

                    // Exhaust it to allow reuse of the connection
                    requestEntity.exhaust();

                    // Give a chance to the representation to release associated
                    // state and resources
                    requestEntity.release();
                } catch (IOException e) {
                    getLogger()
                            .log(Level.WARNING,
                                    "Unable to automatically exhaust the request entity.",
                                    e);
View Full Code Here

            throw wae;
        } catch (IOException e) {
            throw ConvertRepresentationException.object(this.convToCl,
                    "the message body", e);
        } finally {
            entity.release();
        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.