001 /* 002 * Created on Apr 22, 2004 003 * 004 * To change the template for this generated file go to 005 * Window - Preferences - Java - Code Generation - Code and Comments 006 */ 007 package org.activemq.service; 008 009 import java.util.Map; 010 011 import javax.jms.JMSException; 012 013 import org.activemq.broker.BrokerClient; 014 import org.activemq.message.ActiveMQDestination; 015 import org.activemq.message.ActiveMQMessage; 016 import org.activemq.message.ConsumerInfo; 017 import org.activemq.message.MessageAck; 018 019 /** 020 * A manager of MessageContainer instances 021 */ 022 public interface MessageContainerManager extends Service { 023 024 /** 025 * Creates a destination. 026 * @param dest 027 * @throws JMSException 028 * 029 */ 030 public void createMessageContainer(ActiveMQDestination dest) throws JMSException; 031 032 /** 033 * Destroys a destination. 034 * @param dest 035 * @throws JMSException 036 * 037 */ 038 public void destroyMessageContainer(ActiveMQDestination dest) throws JMSException; 039 040 /** 041 * Returns an unmodifiable map, indexed by ActiveMQDestination, of all the {@link org.activemq.service.MessageContainerAdmin} 042 * objects available in this container 043 * 044 * @return the Map 045 * @throws JMSException 046 */ 047 public Map getMessageContainerAdmins() throws JMSException; 048 049 /** 050 * Returns an unmodifiable map, indexed by String name, of all the {@link javax.jms.Destination} 051 * objects available in this container 052 * 053 * @return 054 */ 055 public Map getDestinations(); 056 057 /** 058 * Returns an unmodifiable map, indexed by String name, of all the {@link javax.jms.Destination} 059 * objects used by non-broker consumers directly connected to this container 060 * 061 * @return 062 */ 063 public Map getLocalDestinations(); 064 065 /** 066 * @param client 067 * @param info 068 * @throws JMSException 069 */ 070 public abstract void addMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException; 071 072 /** 073 * @param client 074 * @param info 075 * @throws JMSException 076 */ 077 public abstract void removeMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException; 078 079 /** 080 * Delete a durable subscriber 081 * 082 * @param clientId 083 * @param subscriberName 084 * @throws JMSException if the subscriber doesn't exist or is still active 085 */ 086 public abstract void deleteSubscription(String clientId, String subscriberName) throws JMSException; 087 088 /** 089 * @param client 090 * @param message 091 * @throws JMSException 092 */ 093 public abstract void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException; 094 095 /** 096 * Acknowledge a message as being read and consumed by the Consumer 097 * 098 * @param client 099 * @param ack 100 * @throws JMSException 101 */ 102 public abstract void acknowledgeMessage(BrokerClient client, MessageAck ack) throws JMSException; 103 104 /** 105 * Poll for messages 106 * 107 * @throws JMSException 108 */ 109 public abstract void poll() throws JMSException; 110 111 /** 112 * Allows the lookup of a specific named message container 113 * 114 * @param physicalName 115 * @return the MessageContainer 116 * @throws JMSException 117 */ 118 public MessageContainer getContainer(String physicalName) throws JMSException; 119 120 /** 121 * @return the DeadLetterPolicy for this Container Manager 122 */ 123 public DeadLetterPolicy getDeadLetterPolicy(); 124 125 /** 126 * Set the DeadLetterPolicy for this Container Manager 127 * @param policy 128 */ 129 public void setDeadLetterPolicy(DeadLetterPolicy policy); 130 }