1 17 package org.apache.activemq.spring; 18 19 import org.springframework.beans.factory.BeanNameAware; 20 import org.springframework.beans.factory.InitializingBean; 21 22 32 public class ActiveMQConnectionFactory extends org.apache.activemq.ActiveMQConnectionFactory implements InitializingBean, BeanNameAware { 33 34 private String beanName; 35 private boolean useBeanNameAsClientIdPrefix; 36 37 public void afterPropertiesSet() throws Exception { 38 if (isUseBeanNameAsClientIdPrefix() && getClientIDPrefix() == null) { 39 setClientIDPrefix(getBeanName()); 40 } 41 } 42 43 public String getBeanName() { 44 return beanName; 45 } 46 47 public void setBeanName(String beanName) { 48 this.beanName = beanName; 49 } 50 51 public boolean isUseBeanNameAsClientIdPrefix() { 52 return useBeanNameAsClientIdPrefix; 53 } 54 55 public void setUseBeanNameAsClientIdPrefix(boolean useBeanNameAsClientIdPrefix) { 56 this.useBeanNameAsClientIdPrefix = useBeanNameAsClientIdPrefix; 57 } 58 } 59 | Popular Tags |