brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alasdairhodge <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Allow a UsageListener (i.e. for m...
Date Mon, 10 Nov 2014 09:32:55 GMT
Github user alasdairhodge commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/310#discussion_r20072489
  
    --- Diff: core/src/main/java/brooklyn/management/internal/UsageManager.java ---
    @@ -18,20 +18,47 @@
      */
     package brooklyn.management.internal;
     
    +import java.util.List;
    +import java.util.Map;
     import java.util.Set;
     
    +import brooklyn.config.ConfigKey;
     import brooklyn.entity.Application;
    +import brooklyn.entity.basic.ConfigKeys;
     import brooklyn.entity.basic.Lifecycle;
     import brooklyn.location.Location;
     import brooklyn.management.usage.ApplicationUsage;
    +import brooklyn.management.usage.ApplicationUsage.ApplicationEvent;
     import brooklyn.management.usage.LocationUsage;
    +import brooklyn.management.usage.LocationUsage.LocationEvent;
     
     import com.google.common.annotations.Beta;
     import com.google.common.base.Predicate;
    +import com.google.common.collect.ImmutableList;
    +import com.google.common.reflect.TypeToken;
     
     @Beta
     public interface UsageManager {
     
    +    @SuppressWarnings("serial")
    +    public static final ConfigKey<List<UsageListener>> USAGE_LISTENERS =
ConfigKeys.newConfigKey(
    +            new TypeToken<List<UsageListener>>() {},
    +            "brooklyn.usageManager.listeners", "Optional usage listeners (i.e. for metering)",
    +            ImmutableList.<UsageListener>of());
    +
    +    public static interface UsageListener {
    --- End diff --
    
    Also, there's nothing about this interface's methods that suggests "usage" or "billing",
despite the initial use-case. Perhaps a more neutral name is apt, how about `ManagementEventListener`?


---
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