Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.Packet


                    else {
                        log.warn("Failed to perform GET on: " + remoteUrl + " as response was: " + answer);
                    }
                }
                else {
                    Packet packet = getWireFormat().readPacket(new DataInputStream(connection.getInputStream()));
                    //Packet packet = getWireFormat().fromString(connection.getContent().toString());
                    if (packet == null) {
                        log.warn("Received null packet from url: " + remoteUrl);
                    }
                    else {
View Full Code Here


        }
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // lets return the next response
        Packet packet = null;
        try {
            HttpServerTransportChannel transportChannel = getTransportChannel(request);
            if (transportChannel == null) {
                return;
            }
View Full Code Here

        }
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        try {
            Packet packet = wireFormat.fromString(readRequestBody(request));
           
            if( packet.getPacketType() == Packet.WIRE_FORMAT_INFO ) {
               
                // Can we handle the requested wire format?
                WireFormatInfo info = (WireFormatInfo) packet;
                if (!canProcessWireFormatVersion(info.getVersion())) {
                  response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: " + info.getVersion());
View Full Code Here

                    else {
                        log.warn("Failed to perform GET on: " + remoteUrl + " as response was: " + answer);
                    }
                }
                else {
                    Packet packet = getWireFormat().readPacket(new DataInputStream(httpMethod.getResponseBodyAsStream()));
                    if (packet == null) {
                        log.warn("Received null packet from url: " + remoteUrl);
                    }
                    else {
                        doConsumePacket(packet);
View Full Code Here

    /**
     * @return the first dequeued Packet or blocks until one is available
     * @throws InterruptedException
     */
    public Packet dequeue() throws InterruptedException {
        Packet result = null;
        synchronized (outLock) {
            while (internalList.isEmpty() && !closed) {
                outLock.wait(WAIT_TIMEOUT);
            }
            result = dequeueNoWait();
View Full Code Here

     *
     * @return the Packet at the head of the queue or null, if none is available
     * @throws InterruptedException
     */
    public Packet dequeueNoWait() throws InterruptedException {
        Packet packet = null;
        if (stopped) {
            synchronized (outLock) {
                while (stopped && !closed) {
                    outLock.wait(WAIT_TIMEOUT);
                }
View Full Code Here

     * remove any Packets in the queue
     */
    public void clear() {
        synchronized (inLock) {
            while (!internalList.isEmpty()) {
                Packet packet = (Packet) internalList.removeFirst();
                decrementMemoryUsed(packet);
            }
            inLock.notify();
        }
    }
View Full Code Here

     * @return the first dequeued Packet or blocks until one is available
     * @throws JMSException
     * @throws InterruptedException
     */
    public Packet dequeue() throws JMSException, InterruptedException {
        Packet result = null;
        synchronized (outLock) {
            while ((result = dequeueNoWait()) == null) {
                outLock.wait(WAIT_TIMEOUT);
            }
        }
View Full Code Here

     * @param timeInMillis maximum time to wait to dequeue a Packet
     * @throws JMSException
     * @throws InterruptedException
     */
    public Packet dequeue(long timeInMillis) throws JMSException, InterruptedException {
        Packet result = dequeueNoWait();
        if (result == null) {
            synchronized (outLock) {
                outLock.wait(timeInMillis);
                result = dequeueNoWait();
            }
View Full Code Here

     * @return the Packet from the head of the Queue or null if the Queue is empty
     * @throws JMSException
     * @throws InterruptedException
     */
    public Packet dequeueNoWait() throws JMSException, InterruptedException {
        Packet result = null;
        if (stopped) {
            synchronized (outLock) {
                while (stopped && !closed) {
                    outLock.wait(WAIT_TIMEOUT);
                }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.Packet

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.