cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From koushik-das <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Removed unused methods from EventBus inte...
Date Thu, 24 Dec 2015 11:46:38 GMT
Github user koushik-das commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1260#discussion_r48411330
  
    --- Diff: plugins/event-bus/inmemory/src/org/apache/cloudstack/mom/inmemory/InMemoryEventBus.java
---
    @@ -58,34 +58,6 @@ public void setName(String name) {
         }
     
         @Override
    -    public UUID subscribe(EventTopic topic, EventSubscriber subscriber) throws EventBusException
{
    -        if (subscriber == null || topic == null) {
    -            throw new EventBusException("Invalid EventSubscriber/EventTopic object passed.");
    -        }
    -        UUID subscriberId = UUID.randomUUID();
    -
    -        subscribers.put(subscriberId, new Pair<EventTopic, EventSubscriber>(topic,
subscriber));
    -        return subscriberId;
    -    }
    -
    -    @Override
    -    public void unsubscribe(UUID subscriberId, EventSubscriber subscriber) throws EventBusException
{
    -        if (subscriberId == null) {
    -            throw new EventBusException("Cannot unregister a null subscriberId.");
    -        }
    -
    -        if (subscribers.isEmpty()) {
    -            throw new EventBusException("There are no registered subscribers to unregister.");
    -        }
    -
    -        if (!subscribers.containsKey(subscriberId)) {
    -            throw new EventBusException("No subscriber found with subscriber id " + subscriberId);
    -        } else {
    -            subscribers.remove(subscriberId);
    -        }
    -    }
    -
    -    @Override
    --- End diff --
    
    @pedro-martins Are you sure that this not used anywhere? The publish() method relies that
'subscribers' is not empty. And 'subscribers' is populated only in subscribe(). So as per
the code I am sure it is getting used but not directly invoked.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message