1 /**
2 * Copyright 2005-2006 the original author or authors.
3 *
4 * Licensed under the Gnu General Pubic License, Version 2.0 (the
5 * "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/gpl-license.php
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the Gnu General Public License for more details.
14 */
15 package org.figure8.join.core.messaging;
16
17 import org.figure8.join.core.InfrastructureException;
18 import org.figure8.join.core.DuplicateEntityException;
19
20 import java.util.List;
21 /**
22 * This is an interface definition of a manager of JMS consumers. It allows
23 * consumers lifecycle operations (creation, retrieval, update & remove) and
24 * also their activation / deactivation process control.
25 * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
26 * @version $Revision: 1.2 $
27 */
28 public interface JMSConsumerBeanManager{
29
30
31
32 /**
33 * Save a JMSConsumerBean infos within datastore. This method should also
34 * control the status of eventually existing consumers, depending on <b>active</b>
35 * attribute of the info bean.
36 * @param info The info on a JMSConsumerBean to save
37 * @throws DuplicateEntityException if another consumer with same name already exists.
38 * @throws InfrastructureException if wrapped JCA container cannot activate consumer.
39 */
40 public abstract void saveConsumerBeanInfo(JMSConsumerBeanInfo info) throws DuplicateEntityException,
41 InfrastructureException;
42
43 /**
44 * Remove a JMSConsumerBean infos from datastore. This method should also
45 * stop existing consumer instances before removing the related informations.
46 * @param info The info on a JMSConsumerBean to remove
47 */
48 public abstract void removeConsumerBeanInfo(JMSConsumerBeanInfo info);
49
50 /**
51 * Retrieve the info object having the spoecified name.
52 * @param name Name of the consumer bean info object to retrieve
53 * @return The {@code JMSConsumerBeanInfo} having this name, or null if none
54 */
55 public abstract JMSConsumerBeanInfo getConsumerBeanInfo(String name);
56
57 /**
58 * Retrieve the info object corresponding to available <code>JMSConsumerBeans</code>.
59 * @return A List of {@code org.figure8.join.core.messaging.JMSConsumerBeanInfo}
60 */
61 public abstract List getConsumerBeanInfos();
62
63 /**
64 * Starts all the already saved and registered consumers. This method should
65 * be called on startup.
66 * @throws InfrastructureException if wrapped JCA container cannot activate consumer.
67 */
68 public abstract void startConsumers() throws InfrastructureException;
69
70 /**
71 * Stop all the already saved and registered consumers. This method should
72 * be called on shutdown.
73 */
74 public abstract void stopConsumers();
75 }