1 10 11 package org.mule.config; 12 13 import org.mule.MuleManager; 14 import org.mule.umo.lifecycle.InitialisationException; 15 import org.mule.util.queue.QueueConfiguration; 16 17 25 26 public class QueueProfile 27 { 28 private int maxOutstandingMessages = 0; 29 private boolean persistent = false; 30 31 public QueueProfile() 32 { 33 super(); 34 } 35 36 public QueueProfile(int maxOutstandingMessages, boolean persistent) 37 { 38 this.maxOutstandingMessages = maxOutstandingMessages; 39 this.persistent = persistent; 40 } 41 42 public QueueProfile(QueueProfile queueProfile) 43 { 44 this.maxOutstandingMessages = queueProfile.getMaxOutstandingMessages(); 45 this.persistent = queueProfile.isPersistent(); 46 } 47 48 54 public int getMaxOutstandingMessages() 55 { 56 return maxOutstandingMessages; 57 } 58 59 65 public void setMaxOutstandingMessages(int maxOutstandingMessages) 66 { 67 this.maxOutstandingMessages = maxOutstandingMessages; 68 } 69 70 public boolean isPersistent() 71 { 72 return persistent; 73 } 74 75 public void setPersistent(boolean persistent) 76 { 77 this.persistent = persistent; 78 } 79 80 public void configureQueue(String component) throws InitialisationException 81 { 82 QueueConfiguration qc = new QueueConfiguration(maxOutstandingMessages, persistent); 83 MuleManager.getInstance().getQueueManager().setQueueConfiguration(component, qc); 84 } 85 86 } 87 | Popular Tags |