1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.messaging;
16  
17  import java.util.Collection;
18  
19  /**
20   * <a href="MessageBus.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Michael C. Han
23   */
24  public interface MessageBus {
25  
26      public void addDestination(Destination destination);
27  
28      public void addDestinationEventListener(
29          DestinationEventListener destinationEventListener);
30  
31      public void addDestinationEventListener(
32          String destinationName,
33          DestinationEventListener destinationEventListener);
34  
35      public Destination getDestination(String destinationName);
36  
37      public int getDestinationCount();
38  
39      public Collection<String> getDestinationNames();
40  
41      public Collection<Destination> getDestinations();
42  
43      public boolean hasDestination(String destinationName);
44  
45      public boolean hasMessageListener(String destinationName);
46  
47      public boolean registerMessageListener(
48          String destinationName, MessageListener messageListener);
49  
50      public Destination removeDestination(String destinationName);
51  
52      public void removeDestinationEventListener(
53          DestinationEventListener destinationEventListener);
54  
55      public void removeDestinationEventListener(
56          String destinationName,
57          DestinationEventListener destinationEventListener);
58  
59      public void replace(Destination destination);
60  
61      public void sendMessage(String destinationName, Message message);
62  
63      public void shutdown();
64  
65      public void shutdown(boolean force);
66  
67      public boolean unregisterMessageListener(
68          String destinationName, MessageListener messageListener);
69  
70  }