Package org.apache.activemq.command

Examples of org.apache.activemq.command.Endpoint


     * Note that this method does not need to be synchronized as its only ever going to be
     * used by the already-synchronized read() method of a CommandChannel
     *
     */
    protected Endpoint getEndpoint(SocketAddress address) {
        Endpoint endpoint = (Endpoint) endpoints.get(address);
        if (endpoint == null) {
            endpoint = createEndpoint(address);
            endpoints.put(address, endpoint);
        }
        return endpoint;
View Full Code Here


    public void stop() throws Exception {
    }

    public Command read() throws IOException {
        Command answer = null;
        Endpoint from = null;
        synchronized (readLock) {
            while (true) {
                DatagramPacket datagram = createDatagramPacket();
                channel.receive(datagram);
View Full Code Here

        bufferPool.stop();
    }

    public Command read() throws IOException {
        Command answer = null;
        Endpoint from = null;
        synchronized (readLock) {
            while (true) {
                readBuffer.clear();
                SocketAddress address = channel.receive(readBuffer);
View Full Code Here

    public void stop() throws Exception {
    }

    public Command read() throws IOException {
        Command answer = null;
        Endpoint from = null;
        synchronized (readLock) {
            while (true) {
                DatagramPacket datagram = createDatagramPacket();
                channel.receive(datagram);
View Full Code Here

            BrokerInfo remoteBrokerInfo = (BrokerInfo)command;
            BrokerId remoteBrokerId = remoteBrokerInfo.getBrokerId();

            // lets associate the incoming endpoint with a broker ID so we can
            // refer to it later
            Endpoint from = command.getFrom();
            if (from == null) {
                LOG.warn("Incoming command does not have a from endpoint: " + command);
            } else {
                from.setBrokerInfo(remoteBrokerInfo);
            }
            if (localBrokerId != null) {
                if (localBrokerId.equals(remoteBrokerId)) {
                    LOG.info("Disconnecting loop back connection.");
                    // waitStarted();
View Full Code Here

    /**
     * Returns the broker ID that the command came from
     */
    protected BrokerId getFromBrokerId(Command command) throws IOException {
        BrokerId answer = null;
        Endpoint from = command.getFrom();
        if (from == null) {
            LOG.warn("Incoming command does not have a from endpoint: " + command);
        } else {
            answer = from.getBrokerId();
        }
        if (answer != null) {
            return answer;
        } else {
            throw new IOException("No broker ID is available for endpoint: " + from + " from command: "
View Full Code Here

    }

    public void onCommand(Object o) {
        final Command command = (Command)o;
        // redirect to the endpoint that the last response came from
        Endpoint from = command.getFrom();
        transport.setTargetEndpoint(from);

        super.onCommand(command);
    }
View Full Code Here

     * Note that this method does not need to be synchronized as its only ever going to be
     * used by the already-synchronized read() method of a CommandChannel
     *
     */
    protected Endpoint getEndpoint(SocketAddress address) {
        Endpoint endpoint = endpoints.get(address);
        if (endpoint == null) {
            endpoint = createEndpoint(address);
            endpoints.put(address, endpoint);
        }
        return endpoint;
View Full Code Here

        bufferPool.stop();
    }

    public Command read() throws IOException {
        Command answer = null;
        Endpoint from = null;
        synchronized (readLock) {
            while (true) {
                readBuffer.clear();
                SocketAddress address = channel.receive(readBuffer);
View Full Code Here

    public void stop() throws Exception {
    }

    public Command read() throws IOException {
        Command answer = null;
        Endpoint from = null;
        synchronized (readLock) {
            while (true) {
                DatagramPacket datagram = createDatagramPacket();
                channel.receive(datagram);
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.Endpoint

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.