Examples of Uniform


Examples of org.restlet.Uniform

            return true;
        }

        // process the request asynchronously
        LOG.debug("Sending request: {} for exchangeId: {}", request, exchange.getExchangeId());
        client.handle(request, new Uniform() {
            @Override
            public void handle(Request request, Response response) {
                LOG.debug("Received response: {} for exchangeId: {}", response, exchange.getExchangeId());
                try {
                    if (response != null) {
View Full Code Here

Examples of org.restlet.Uniform

            return true;
        }

        // process the request asynchronously
        LOG.debug("Sending request: {} for exchangeId: {}", request, exchange.getExchangeId());
        client.handle(request, new Uniform() {
            @Override
            public void handle(Request request, Response response) {
                LOG.debug("Received response: {} for exchangeId: {}", response, exchange.getExchangeId());
                try {
                    if (response != null) {
View Full Code Here

Examples of org.restlet.Uniform

    protected abstract Uniform createRoot( Request request, Response response );

    // Callbacks used from resources
    public void subResource( Class<? extends ContextResource> subResourceClass )
    {
        Uniform subResource = subResources.get( subResourceClass );

        if( subResource == null )
        {
            // Instantiate and store subresource instance
            subResource = module.newObject( subResourceClass, this );
            subResources.put( subResourceClass, subResource );
        }

        subResource.handle( Request.getCurrent(), Response.getCurrent() );
    }
View Full Code Here

Examples of org.restlet.Uniform

                ObjectSelection.newSelection();

                try
                {
                    // Start handling the build-up for the context
                    Uniform resource = createRoot( request, response );
                    resource.handle( request, response );

                    if( response.getEntity() != null )
                    {
                        if( response.getEntity().getModificationDate() == null )
                        {
View Full Code Here

Examples of org.restlet.client.Uniform

    public void commit(final ClientCall httpCall, Request request,
            Response response) throws Exception {
        if (httpCall != null) {
            // Check if the call is asynchronous
            if (request.isAsynchronous()) {
                final Uniform userCallback = request.getOnResponse();

                // Send the request to the client
                httpCall.sendRequest(request, response, new Uniform() {
                    public void handle(Request request, Response response) {
                        try {
                            updateResponse(response,
                                    new Status(httpCall.getStatusCode(), null,
                                            httpCall.getReasonPhrase(), null),
                                    httpCall);

                            if (userCallback != null) {
                                userCallback.handle(request, response);
                            }
                        } catch (Throwable t) {
                            getLogger()
                                    .log(Level.WARNING,
                                            "Unexpected error or exception inside the user call back",
View Full Code Here

Examples of org.restlet.client.Uniform

     * {@link Client} based on the protocol of the resource's URI reference.
     *
     * @return The created next Restlet or null.
     */
    protected Uniform createNext() {
        Uniform result = null;


        if ((result == null) && (getContext() != null)) {
            // Try using directly the client dispatcher
            result = getContext().getClientDispatcher();
View Full Code Here

Examples of org.restlet.client.Uniform

     * context is available.
     *
     * @return The next Restlet or null.
     */
    public Uniform getNext() {
        Uniform result = this.next;

        if (result == null) {
            synchronized (this) {
                if (result == null) {
                    result = createNext();
View Full Code Here

Examples of org.restlet.client.Uniform

     * @return The response created.
     * @see #getNext()
     */
    public Response handleOutbound(Request request) {
        Response response = createResponse(request);
        Uniform next = getNext();

        if (next != null) {
            // Effectively handle the call
            handle(request, response, null, 0, next);

View Full Code Here

Examples of org.restlet.client.Uniform

    public void commit(final ClientCall httpCall, Request request,
            Response response) throws Exception {
        if (httpCall != null) {
            // Check if the call is asynchronous
            if (request.getOnResponse() != null) {
                final Uniform userCallback = request.getOnResponse();

                // Send the request to the client
                httpCall.sendRequest(request, response, new Uniform() {
                    public void handle(Request request, Response response) {
                        try {
                            updateResponse(response,
                                    new Status(httpCall.getStatusCode(), null,
                                            httpCall.getReasonPhrase(), null),
                                    httpCall);
                            userCallback.handle(request, response);
                        } catch (Exception e) {
                            // Unexpected exception occurred
                            if ((response.getStatus() == null)
                                    || !response.getStatus().isError()) {
                                response.setStatus(
                                        Status.CONNECTOR_ERROR_INTERNAL, e);
                                userCallback.handle(request, response);
                            }
                        }
                    }
                });
            } else {
View Full Code Here

Examples of org.restlet.client.Uniform

     * {@link Client} based on the protocol of the resource's URI reference.
     *
     * @return The created next Restlet or null.
     */
    protected Uniform createNext() {
        Uniform result = null;


        if ((result == null) && (getContext() != null)) {
            // Try using directly the client dispatcher
            result = getContext().getClientDispatcher();
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.