001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.activemq.network.jms;
018
019/**
020 * Create an Inbound Queue Bridge.  By default this class uses the sname name for
021 * both the inbound and outbound queue.  This behavior can be overridden however
022 * by using the setter methods to configure both the inbound and outboud queue names
023 * separately.
024 *
025 * @org.apache.xbean.XBean
026 */
027public class InboundQueueBridge extends QueueBridge {
028
029    String inboundQueueName;
030    String localQueueName;
031
032    /**
033     * Constructor that takes a foreign destination as an argument
034     *
035     * @param inboundQueueName
036     */
037    public InboundQueueBridge(String inboundQueueName) {
038        this.inboundQueueName = inboundQueueName;
039        this.localQueueName = inboundQueueName;
040    }
041
042    /**
043     * Default Constructor
044     */
045    public InboundQueueBridge() {
046    }
047
048    /**
049     * @return Returns the inboundQueueName.
050     */
051    public String getInboundQueueName() {
052        return inboundQueueName;
053    }
054
055    /**
056     * Sets the queue name used for the inbound queue, if the outbound queue
057     * name has not been set, then this method uses the same name to configure
058     * the outbound queue name.
059     *
060     * @param inboundQueueName The inboundQueueName to set.
061     */
062    public void setInboundQueueName(String inboundQueueName) {
063        this.inboundQueueName = inboundQueueName;
064        if (this.localQueueName == null) {
065            this.localQueueName = inboundQueueName;
066        }
067    }
068
069    /**
070     * @return the localQueueName
071     */
072    public String getLocalQueueName() {
073        return localQueueName;
074    }
075
076    /**
077     * @param localQueueName the localQueueName to set
078     */
079    public void setLocalQueueName(String localQueueName) {
080        this.localQueueName = localQueueName;
081    }
082}