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 */ 017 package org.apache.activemq.broker; 018 019 import org.apache.activemq.broker.region.Destination; 020 import org.apache.activemq.broker.region.Region; 021 import org.apache.activemq.state.ProducerState; 022 023 /** 024 * Holds internal state in the broker for a MessageProducer 025 * 026 * @version $Revision: 1.8 $ 027 */ 028 public class ProducerBrokerExchange { 029 030 private ConnectionContext connectionContext; 031 private Destination regionDestination; 032 private Region region; 033 private ProducerState producerState; 034 private boolean mutable = true; 035 036 public ProducerBrokerExchange() { 037 } 038 039 public ProducerBrokerExchange copy() { 040 ProducerBrokerExchange rc = new ProducerBrokerExchange(); 041 rc.connectionContext = connectionContext.copy(); 042 rc.regionDestination = regionDestination; 043 rc.region = region; 044 rc.producerState = producerState; 045 rc.mutable = mutable; 046 return rc; 047 } 048 049 050 /** 051 * @return the connectionContext 052 */ 053 public ConnectionContext getConnectionContext() { 054 return this.connectionContext; 055 } 056 057 /** 058 * @param connectionContext the connectionContext to set 059 */ 060 public void setConnectionContext(ConnectionContext connectionContext) { 061 this.connectionContext = connectionContext; 062 } 063 064 /** 065 * @return the mutable 066 */ 067 public boolean isMutable() { 068 return this.mutable; 069 } 070 071 /** 072 * @param mutable the mutable to set 073 */ 074 public void setMutable(boolean mutable) { 075 this.mutable = mutable; 076 } 077 078 /** 079 * @return the regionDestination 080 */ 081 public Destination getRegionDestination() { 082 return this.regionDestination; 083 } 084 085 /** 086 * @param regionDestination the regionDestination to set 087 */ 088 public void setRegionDestination(Destination regionDestination) { 089 this.regionDestination = regionDestination; 090 } 091 092 /** 093 * @return the region 094 */ 095 public Region getRegion() { 096 return this.region; 097 } 098 099 /** 100 * @param region the region to set 101 */ 102 public void setRegion(Region region) { 103 this.region = region; 104 } 105 106 /** 107 * @return the producerState 108 */ 109 public ProducerState getProducerState() { 110 return this.producerState; 111 } 112 113 /** 114 * @param producerState the producerState to set 115 */ 116 public void setProducerState(ProducerState producerState) { 117 this.producerState = producerState; 118 } 119 120 }