1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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  }