Package org.apache.qpid.amqp_1_0.jms.impl

Examples of org.apache.qpid.amqp_1_0.jms.impl.MessageFactory$ContentType


    public ProtocolHandler parse(ByteBuffer in)
    {
        try
        {
        Error frameParsingError = null;
        int size = _size;
        State state = _state;
        ByteBuffer oldIn = null;

        while(in.hasRemaining() && state != State.ERROR)
View Full Code Here


    private Error createError(final ErrorCondition framingError,
                              final String description,
                              final Object... args)
    {
        Error error = new Error();
        error.setCondition(framingError);
        Formatter formatter = new Formatter();
        error.setDescription(formatter.format(description, args).toString());
        return error;
    }
View Full Code Here

        AMQPDescribedTypeRegistry registry = AMQPDescribedTypeRegistry.newInstance()
                .registerTransportLayer()
                .registerMessagingLayer()
                .registerTransactionLayer();

        Open open = new Open();
        // Open(container_id="venture", channel_max=10, hostname="foo", offered_capabilities=[Symbol("one"), Symbol("two"), Symbol("three")])
        open.setContainerId("venture");
        open.setChannelMax(UnsignedShort.valueOf((short) 10));
        open.setHostname("foo");
        open.setOfferedCapabilities(new Symbol[] {Symbol.valueOf("one"),Symbol.valueOf("two"),Symbol.valueOf("three")});

        ValueWriter<Open> writer = registry.getValueWriter(open);

        System.out.println("------ Encode (time in ms for 1 million opens)");
        Long myLong = Long.valueOf(32);
View Full Code Here

    public void renderPageResponse(Page page) throws IOException
    {
        assert page != null;

        ContentType contentType = pageContentTypeAnalyzer.findContentType(page);

        // For the moment, the content type is all that's used determine the model for the markup writer.
        // It's something of a can of worms.

        MarkupWriter writer = markupWriterFactory.newMarkupWriter(contentType);

        markupRenderer.renderPageMarkup(page, writer);

        PrintWriter pw = response.getPrintWriter(contentType.toString());

        long startNanos = System.nanoTime();

        writer.toMarkup(pw);
View Full Code Here

    {
        // This is a complex area as we are trying to keep public and private services properly
        // separated, and trying to keep stateless and stateful (i.e., perthread scope) services
        // separated. So we inform the stateful queue service what it needs to do here ...

        ContentType pageContentType = (ContentType) request.getAttribute(InternalConstants.CONTENT_TYPE_ATTRIBUTE_NAME);

        ContentType contentType = new ContentType(InternalConstants.JSON_MIME_TYPE, outputEncoding);

        MarkupWriter writer = factory.newPartialMarkupWriter(pageContentType);

        JSONObject reply = new JSONObject();

        // ... and here, the pipeline eventually reaches the PRQ to let it render the root render command.

        partialMarkupRenderer.renderMarkup(writer, reply);

        PrintWriter pw = response.getPrintWriter(contentType.toString());

        if (compactJSON)
            reply.print(pw);
        else
            reply.prettyPrint(pw);
View Full Code Here

        this.outputEncoding = outputEncoding;
    }

    public void processResultValue(JSONObject value) throws IOException
    {
        ContentType contentType = new ContentType(InternalConstants.JSON_MIME_TYPE, outputEncoding);

        PrintWriter pw = response.getPrintWriter(contentType.toString());

        pw.print(value.toString());

        pw.flush();
    }
View Full Code Here

        this.outputEncoding = outputEncoding;
    }

    public void processResultValue(JSONArray value) throws IOException
    {
        ContentType contentType = new ContentType(InternalConstants.JSON_MIME_TYPE, outputEncoding);

        PrintWriter pw = response.getPrintWriter(contentType.toString());

        pw.print(value.toString());

        pw.flush();
    }
View Full Code Here

            }
        };

        resources.triggerEvent("providecompletions", new Object[]{input}, callback);

        ContentType contentType = responseRenderer.findContentType(this);

        MarkupWriter writer = factory.newMarkupWriter(contentType);

        generateResponseMarkup(writer, matchesHolder.get());

        return new TextStreamResponse(contentType.toString(), writer.toString());
    }
View Full Code Here

    {
        // This is a complex area as we are trying to keep public and private services properly
        // seperated, and trying to keep stateless and stateful (i.e., perthread scope) services
        // seperated. So we inform the stateful queue service what it needs to do here ...

        ContentType pageContentType =
                (ContentType) request.getAttribute(InternalConstants.CONTENT_TYPE_ATTRIBUTE_NAME);

        ContentType contentType = new ContentType(InternalConstants.JSON_MIME_TYPE, outputEncoding);

        MarkupWriter writer = factory.newMarkupWriter(pageContentType);

        JSONObject reply = new JSONObject();

        // ... and here, the pipeline eventually reaches the PRQ to let it render the root render command.

        partialMarkupRenderer.renderMarkup(writer, reply);

        PrintWriter pw = response.getPrintWriter(contentType.toString());

        pw.print(reply);

        pw.flush();
    }
View Full Code Here

    public MarkupWriter newMarkupWriter(String pageName)
    {
        Page page = cache.get(pageName);

        ContentType contentType = analyzer.findContentType(page);

        return newMarkupWriter(contentType);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.amqp_1_0.jms.impl.MessageFactory$ContentType

Copyright © 2018 www.massapicom. 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.