brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [12/13] incubator-brooklyn git commit: Use entity.sensors().* etc, instead of deprecated methods
Date Wed, 07 Oct 2015 09:31:42 GMT
Use entity.sensors().* etc, instead of deprecated methods


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/4d08310c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/4d08310c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/4d08310c

Branch: refs/heads/master
Commit: 4d08310c3b60a299086af179a35d8449b24e81ce
Parents: 8636eb3
Author: Aled Sage <aled.sage@gmail.com>
Authored: Mon Sep 21 14:48:29 2015 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Mon Oct 5 15:41:26 2015 +0100

----------------------------------------------------------------------
 .../org/apache/brooklyn/api/policy/Policy.java  |   2 +-
 .../core/enricher/AbstractEnricher.java         |   4 +-
 .../core/entity/AbstractApplication.java        |   2 +-
 .../brooklyn/core/entity/AbstractEntity.java    |  20 +--
 .../apache/brooklyn/core/entity/Entities.java   |   4 +-
 .../brooklyn/core/entity/EntityAdjuncts.java    |   2 +-
 .../core/entity/EntityAndAttribute.java         |   2 +-
 .../brooklyn/core/entity/EntityDynamicType.java |  12 +-
 .../brooklyn/core/entity/EntityFunctions.java   |   2 +-
 .../entity/lifecycle/ServiceStateLogic.java     |  14 +-
 .../core/feed/AttributePollHandler.java         |   2 +-
 .../brooklyn/core/feed/ConfigToAttributes.java  |   2 +-
 .../access/PortForwardManagerClient.java        |   2 +-
 .../core/mgmt/internal/LocalEntityManager.java  |   3 +-
 .../mgmt/persist/BrooklynPersistenceUtils.java  |   4 +-
 .../mgmt/rebind/BasicEntityRebindSupport.java   |   7 +-
 .../rebind/PeriodicDeltaChangeListener.java     |   4 +-
 .../mgmt/rebind/dto/MementosGenerators.java     |   4 +-
 .../core/objs/AbstractEntityAdjunct.java        |   4 +-
 .../core/objs/proxy/InternalEntityFactory.java  |  10 +-
 .../objs/proxy/InternalLocationFactory.java     |   2 +-
 .../apache/brooklyn/core/policy/Policies.java   |   4 +-
 .../brooklyn/core/sensor/StaticSensor.java      |   2 +-
 .../core/server/entity/BrooklynMetricsImpl.java |  14 +-
 .../stock/AbstractAggregatingEnricher.java      |   8 +-
 .../enricher/stock/AbstractAggregator.java      |  10 +-
 .../stock/AbstractMultipleSensorAggregator.java |   4 +-
 .../enricher/stock/AbstractTransformer.java     |   2 +-
 .../stock/AbstractTypeTransformingEnricher.java |   2 +-
 .../brooklyn/enricher/stock/AddingEnricher.java |   6 +-
 .../brooklyn/enricher/stock/Aggregator.java     |   6 +-
 .../brooklyn/enricher/stock/Combiner.java       |   2 +-
 .../stock/CustomAggregatingEnricher.java        |   2 +-
 .../apache/brooklyn/enricher/stock/Joiner.java  |   2 +-
 .../brooklyn/enricher/stock/Propagator.java     |   6 +-
 .../stock/SensorPropagatingEnricher.java        |  10 +-
 .../stock/SensorTransformingEnricher.java       |   4 +-
 .../entity/group/AbstractGroupImpl.java         |  28 ++--
 .../group/AbstractMembershipTrackingPolicy.java |   8 +-
 .../entity/group/DynamicClusterImpl.java        |  22 +--
 .../entity/group/DynamicFabricImpl.java         |   8 +-
 .../brooklyn/entity/group/DynamicGroupImpl.java |   6 +-
 .../entity/group/DynamicMultiGroupImpl.java     |   4 +-
 .../entity/stock/BasicStartableImpl.java        |   4 +-
 .../brooklyn/entity/stock/DataEntityImpl.java   |   4 +-
 .../entity/stock/DelegateEntityImpl.java        |   6 +-
 .../windows/WindowsPerformanceCounterFeed.java  |   6 +-
 .../winrm/AdvertiseWinrmLoginPolicy.java        |   4 +-
 .../brooklyn/util/core/flags/FlagUtils.java     |   2 +-
 .../config/MapConfigKeyAndFriendsMoreTest.java  | 100 ++++++------
 ...apListAndOtherStructuredConfigKeyTest.groovy | 112 +++++++-------
 .../core/enricher/BasicEnricherTest.java        |  12 +-
 .../core/enricher/EnricherConfigTest.java       |  18 +--
 .../brooklyn/core/entity/AttributeMapTest.java  |   2 +-
 .../brooklyn/core/entity/AttributeTest.java     |   4 +-
 .../entity/ConfigEntityInheritanceTest.java     |   6 +-
 .../core/entity/DependentConfigurationTest.java |  44 +++---
 .../brooklyn/core/entity/EntitiesTest.java      |   6 +-
 .../core/entity/EntityFunctionsTest.java        |   4 +-
 .../core/entity/EntityLocationsTest.java        |   8 +-
 .../core/entity/EntityPreManagementTest.java    |  14 +-
 .../core/entity/EntityPredicatesTest.java       |   4 +-
 .../core/entity/EntityRegistrationTest.java     |   4 +-
 .../brooklyn/core/entity/EntitySpecTest.java    |  12 +-
 .../core/entity/EntitySubscriptionTest.java     |  44 +++---
 .../brooklyn/core/entity/EntityTypeTest.java    |   4 +-
 .../core/entity/PolicyRegistrationTest.java     |  48 +++---
 .../downloads/BasicDownloadsRegistryTest.java   |  26 ++--
 .../DownloadProducerFromLocalRepoTest.java      |   6 +-
 .../DownloadProducerFromPropertiesTest.java     |   6 +-
 .../downloads/DownloadSubstitutersTest.java     |   8 +-
 .../core/entity/hello/HelloEntityImpl.java      |   4 +-
 .../core/entity/hello/LocalEntitiesTest.java    |  16 +-
 .../entity/internal/ConfigMapGroovyTest.groovy  |   2 +-
 .../core/entity/internal/ConfigMapTest.java     |  14 +-
 .../EntityConfigMapUsageLegacyTest.java         |  32 ++--
 .../internal/EntityConfigMapUsageTest.java      |  20 +--
 .../entity/lifecycle/ServiceStateLogicTest.java |   8 +-
 .../core/location/LocationPredicatesTest.java   |   2 +-
 .../access/BrooklynAccessUtilsTest.java         |   2 +-
 .../access/PortForwardManagerRebindTest.java    |   4 +-
 .../ha/HighAvailabilityManagerInMemoryTest.java |   2 +-
 .../HighAvailabilityManagerSplitBrainTest.java  |   2 +-
 .../brooklyn/core/mgmt/ha/HotStandbyTest.java   |  16 +-
 .../internal/EntityExecutionManagerTest.java    |   4 +-
 .../internal/LocalSubscriptionManagerTest.java  |  16 +-
 .../mgmt/osgi/OsgiVersionMoreEntityTest.java    |   6 +-
 ...ntoPersisterInMemorySizeIntegrationTest.java |   4 +-
 .../BrooklynMementoPersisterTestFixture.java    |   4 +-
 .../core/mgmt/rebind/CheckpointEntityTest.java  |   4 +-
 .../mgmt/rebind/RebindCatalogEntityTest.java    |   2 +-
 .../core/mgmt/rebind/RebindEnricherTest.java    |  48 +++---
 .../rebind/RebindEntityDynamicTypeInfoTest.java |   6 +-
 .../core/mgmt/rebind/RebindEntityTest.java      |  36 ++---
 .../core/mgmt/rebind/RebindFailuresTest.java    |   8 +-
 .../core/mgmt/rebind/RebindFeedTest.java        |   8 +-
 .../core/mgmt/rebind/RebindFeedWithHaTest.java  |   4 +-
 .../core/mgmt/rebind/RebindManagerTest.java     |   2 +-
 .../core/mgmt/rebind/RebindPolicyTest.java      |  50 +++---
 .../transformer/CompoundTransformerTest.java    |   4 +-
 .../core/policy/basic/BasicPolicyTest.java      |   6 +-
 .../core/policy/basic/PolicyConfigTest.java     |  22 +--
 .../policy/basic/PolicySubscriptionTest.java    |  30 ++--
 .../core/sensor/http/HttpRequestSensorTest.java |   2 +-
 .../ssh/SshCommandSensorIntegrationTest.java    |   2 +-
 .../core/server/entity/BrooklynMetricsTest.java |   4 +-
 .../core/test/entity/TestClusterImpl.java       |   2 +-
 .../core/test/entity/TestEntityImpl.java        |   6 +-
 .../EntityCleanupLongevityTestFixture.java      |   6 +-
 .../qa/performance/EntityPerformanceTest.java   |   6 +-
 .../EntityPersistencePerformanceTest.java       |   8 +-
 ...stomAggregatingEnricherDeprecatedTest.groovy |  46 +++---
 .../stock/CustomAggregatingEnricherTest.java    | 120 +++++++--------
 .../brooklyn/enricher/stock/EnrichersTest.java  | 151 +++++++++----------
 ...SensorPropagatingEnricherDeprecatedTest.java |  26 ++--
 .../stock/SensorPropagatingEnricherTest.java    |  58 +++----
 .../TransformingEnricherDeprecatedTest.groovy   |   4 +-
 .../stock/TransformingEnricherTest.java         |   4 +-
 .../YamlRollingTimeWindowMeanEnricherTest.java  |   4 +-
 .../YamlTimeWeightedDeltaEnricherTest.java      |   4 +-
 .../entity/group/DynamicClusterTest.java        |   2 +-
 ...DynamicClusterWithAvailabilityZonesTest.java |  14 +-
 .../brooklyn/entity/group/DynamicGroupTest.java |  49 +++---
 .../entity/group/DynamicMultiGroupTest.java     |  26 ++--
 .../entity/group/GroupPickUpEntitiesTest.java   |  16 +-
 .../apache/brooklyn/entity/group/GroupTest.java |  10 +-
 .../group/MembershipTrackingPolicyTest.java     |  44 +++---
 .../feed/function/FunctionFeedTest.java         |   4 +-
 .../apache/brooklyn/feed/http/HttpFeedTest.java |   4 +-
 .../feed/ssh/SshFeedIntegrationTest.java        |   2 +-
 .../WindowsPerformanceCounterFeedLiveTest.java  |   2 +-
 ...stMachineProvisioningLocationRebindTest.java |   2 +-
 .../brooklyn/util/core/task/TasksTest.java      |  12 +-
 .../util/core/task/ssh/SshTasksTest.java        |   4 +-
 .../util/core/text/TemplateProcessorTest.java   |   2 +-
 .../brooklyn/demo/CumulusRDFApplication.java    |   2 +-
 .../brooklyn/demo/ResilientMongoDbApp.java      |  10 +-
 .../demo/WebClusterDatabaseExample.java         |   8 +-
 .../demo/WebClusterDatabaseExampleApp.java      |   8 +-
 .../demo/WebClusterDatabaseExampleGroovy.groovy |   2 +-
 .../apache/brooklyn/demo/WebClusterExample.java |   2 +-
 ...lusterDatabaseExampleAppIntegrationTest.java |   6 +-
 .../policy/jclouds/os/CreateUserPolicy.java     |   4 +-
 .../location/jclouds/LiveTestEntity.java        |   8 +-
 .../jclouds/RebindJcloudsLocationLiveTest.java  |   2 +-
 .../policy/autoscaling/AutoScalerPolicy.java    |  10 +-
 .../brooklyn/policy/enricher/DeltaEnricher.java |   2 +-
 .../policy/enricher/HttpLatencyDetector.java    |   6 +-
 .../policy/enricher/RollingMeanEnricher.java    |   2 +-
 .../enricher/RollingTimeWindowMeanEnricher.java |   2 +-
 .../enricher/TimeFractionDeltaEnricher.java     |   2 +-
 .../enricher/TimeWeightedDeltaEnricher.java     |   4 +-
 .../policy/followthesun/FollowTheSunPolicy.java |  16 +-
 .../followthesun/FollowTheSunPoolImpl.java      |  28 ++--
 .../policy/ha/AbstractFailureDetector.java      |   4 +-
 .../policy/ha/ConditionalSuspendPolicy.java     |   6 +-
 .../policy/ha/ServiceFailureDetector.java       |   4 +-
 .../brooklyn/policy/ha/ServiceReplacer.java     |   4 +-
 .../brooklyn/policy/ha/ServiceRestarter.java    |   4 +-
 .../BalanceableWorkerPoolImpl.java              |  26 ++--
 .../ItemsInContainersGroupImpl.java             |   6 +-
 .../loadbalancing/LoadBalancingPolicy.java      |  18 +--
 .../autoscaling/AutoScalerPolicyMetricTest.java |  60 ++++----
 .../autoscaling/AutoScalerPolicyRebindTest.java |  10 +-
 .../AutoScalerPolicyReconfigurationTest.java    |  32 ++--
 .../autoscaling/AutoScalerPolicyTest.java       | 132 ++++++++--------
 .../autoscaling/LocallyResizableEntity.java     |   2 +-
 .../policy/enricher/DeltaEnrichersTests.groovy  |   8 +-
 .../enricher/HttpLatencyDetectorTest.java       |  18 +--
 .../policy/enricher/RebindEnricherTest.java     |  32 ++--
 .../enricher/RollingMeanEnricherTest.groovy     |   6 +-
 .../RollingTimeWindowMeanEnricherTest.groovy    |   4 +-
 .../enricher/TimeFractionDeltaEnricherTest.java |   6 +-
 .../AbstractFollowTheSunPolicyTest.java         |   6 +-
 .../FollowTheSunPolicySoakTest.java             |   2 +-
 .../followthesun/FollowTheSunPolicyTest.java    |  35 +++--
 .../ha/ConnectionFailureDetectorTest.java       |  20 +--
 .../brooklyn/policy/ha/HaPolicyRebindTest.java  |  14 +-
 ...ServiceFailureDetectorStabilizationTest.java |  44 +++---
 .../policy/ha/ServiceFailureDetectorTest.java   |  78 +++++-----
 .../brooklyn/policy/ha/ServiceReplacerTest.java |  28 ++--
 .../policy/ha/ServiceRestarterTest.java         |  28 ++--
 .../AbstractLoadBalancingPolicyTest.java        |   7 +-
 .../LoadBalancingPolicyConcurrencyTest.java     |   2 +-
 .../LoadBalancingPolicySoakTest.java            |   2 +-
 .../loadbalancing/LoadBalancingPolicyTest.java  |   8 +-
 .../loadbalancing/MockContainerEntityImpl.java  |  15 +-
 .../loadbalancing/MockItemEntityImpl.java       |   4 +-
 .../postgresql/PostgreSqlNodeSaltImpl.java      |   2 +-
 .../brooklyn/entity/salt/SaltConfigs.java       |   8 +-
 .../entity/salt/SaltLifecycleEffectorTasks.java |   4 +-
 .../entity/monitoring/zabbix/ZabbixFeed.java    |   2 +-
 .../monitoring/zabbix/ZabbixServerImpl.java     |   4 +-
 .../nosql/hazelcast/HazelcastClusterImpl.java   |   8 +-
 .../nosql/hazelcast/HazelcastNodeImpl.java      |   2 +-
 .../nosql/hazelcast/HazelcastNodeSshDriver.java |   2 +-
 .../Infinispan5ServerIntegrationTest.groovy     |   2 +-
 .../brooklynnode/BrooklynClusterImpl.java       |   2 +-
 .../brooklynnode/BrooklynEntityMirrorImpl.java  |   8 +-
 .../entity/brooklynnode/BrooklynNodeImpl.java   |   4 +-
 .../brooklynnode/LocalBrooklynNodeImpl.java     |   4 +-
 .../BrooklynClusterUpgradeEffectorBody.java     |   4 +-
 .../BrooklynNodeUpgradeEffectorBody.java        |   8 +-
 .../brooklyn/entity/chef/ChefAttributeFeed.java |   8 +-
 .../brooklyn/entity/chef/ChefConfigs.java       |   8 +-
 .../entity/chef/ChefLifecycleEffectorTasks.java |   6 +-
 .../brooklyn/entity/java/JavaAppUtils.java      |   4 +-
 .../java/JavaSoftwareProcessSshDriver.java      |   2 +-
 .../apache/brooklyn/entity/java/JmxSupport.java |  12 +-
 .../entity/java/VanillaJavaAppImpl.java         |   4 +-
 .../entity/java/VanillaJavaAppSshDriver.java    |   4 +-
 .../entity/machine/pool/ServerPoolImpl.java     |  40 ++---
 .../base/AbstractSoftwareProcessSshDriver.java  |  12 +-
 .../AbstractSoftwareProcessWinRmDriver.java     |   4 +-
 .../software/base/SameServerEntityImpl.java     |   2 +-
 .../software/base/SoftwareProcessImpl.java      |  20 +--
 .../base/VanillaWindowsProcessImpl.java         |   4 +-
 .../base/VanillaWindowsProcessWinRmDriver.java  |   2 +-
 .../MachineLifecycleEffectorTasks.java          |  28 ++--
 .../system_service/SystemServiceEnricher.java   |   2 +-
 .../org/apache/brooklyn/feed/jmx/JmxHelper.java |   2 +-
 .../BrooklynNodeIntegrationTest.java            |   2 +-
 .../entity/brooklynnode/BrooklynNodeTest.java   |   2 +-
 .../entity/brooklynnode/MockBrooklynNode.java   |   2 +-
 .../brooklynnode/SameBrooklynNodeImpl.java      |   4 +-
 .../brooklynnode/SelectMasterEffectorTest.java  |   4 +-
 .../entity/chef/ChefLiveTestSupport.java        |   2 +-
 .../chef/mysql/TypedToyMySqlEntityChef.java     |  12 +-
 .../brooklyn/entity/java/JavaOptsTest.java      |   2 +-
 .../brooklyn/entity/java/JmxSupportTest.java    |   8 +-
 .../entity/java/VanillaJavaAppRebindTest.java   |   4 +-
 .../entity/java/VanillaJavaAppTest.java         |   8 +-
 .../base/DoNothingSoftwareProcessImpl.java      |   2 +-
 .../base/SoftwareProcessEntityLatchTest.java    |   2 +-
 .../base/SoftwareProcessEntityRebindTest.java   |   4 +-
 .../base/SoftwareProcessEntityTest.java         |  14 +-
 ...SoftwareProcessSshDriverIntegrationTest.java |  18 +--
 .../MachineLifecycleEffectorTasksTest.java      |   4 +-
 .../base/lifecycle/StartStopSshDriverTest.java  |   4 +-
 .../mysql/DynamicToyMySqlEntityBuilder.java     |   6 +-
 .../apache/brooklyn/feed/jmx/JmxFeedTest.java   |  12 +-
 .../brooklyn/feed/jmx/RebindJmxFeedTest.java    |  10 +-
 .../entity/database/crate/CrateNodeImpl.java    |   6 +-
 .../database/mariadb/MariaDbNodeImpl.java       |   8 +-
 .../database/mariadb/MariaDbSshDriver.java      |   2 +-
 .../entity/database/mysql/MySqlClusterImpl.java |  29 ++--
 .../entity/database/mysql/MySqlNodeImpl.java    |   8 +-
 .../entity/database/mysql/MySqlSshDriver.java   |   4 +-
 .../PostgreSqlNodeChefImplFromScratch.java      |   2 +-
 .../database/postgresql/PostgreSqlNodeImpl.java |   2 +-
 .../postgresql/PostgreSqlSshDriver.java         |   4 +-
 .../database/rubyrep/RubyRepNodeImpl.java       |   4 +-
 .../database/rubyrep/RubyRepSshDriver.java      |   2 +-
 .../messaging/activemq/ActiveMQBrokerImpl.java  |   4 +-
 .../messaging/activemq/ActiveMQQueueImpl.java   |   2 +-
 .../messaging/activemq/ActiveMQTopicImpl.java   |   2 +-
 .../entity/messaging/kafka/KafkaBrokerImpl.java |  13 +-
 .../messaging/kafka/KafkaClusterImpl.java       |  16 +-
 .../entity/messaging/qpid/QpidBrokerImpl.java   |   2 +-
 .../messaging/qpid/QpidDestinationImpl.java     |   2 +-
 .../entity/messaging/qpid/QpidQueueImpl.java    |   2 +-
 .../entity/messaging/qpid/QpidTopicImpl.java    |   2 +-
 .../messaging/rabbit/RabbitBrokerImpl.java      |   4 +-
 .../messaging/rabbit/RabbitDestination.java     |   2 +-
 .../entity/messaging/rabbit/RabbitQueue.java    |   2 +-
 .../messaging/storm/StormDeploymentImpl.java    |  10 +-
 .../entity/messaging/storm/StormImpl.java       |   2 +-
 .../entity/zookeeper/ZooKeeperEnsembleImpl.java |   6 +-
 .../entity/monitoring/monit/MonitNodeImpl.java  |   2 +-
 .../entity/network/bind/BindDnsServerImpl.java  |  28 ++--
 .../bind/BindDnsServerIntegrationTest.java      |   4 +-
 .../network/bind/PrefixAndIdEnricher.java       |   4 +-
 .../cassandra/CassandraDatacenterImpl.java      |  18 +--
 .../nosql/cassandra/CassandraFabricImpl.java    |  10 +-
 .../nosql/cassandra/CassandraNodeImpl.java      |  14 +-
 .../nosql/couchbase/CouchbaseClusterImpl.java   |  36 ++---
 .../nosql/couchbase/CouchbaseNodeImpl.java      |   4 +-
 .../nosql/couchbase/CouchbaseNodeSshDriver.java |  12 +-
 .../couchbase/CouchbaseSyncGatewayImpl.java     |   2 +-
 .../entity/nosql/couchdb/CouchDBNodeImpl.java   |   4 +-
 .../nosql/couchdb/CouchDBNodeSshDriver.java     |   2 +-
 .../ElasticSearchNodeSshDriver.java             |   2 +-
 .../entity/nosql/mongodb/MongoDBClientImpl.java |   2 +-
 .../nosql/mongodb/MongoDBReplicaSetImpl.java    |  14 +-
 .../entity/nosql/mongodb/MongoDBServerImpl.java |   2 +-
 .../sharding/CoLocatedMongoDBRouterImpl.java    |   2 +-
 .../sharding/MongoDBRouterClusterImpl.java      |   8 +-
 .../sharding/MongoDBShardClusterImpl.java       |   4 +-
 .../sharding/MongoDBShardedDeploymentImpl.java  |   4 +-
 .../entity/nosql/redis/RedisClusterImpl.java    |   2 +-
 .../entity/nosql/riak/RiakClusterImpl.java      |  26 ++--
 .../entity/nosql/riak/RiakNodeImpl.java         |   4 +-
 .../entity/nosql/riak/RiakNodeSshDriver.java    |  14 +-
 .../entity/nosql/solr/SolrServerImpl.java       |   2 +-
 .../entity/osgi/karaf/KarafContainerImpl.java   |  28 ++--
 .../entity/dns/AbstractGeoDnsServiceImpl.java   |   8 +-
 .../geoscaling/GeoscalingDnsServiceImpl.java    |  16 +-
 .../entity/proxy/AbstractControllerImpl.java    |  20 +--
 .../AbstractNonProvisionedControllerImpl.java   |   8 +-
 .../entity/proxy/nginx/NginxControllerImpl.java |  12 +-
 .../entity/proxy/nginx/NginxSshDriver.java      |  12 +-
 .../entity/proxy/nginx/UrlMappingImpl.java      |  10 +-
 .../ControlledDynamicWebAppClusterImpl.java     |  20 +--
 .../entity/webapp/DynamicWebAppClusterImpl.java |  12 +-
 .../entity/webapp/DynamicWebAppFabricImpl.java  |   4 +-
 .../webapp/JavaWebAppSoftwareProcessImpl.java   |  10 +-
 .../entity/webapp/JavaWebAppSshDriver.java      |   4 +-
 .../entity/webapp/WebAppServiceMethods.java     |   8 +-
 .../entity/webapp/jboss/JBoss6SshDriver.java    |   2 +-
 .../entity/webapp/jboss/JBoss7ServerImpl.java   |   4 +-
 .../entity/webapp/jboss/JBoss7SshDriver.java    |   4 +-
 .../entity/webapp/jetty/Jetty6ServerImpl.java   |   2 +-
 .../webapp/nodejs/NodeJsWebAppServiceImpl.java  |   4 +-
 .../webapp/nodejs/NodeJsWebAppSshDriver.java    |   4 +-
 .../entity/dns/AbstractGeoDnsServiceTest.java   |  10 +-
 .../geoscaling/GeoscalingIntegrationTest.java   |  12 +-
 .../entity/proxy/AbstractControllerTest.java    |  50 +++---
 .../brooklyn/entity/proxy/StubAppServer.java    |   8 +-
 .../proxy/TrackingAbstractControllerImpl.java   |   2 +-
 .../brooklyn/entity/proxy/UrlMappingTest.java   |   4 +-
 .../nginx/NginxHttpsSslIntegrationTest.java     |   4 +-
 .../AbstractWebAppFixtureIntegrationTest.java   |   4 +-
 ...lledDynamicWebAppClusterIntegrationTest.java |   2 +-
 .../ControlledDynamicWebAppClusterTest.java     |   4 +-
 .../entity/webapp/DynamicWebAppClusterTest.java |   4 +-
 .../entity/webapp/DynamicWebAppFabricTest.java  |   4 +-
 .../webapp/ElasticCustomLocationTest.java       |   4 +-
 .../webapp/TomcatAutoScalerPolicyTest.java      |   2 +-
 .../test/entity/TestJavaWebAppEntity.java       |   8 +-
 .../test/entity/TestJavaWebAppEntityImpl.java   |   2 +-
 .../camp/brooklyn/DslAndRebindYamlTest.java     |   4 +-
 .../EnrichersSlightlySimplerYamlTest.java       |  14 +-
 .../camp/brooklyn/EnrichersYamlTest.java        |   4 +-
 .../brooklyn/JavaWebAppsIntegrationTest.java    |   2 +-
 .../camp/brooklyn/PoliciesYamlTest.java         |   8 +-
 .../TestSensorAndEffectorInitializer.java       |   4 +-
 .../CatalogOsgiVersionMoreEntityTest.java       |   6 +-
 .../brooklyn/catalog/CatalogYamlPolicyTest.java |   6 +-
 .../brooklyn/catalog/CatalogYamlRebindTest.java |   8 +-
 .../BrooklynEntityMirrorIntegrationTest.java    |   8 +-
 .../brooklynnode/BrooklynNodeRestTest.java      |   2 +-
 .../qa/load/SimulatedJBoss7ServerImpl.java      |  18 +--
 .../qa/load/SimulatedMySqlNodeImpl.java         |   6 +-
 .../qa/load/SimulatedNginxControllerImpl.java   |   8 +-
 .../brooklyn/qa/load/SimulatedTheeTierApp.java  |   6 +-
 .../webcluster/SinusoidalLoadGenerator.java     |   2 +-
 .../qa/longevity/webcluster/WebClusterApp.java  |   4 +-
 .../brooklyn/rest/resources/PolicyResource.java |  19 ++-
 .../brooklyn/rest/resources/SensorResource.java |   4 +-
 .../rest/util/BrooklynRestResourceUtils.java    |   6 +-
 .../brooklyn/rest/domain/SensorSummaryTest.java |   2 +-
 .../rest/resources/ApplicationResourceTest.java |   4 +-
 .../rest/resources/DescendantsTest.java         |   4 +-
 .../rest/resources/SensorResourceTest.java      |   2 +-
 .../brooklynnode/DeployBlueprintTest.java       |   2 +-
 .../testing/mocks/RestMockSimpleEntity.java     |   2 +-
 .../util/BrooklynRestResourceUtilsTest.java     |   2 +-
 .../apache/brooklyn/test/EntityTestUtils.java   |   4 +-
 358 files changed, 1910 insertions(+), 1908 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/api/src/main/java/org/apache/brooklyn/api/policy/Policy.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/brooklyn/api/policy/Policy.java b/api/src/main/java/org/apache/brooklyn/api/policy/Policy.java
index 171bff7..957da0a 100644
--- a/api/src/main/java/org/apache/brooklyn/api/policy/Policy.java
+++ b/api/src/main/java/org/apache/brooklyn/api/policy/Policy.java
@@ -65,7 +65,7 @@ public interface Policy extends EntityAdjunct, Rebindable, Configurable {
     <T> T getConfig(ConfigKey<T> key);
     
     /**
-     * @deprecated since 0.7.0; use {@link #config()}, such as {@code policy.config().setConfig(key, val)}
+     * @deprecated since 0.7.0; use {@link #config()}, such as {@code policy.config().set(key, val)}
      */
     @Deprecated
     <T> T setConfig(ConfigKey<T> key, T val);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java b/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java
index 0dc36f6..8c3f41e 100644
--- a/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java
+++ b/core/src/main/java/org/apache/brooklyn/core/enricher/AbstractEnricher.java
@@ -106,9 +106,9 @@ public abstract class AbstractEnricher extends AbstractEntityAdjunct implements
                 if (Objects.equal(oldValue, newVal))
                     return;
             }
-            entity.setAttribute((AttributeSensor<T>)sensor, newVal);
+            entity.sensors().set((AttributeSensor<T>)sensor, newVal);
         } else { 
-            entity.emit(sensor, newVal);
+            entity.sensors().emit(sensor, newVal);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java
index 03bfe31..e000997 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java
@@ -200,7 +200,7 @@ public abstract class AbstractApplication extends AbstractEntity implements Star
         logApplicationLifecycle("Stopping");
 
         ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application stopping");
-        setAttribute(SERVICE_UP, false);
+        sensors().set(SERVICE_UP, false);
         setExpectedStateAndRecordLifecycleEvent(Lifecycle.STOPPING);
         try {
             doStop();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
index e432717..b1b1d27 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
@@ -644,7 +644,7 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
         // TODO not holding synchronization lock while notifying risks out-of-order if addChild+removeChild called in rapid succession.
         // But doing notification in synchronization block may risk deadlock?
         if (changed) {
-            emit(AbstractEntity.CHILD_ADDED, child);
+            sensors().emit(AbstractEntity.CHILD_ADDED, child);
         }
         return child;
     }
@@ -682,7 +682,7 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
         }
         
         if (changed) {
-            emit(AbstractEntity.CHILD_REMOVED, child);
+            sensors().emit(AbstractEntity.CHILD_REMOVED, child);
         }
         return changed;
     }
@@ -721,7 +721,7 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
             getApplication();
             
             if (changed) {
-                emit(AbstractEntity.GROUP_ADDED, group);
+                sensors().emit(AbstractEntity.GROUP_ADDED, group);
             }
         }
 
@@ -731,7 +731,7 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
             getApplication();
             
             if (changed) {
-                emit(AbstractEntity.GROUP_REMOVED, group);
+                sensors().emit(AbstractEntity.GROUP_REMOVED, group);
             }
         }
     }
@@ -847,7 +847,7 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
             }
             
             for (Location loc : truelyNewLocations) {
-                emit(AbstractEntity.LOCATION_ADDED, loc);
+                sensors().emit(AbstractEntity.LOCATION_ADDED, loc);
             }
         }
         
@@ -869,7 +869,7 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
             locations.set(MutableList.<Location>builder().addAll(oldLocations).removeAll(removedLocations).buildImmutable());
             
             for (Location loc : trulyRemovedLocations) {
-                emit(AbstractEntity.LOCATION_REMOVED, loc);
+                sensors().emit(AbstractEntity.LOCATION_REMOVED, loc);
             }
         }
         
@@ -1577,8 +1577,8 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
     // these enrichers do nothing unless Attributes.SERVICE_NOT_UP_INDICATORS are used
     // and/or SERVICE_STATE_EXPECTED 
     protected void initEnrichers() {
-        addEnricher(ServiceNotUpLogic.newEnricherForServiceUpIfNotUpIndicatorsEmpty());
-        addEnricher(ServiceStateLogic.newEnricherForServiceStateFromProblemsAndUp());
+        enrichers().add(ServiceNotUpLogic.newEnricherForServiceUpIfNotUpIndicatorsEmpty());
+        enrichers().add(ServiceStateLogic.newEnricherForServiceStateFromProblemsAndUp());
     }
     
     // -------- POLICIES --------------------
@@ -1632,7 +1632,7 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
             ((AbstractPolicy)policy).setEntity(AbstractEntity.this);
             
             getManagementSupport().getEntityChangeListener().onPolicyAdded(policy);
-            emit(AbstractEntity.POLICY_ADDED, new PolicyDescriptor(policy));
+            sensors().emit(AbstractEntity.POLICY_ADDED, new PolicyDescriptor(policy));
         }
 
         @Override
@@ -1649,7 +1649,7 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
             
             if (changed) {
                 getManagementSupport().getEntityChangeListener().onPolicyRemoved(policy);
-                emit(AbstractEntity.POLICY_REMOVED, new PolicyDescriptor(policy));
+                sensors().emit(AbstractEntity.POLICY_REMOVED, new PolicyDescriptor(policy));
             }
             return changed;
         }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java b/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
index c2c2195..a9616d8 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
@@ -377,14 +377,14 @@ public class Entities {
 
         if (!e.getPolicies().isEmpty()) {
             out.append(currentIndentation+tab+tab+"Policies:\n");
-            for (Policy policy : e.getPolicies()) {
+            for (Policy policy : e.policies()) {
                 dumpInfo(policy, out, currentIndentation+tab+tab+tab, tab);
             }
         }
 
         if (!e.getEnrichers().isEmpty()) {
             out.append(currentIndentation+tab+tab+"Enrichers:\n");
-            for (Enricher enricher : e.getEnrichers()) {
+            for (Enricher enricher : e.enrichers()) {
                 dumpInfo(enricher, out, currentIndentation+tab+tab+tab, tab);
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java b/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java
index f5a6633..fc1daf4 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java
@@ -53,7 +53,7 @@ public class EntityAdjuncts {
         ComputeServiceIndicatorsFromChildrenAndMembers.DEFAULT_UNIQUE_TAG_UP);
     
     public static List<Enricher> getNonSystemEnrichers(Entity entity) {
-        List<Enricher> result = MutableList.copyOf(entity.getEnrichers());
+        List<Enricher> result = MutableList.copyOf(entity.enrichers());
         Iterator<Enricher> ri = result.iterator();
         while (ri.hasNext()) {
             if (isSystemEnricher(ri.next())) ri.remove();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/entity/EntityAndAttribute.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/EntityAndAttribute.java b/core/src/main/java/org/apache/brooklyn/core/entity/EntityAndAttribute.java
index e1ae639..037722c 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/EntityAndAttribute.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/EntityAndAttribute.java
@@ -67,7 +67,7 @@ public class EntityAndAttribute<T> implements Supplier<T> {
     }
 
     public void setValue(T val) {
-        ((EntityLocal)entity).setAttribute(attribute, val);
+        ((EntityLocal)entity).sensors().set(attribute, val);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/entity/EntityDynamicType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/EntityDynamicType.java b/core/src/main/java/org/apache/brooklyn/core/entity/EntityDynamicType.java
index 6d65f41..3634f73 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/EntityDynamicType.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/EntityDynamicType.java
@@ -125,9 +125,9 @@ public class EntityDynamicType extends BrooklynDynamicType<Entity, AbstractEntit
         Effector<?> oldEffector = effectors.put(newEffector.getName(), newEffector);
         invalidateSnapshot();
         if (oldEffector!=null)
-            instance.emit(AbstractEntity.EFFECTOR_CHANGED, newEffector.getName());
+            instance.sensors().emit(AbstractEntity.EFFECTOR_CHANGED, newEffector.getName());
         else
-            instance.emit(AbstractEntity.EFFECTOR_ADDED, newEffector.getName());
+            instance.sensors().emit(AbstractEntity.EFFECTOR_ADDED, newEffector.getName());
     }
 
     /**
@@ -158,7 +158,7 @@ public class EntityDynamicType extends BrooklynDynamicType<Entity, AbstractEntit
         Effector<?> removed = effectors.remove(effector.getName());
         invalidateSnapshot();
         if (removed != null) {
-            instance.emit(AbstractEntity.EFFECTOR_REMOVED, removed.getName());
+            instance.sensors().emit(AbstractEntity.EFFECTOR_REMOVED, removed.getName());
         }
     }
 
@@ -184,7 +184,7 @@ public class EntityDynamicType extends BrooklynDynamicType<Entity, AbstractEntit
     public void addSensor(Sensor<?> newSensor) {
         sensors.put(newSensor.getName(), newSensor);
         invalidateSnapshot();
-        instance.emit(AbstractEntity.SENSOR_ADDED, newSensor);
+        instance.sensors().emit(AbstractEntity.SENSOR_ADDED, newSensor);
     }
     
     /**
@@ -199,7 +199,7 @@ public class EntityDynamicType extends BrooklynDynamicType<Entity, AbstractEntit
     public void addSensorIfAbsent(Sensor<?> newSensor) {
         Sensor<?> prev = addSensorIfAbsentWithoutPublishing(newSensor);
         if (prev == null) {
-            instance.emit(AbstractEntity.SENSOR_ADDED, newSensor);
+            instance.sensors().emit(AbstractEntity.SENSOR_ADDED, newSensor);
         }
     }
     
@@ -218,7 +218,7 @@ public class EntityDynamicType extends BrooklynDynamicType<Entity, AbstractEntit
         Sensor<?> result = sensors.remove(sensorName);
         if (result != null) {
             invalidateSnapshot();
-            instance.emit(AbstractEntity.SENSOR_REMOVED, result);
+            instance.sensors().emit(AbstractEntity.SENSOR_REMOVED, result);
         }
         return result;
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/entity/EntityFunctions.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/EntityFunctions.java b/core/src/main/java/org/apache/brooklyn/core/entity/EntityFunctions.java
index 7ec70a1..331fb7d 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/EntityFunctions.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/EntityFunctions.java
@@ -95,7 +95,7 @@ public class EntityFunctions {
                         ((EntityInternal)input).removeAttribute(sensor);
                     } else {
                         value = TypeCoercions.coerce(value, sensor.getTypeToken());
-                        ((EntityInternal)input).setAttribute(sensor, value);
+                        ((EntityInternal)input).sensors().set(sensor, value);
                     }
                 }
                 return null;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogic.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogic.java b/core/src/main/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogic.java
index c2606c1..e64e41e 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogic.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogic.java
@@ -146,7 +146,7 @@ public class ServiceStateLogic {
         };
         
         if (!Entities.isNoLongerManaged(entity)) { 
-            entity.modifyAttribute(sensor, modifier);
+            entity.sensors().modify(sensor, modifier);
         }
     }
     
@@ -169,9 +169,9 @@ public class ServiceStateLogic {
                 }
             }
         }
-        ((EntityInternal)entity).setAttribute(Attributes.SERVICE_STATE_EXPECTED, new Lifecycle.Transition(state, new Date()));
+        ((EntityInternal)entity).sensors().set(Attributes.SERVICE_STATE_EXPECTED, new Lifecycle.Transition(state, new Date()));
         
-        Maybe<Enricher> enricher = EntityAdjuncts.tryFindWithUniqueTag(entity.getEnrichers(), ComputeServiceState.DEFAULT_ENRICHER_UNIQUE_TAG);
+        Maybe<Enricher> enricher = EntityAdjuncts.tryFindWithUniqueTag(entity.enrichers(), ComputeServiceState.DEFAULT_ENRICHER_UNIQUE_TAG);
         if (enricher.isPresent() && enricher.get() instanceof ComputeServiceState) {
             ((ComputeServiceState)enricher.get()).onEvent(null);
         }
@@ -265,9 +265,9 @@ public class ServiceStateLogic {
                 suppressDuplicates = true;
             }
             
-            subscribe(entity, SERVICE_PROBLEMS, this);
-            subscribe(entity, SERVICE_UP, this);
-            subscribe(entity, SERVICE_STATE_EXPECTED, this);
+            subscriptions().subscribe(entity, SERVICE_PROBLEMS, this);
+            subscriptions().subscribe(entity, SERVICE_UP, this);
+            subscriptions().subscribe(entity, SERVICE_STATE_EXPECTED, this);
             onEvent(null);
         }
 
@@ -577,7 +577,7 @@ public class ServiceStateLogic {
         }
 
         public void addTo(Entity entity) {
-            entity.addEnricher(this);
+            entity.enrichers().add(this);
         }
 
         public ComputeServiceIndicatorsFromChildrenAndMembersSpec checkChildrenAndMembers() {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/feed/AttributePollHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/feed/AttributePollHandler.java b/core/src/main/java/org/apache/brooklyn/core/feed/AttributePollHandler.java
index c266836..a82f5d9 100644
--- a/core/src/main/java/org/apache/brooklyn/core/feed/AttributePollHandler.java
+++ b/core/src/main/java/org/apache/brooklyn/core/feed/AttributePollHandler.java
@@ -226,7 +226,7 @@ public class AttributePollHandler<V> implements PollHandler<V> {
             if (suppressDuplicates && Objects.equal(coercedV, entity.getAttribute(sensor))) {
                 // no change; nothing
             } else {
-                entity.setAttribute(sensor, coercedV);
+                entity.sensors().set(sensor, coercedV);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/feed/ConfigToAttributes.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/feed/ConfigToAttributes.java b/core/src/main/java/org/apache/brooklyn/core/feed/ConfigToAttributes.java
index d455e80..dc81d2a 100644
--- a/core/src/main/java/org/apache/brooklyn/core/feed/ConfigToAttributes.java
+++ b/core/src/main/java/org/apache/brooklyn/core/feed/ConfigToAttributes.java
@@ -45,7 +45,7 @@ public class ConfigToAttributes {
         T v = entity.getAttribute(key);
         if (v!=null) return v;
         v = key.getAsSensorValue(entity);
-        if (v!=null) entity.setAttribute(key, v);
+        if (v!=null) entity.sensors().set(key, v);
         return v;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerClient.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerClient.java b/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerClient.java
index d0199a0..fb27ada 100644
--- a/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerClient.java
+++ b/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerClient.java
@@ -395,7 +395,7 @@ public class PortForwardManagerClient implements PortForwardManager {
 
     @Override
     public <T> T setConfig(ConfigKey<T> key, T val) {
-        return getDelegate().setConfig(key, val);
+        return getDelegate().config().set(key, val);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
index a142782..8589eb1 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
@@ -700,8 +700,7 @@ public class LocalEntityManager implements EntityManagerInternal {
         
         if (!getLastManagementTransitionMode(e.getId()).isReadOnly()) {
             e.clearParent();
-            Collection<Group> groups = e.getGroups();
-            for (Group group : groups) {
+            for (Group group : e.groups()) {
                 if (!Entities.isNoLongerManaged(group)) group.removeMember(e);
             }
             if (e instanceof Group) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynPersistenceUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynPersistenceUtils.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynPersistenceUtils.java
index 3c0c1d3..ee79764 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynPersistenceUtils.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynPersistenceUtils.java
@@ -171,9 +171,9 @@ public class BrooklynPersistenceUtils {
             result.entity(instance.getId(), serializer.toString(newObjectMemento(instance)));
             for (Feed instanceAdjunct: ((EntityInternal)instance).feeds().getFeeds())
                 result.feed(instanceAdjunct.getId(), serializer.toString(newObjectMemento(instanceAdjunct)));
-            for (Enricher instanceAdjunct: instance.getEnrichers())
+            for (Enricher instanceAdjunct: instance.enrichers())
                 result.enricher(instanceAdjunct.getId(), serializer.toString(newObjectMemento(instanceAdjunct)));
-            for (Policy instanceAdjunct: instance.getPolicies())
+            for (Policy instanceAdjunct: instance.policies())
                 result.policy(instanceAdjunct.getId(), serializer.toString(newObjectMemento(instanceAdjunct)));
         }
         for (CatalogItem<?,?> instance: mgmt.getCatalog().getCatalogItems())

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
index 0d80698..abfc85d 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/BasicEntityRebindSupport.java
@@ -1,5 +1,4 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
  * regarding copyright ownership.  The ASF licenses this file
@@ -108,7 +107,7 @@ public class BasicEntityRebindSupport extends AbstractBrooklynObjectRebindSuppor
                 Object value = entry.getValue();
                 @SuppressWarnings("unused") // just to ensure we can load the declared type? or maybe not needed
                 Class<?> type = (key.getType() != null) ? key.getType() : rebindContext.loadClass(key.getTypeName());
-                entity.setConfig((ConfigKey<Object>)key, value);
+                entity.config().set((ConfigKey<Object>)key, value);
             } catch (ClassNotFoundException e) {
                 throw Throwables.propagate(e);
             }
@@ -124,7 +123,7 @@ public class BasicEntityRebindSupport extends AbstractBrooklynObjectRebindSuppor
             AbstractPolicy policy = (AbstractPolicy) rebindContext.lookup().lookupPolicy(policyId);
             if (policy != null) {
                 try {
-                    entity.addPolicy(policy);
+                    entity.policies().add(policy);
                 } catch (Exception e) {
                     rebindContext.getExceptionHandler().onAddPolicyFailed(entity, policy, e);
                 }
@@ -142,7 +141,7 @@ public class BasicEntityRebindSupport extends AbstractBrooklynObjectRebindSuppor
             AbstractEnricher enricher = (AbstractEnricher) rebindContext.lookup().lookupEnricher(enricherId);
             if (enricher != null) {
                 try {
-                    entity.addEnricher(enricher);
+                    entity.enrichers().add(enricher);
                 } catch (Exception e) {
                     rebindContext.getExceptionHandler().onAddEnricherFailed(entity, enricher, e);
                 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/PeriodicDeltaChangeListener.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/PeriodicDeltaChangeListener.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/PeriodicDeltaChangeListener.java
index 21f7719..e0c15df 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/PeriodicDeltaChangeListener.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/PeriodicDeltaChangeListener.java
@@ -475,8 +475,8 @@ public class PeriodicDeltaChangeListener implements ChangeListener {
             removeFromCollector(instance);
             if (instance instanceof Entity) {
                 Entity entity = (Entity) instance;
-                for (BrooklynObject adjunct : entity.getPolicies()) removeFromCollector(adjunct);
-                for (BrooklynObject adjunct : entity.getEnrichers()) removeFromCollector(adjunct);
+                for (BrooklynObject adjunct : entity.policies()) removeFromCollector(adjunct);
+                for (BrooklynObject adjunct : entity.enrichers()) removeFromCollector(adjunct);
                 for (BrooklynObject adjunct : ((EntityInternal)entity).feeds().getFeeds()) removeFromCollector(adjunct);
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java
index b49bf52..e5d0359 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java
@@ -206,11 +206,11 @@ public class MementosGenerators {
             builder.children.add(child.getId()); 
         }
         
-        for (Policy policy : entity.getPolicies()) {
+        for (Policy policy : entity.policies()) {
             builder.policies.add(policy.getId()); 
         }
         
-        for (Enricher enricher : entity.getEnrichers()) {
+        for (Enricher enricher : entity.enrichers()) {
             builder.enrichers.add(enricher.getId()); 
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java b/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java
index 69c52ff..8200ea8 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java
@@ -461,9 +461,9 @@ public abstract class AbstractEntityAdjunct extends AbstractBrooklynObject imple
         
         T newVal = TypeCoercions.coerce(val, sensor.getTypeToken());
         if (sensor instanceof AttributeSensor) {
-            entity.setAttribute((AttributeSensor<T>)sensor, newVal);
+            entity.sensors().set((AttributeSensor<T>)sensor, newVal);
         } else { 
-            entity.emit(sensor, newVal);
+            entity.sensors().emit(sensor, newVal);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java
index af7dd77..f258cdc 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java
@@ -243,7 +243,7 @@ public class InternalEntityFactory extends InternalFactory {
             ((AbstractEntity)entity).configure(MutableMap.copyOf(spec.getFlags()));
             
             for (Map.Entry<ConfigKey<?>, Object> entry : spec.getConfig().entrySet()) {
-                ((EntityLocal)entity).setConfig((ConfigKey)entry.getKey(), entry.getValue());
+                entity.config().set((ConfigKey)entry.getKey(), entry.getValue());
             }
 
             Entity parent = spec.getParent();
@@ -294,19 +294,19 @@ public class InternalEntityFactory extends InternalFactory {
                 }
                 
                 for (Enricher enricher : spec.getEnrichers()) {
-                    entity.addEnricher(enricher);
+                    entity.enrichers().add(enricher);
                 }
                 
                 for (EnricherSpec<?> enricherSpec : spec.getEnricherSpecs()) {
-                    entity.addEnricher(policyFactory.createEnricher(enricherSpec));
+                    entity.enrichers().add(policyFactory.createEnricher(enricherSpec));
                 }
                 
                 for (Policy policy : spec.getPolicies()) {
-                    entity.addPolicy((AbstractPolicy)policy);
+                    entity.policies().add((AbstractPolicy)policy);
                 }
                 
                 for (PolicySpec<?> policySpec : spec.getPolicySpecs()) {
-                    entity.addPolicy(policyFactory.createPolicy(policySpec));
+                    entity.policies().add(policyFactory.createPolicy(policySpec));
                 }
                                 
                 for (Entity child: entity.getChildren()) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java
index 9391a57..3bb9cba 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java
@@ -116,7 +116,7 @@ public class InternalLocationFactory extends InternalFactory {
             }
             
             for (Map.Entry<ConfigKey<?>, Object> entry : spec.getConfig().entrySet()) {
-                ((AbstractLocation)loc).setConfig((ConfigKey)entry.getKey(), entry.getValue());
+                ((AbstractLocation)loc).config().set((ConfigKey)entry.getKey(), entry.getValue());
             }
             for (Entry<Class<?>, Object> entry : spec.getExtensions().entrySet()) {
                 ((LocationInternal)loc).addExtension((Class)entry.getKey(), entry.getValue());

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java b/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java
index 3fa69a4..6ef9038 100644
--- a/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java
+++ b/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java
@@ -46,7 +46,7 @@ public class Policies {
             @Override
             public void setEntity(EntityLocal entity) {
                 super.setEntity(entity);
-                entity.subscribe(entity, sensor, listenerFromValueClosure(code));
+                entity.subscriptions().subscribe(entity, sensor, listenerFromValueClosure(code));
             }
         };
     }
@@ -57,7 +57,7 @@ public class Policies {
             @Override
             public void setEntity(EntityLocal entity) {
                 super.setEntity(entity);
-                entity.subscribe(remoteEntity, remoteSensor, listenerFromValueClosure(code));
+                entity.subscriptions().subscribe(remoteEntity, remoteSensor, listenerFromValueClosure(code));
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java b/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java
index b017315..5dac80a 100644
--- a/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java
+++ b/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java
@@ -64,7 +64,7 @@ public class StaticSensor<T> extends AddSensor<T> {
         Maybe<T> v = Tasks.resolving(value).as((Class<T>)sensor.getType()).timeout(ValueResolver.PRETTY_QUICK_WAIT).getMaybe();
         if (v.isPresent()) {
             log.debug(this+" setting sensor "+sensor+" to "+v.get());
-            entity.setAttribute(sensor, v.get());
+            entity.sensors().set(sensor, v.get());
         } else {
             log.debug(this+" not setting sensor "+sensor+"; cannot resolve "+value);
         }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/core/server/entity/BrooklynMetricsImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/server/entity/BrooklynMetricsImpl.java b/core/src/main/java/org/apache/brooklyn/core/server/entity/BrooklynMetricsImpl.java
index a4a0a8e..fd9488c 100644
--- a/core/src/main/java/org/apache/brooklyn/core/server/entity/BrooklynMetricsImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/core/server/entity/BrooklynMetricsImpl.java
@@ -70,17 +70,17 @@ public class BrooklynMetricsImpl extends AbstractEntity implements BrooklynMetri
         LocalSubscriptionManager subsManager = (LocalSubscriptionManager) (managementContext != null ? managementContext.getSubscriptionManager() : null);
         
         if (managementContext != null) {
-            setAttribute(TOTAL_EFFECTORS_INVOKED, ((ManagementContextInternal)managementContext).getTotalEffectorInvocations());
+            sensors().set(TOTAL_EFFECTORS_INVOKED, ((ManagementContextInternal)managementContext).getTotalEffectorInvocations());
         }
         if (execManager != null) {
-            setAttribute(TOTAL_TASKS_SUBMITTED, execManager.getTotalTasksSubmitted());
-            setAttribute(NUM_INCOMPLETE_TASKS, execManager.getNumIncompleteTasks());
-            setAttribute(NUM_ACTIVE_TASKS, execManager.getNumActiveTasks());
+            sensors().set(TOTAL_TASKS_SUBMITTED, execManager.getTotalTasksSubmitted());
+            sensors().set(NUM_INCOMPLETE_TASKS, execManager.getNumIncompleteTasks());
+            sensors().set(NUM_ACTIVE_TASKS, execManager.getNumActiveTasks());
         }
         if (subsManager != null) {
-            setAttribute(TOTAL_EVENTS_PUBLISHED, subsManager.getTotalEventsPublished());
-            setAttribute(TOTAL_EVENTS_DELIVERED, subsManager.getTotalEventsDelivered());
-            setAttribute(NUM_SUBSCRIPTIONS, subsManager.getNumSubscriptions());
+            sensors().set(TOTAL_EVENTS_PUBLISHED, subsManager.getTotalEventsPublished());
+            sensors().set(TOTAL_EVENTS_DELIVERED, subsManager.getTotalEventsDelivered());
+            sensors().set(NUM_SUBSCRIPTIONS, subsManager.getNumSubscriptions());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregatingEnricher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregatingEnricher.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregatingEnricher.java
index 2d25a75..a082201 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregatingEnricher.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregatingEnricher.java
@@ -85,7 +85,7 @@ public abstract class AbstractAggregatingEnricher<S,T> extends AbstractEnricher
 
     public void addProducer(Entity producer) {
         if (LOG.isDebugEnabled()) LOG.debug("{} linked ({}, {}) to {}", new Object[] {this, producer, source, target});
-        subscribe(producer, source, this);
+        subscriptions().subscribe(producer, source, this);
         synchronized (values) {
             S vo = values.get(producer);
             if (vo==null) {
@@ -105,7 +105,7 @@ public abstract class AbstractAggregatingEnricher<S,T> extends AbstractEnricher
     // TODO If producer removed but then get (queued) event from it after this method returns,  
     public S removeProducer(Entity producer) {
         if (LOG.isDebugEnabled()) LOG.debug("{} unlinked ({}, {}) from {}", new Object[] {this, producer, source, target});
-        unsubscribe(producer);
+        subscriptions().unsubscribe(producer);
         S removed = values.remove(producer);
         onUpdated();
         return removed;
@@ -144,12 +144,12 @@ public abstract class AbstractAggregatingEnricher<S,T> extends AbstractEnricher
         }
         
         if (allMembers) {
-            subscribe(entity, Changeable.MEMBER_ADDED, new SensorEventListener<Entity>() {
+            subscriptions().subscribe(entity, Changeable.MEMBER_ADDED, new SensorEventListener<Entity>() {
                 @Override public void onEvent(SensorEvent<Entity> it) {
                     if (filter.apply(it.getValue())) addProducer(it.getValue());
                 }
             });
-            subscribe(entity, Changeable.MEMBER_REMOVED, new SensorEventListener<Entity>() {
+            subscriptions().subscribe(entity, Changeable.MEMBER_REMOVED, new SensorEventListener<Entity>() {
                 @Override public void onEvent(SensorEvent<Entity> it) {
                     removeProducer(it.getValue());
                 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java
index 926b769..1d9870d 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractAggregator.java
@@ -137,7 +137,7 @@ public abstract class AbstractAggregator<T,U> extends AbstractEnricher implement
     }
 
     protected void setEntitySubscribeProducerMemberEvents() {
-        subscribe(producer, Changeable.MEMBER_ADDED, new SensorEventListener<Entity>() {
+        subscriptions().subscribe(producer, Changeable.MEMBER_ADDED, new SensorEventListener<Entity>() {
             @Override public void onEvent(SensorEvent<Entity> event) {
                 if (entityFilter.apply(event.getValue())) {
                     addProducerMember(event.getValue());
@@ -145,7 +145,7 @@ public abstract class AbstractAggregator<T,U> extends AbstractEnricher implement
                 }
             }
         });
-        subscribe(producer, Changeable.MEMBER_REMOVED, new SensorEventListener<Entity>() {
+        subscriptions().subscribe(producer, Changeable.MEMBER_REMOVED, new SensorEventListener<Entity>() {
             @Override public void onEvent(SensorEvent<Entity> event) {
                 removeProducer(event.getValue());
                 onUpdated();
@@ -165,13 +165,13 @@ public abstract class AbstractAggregator<T,U> extends AbstractEnricher implement
     }
 
     protected void setEntitySubscribingProducerChildrenEvents() {
-        subscribe(producer, AbstractEntity.CHILD_REMOVED, new SensorEventListener<Entity>() {
+        subscriptions().subscribe(producer, AbstractEntity.CHILD_REMOVED, new SensorEventListener<Entity>() {
             @Override public void onEvent(SensorEvent<Entity> event) {
                 removeProducer(event.getValue());
                 onUpdated();
             }
         });
-        subscribe(producer, AbstractEntity.CHILD_ADDED, new SensorEventListener<Entity>() {
+        subscriptions().subscribe(producer, AbstractEntity.CHILD_ADDED, new SensorEventListener<Entity>() {
             @Override public void onEvent(SensorEvent<Entity> event) {
                 if (entityFilter.apply(event.getValue())) {
                     addProducerChild(event.getValue());
@@ -212,7 +212,7 @@ public abstract class AbstractAggregator<T,U> extends AbstractEnricher implement
     // TODO If producer removed but then get (queued) event from it after this method returns,  
     protected void removeProducer(Entity producer) {
         if (LOG.isDebugEnabled()) LOG.debug("{} stopped listening to {}", new Object[] {this, producer });
-        unsubscribe(producer);
+        subscriptions().unsubscribe(producer);
         onProducerRemoved(producer);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractMultipleSensorAggregator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractMultipleSensorAggregator.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractMultipleSensorAggregator.java
index 1d76168..d63aa57 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractMultipleSensorAggregator.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractMultipleSensorAggregator.java
@@ -63,14 +63,14 @@ public abstract class AbstractMultipleSensorAggregator<U> extends AbstractAggreg
         BrooklynLogging.log(LOG, BrooklynLogging.levelDebugOrTraceIfReadOnly(producer),
             "{} subscribing to children of {}", this, producer);
         for (Sensor<?> sourceSensor: getSourceSensors()) {
-            subscribeToChildren(producer, sourceSensor, this);
+            subscriptions().subscribeToChildren(producer, sourceSensor, this);
         }
     }
 
     @Override
     protected void addProducerHardcoded(Entity producer) {
         for (Sensor<?> sourceSensor: getSourceSensors()) {
-            subscribe(producer, sourceSensor, this);
+            subscriptions().subscribe(producer, sourceSensor, this);
         }
         onProducerAdded(producer);
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java
index ab41c1a..89ebb1a 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java
@@ -71,7 +71,7 @@ public abstract class AbstractTransformer<T,U> extends AbstractEnricher implemen
             return;
         }
         
-        subscribe(producer, sourceSensor, this);
+        subscriptions().subscribe(producer, sourceSensor, this);
         
         if (sourceSensor instanceof AttributeSensor) {
             Object value = producer.getAttribute((AttributeSensor<?>)sourceSensor);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTypeTransformingEnricher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTypeTransformingEnricher.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTypeTransformingEnricher.java
index 1469829..e15322f 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTypeTransformingEnricher.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTypeTransformingEnricher.java
@@ -56,7 +56,7 @@ public abstract class AbstractTypeTransformingEnricher<T,U> extends AbstractEnri
     public void setEntity(EntityLocal entity) {
         super.setEntity(entity);
         if (producer==null) producer = entity;
-        subscribe(producer, source, this);
+        subscriptions().subscribe(producer, source, this);
         
         if (source instanceof AttributeSensor) {
             Object value = producer.getAttribute((AttributeSensor)source);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/AddingEnricher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/AddingEnricher.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/AddingEnricher.java
index 941d745..860cec2 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/AddingEnricher.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/AddingEnricher.java
@@ -58,7 +58,7 @@ public class AddingEnricher extends AbstractEnricher implements SensorEventListe
         super.setEntity(entity);
         
         for (Sensor source: sources) {
-            subscribe(entity, source, this);
+            subscriptions().subscribe(entity, source, this);
             if (source instanceof AttributeSensor) {
                 Object value = entity.getAttribute((AttributeSensor)source);
                 if (value!=null)
@@ -73,9 +73,9 @@ public class AddingEnricher extends AbstractEnricher implements SensorEventListe
         Number value = recompute();
         Number typedValue = cast(value, (Class<? extends Number>)target.getType());
         if (target instanceof AttributeSensor) {
-            entity.setAttribute((AttributeSensor)target, typedValue);
+            entity.sensors().set((AttributeSensor)target, typedValue);
         } else if (typedValue!=null)
-            entity.emit((Sensor)target, typedValue);
+            entity.sensors().emit((Sensor)target, typedValue);
     }
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java
index e42d2cb..2892427 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/Aggregator.java
@@ -121,12 +121,12 @@ public class Aggregator<T,U> extends AbstractAggregator<T,U> implements SensorEv
     protected void setEntityBeforeSubscribingProducerChildrenEvents() {
         BrooklynLogging.log(LOG, BrooklynLogging.levelDebugOrTraceIfReadOnly(producer),
             "{} subscribing to children of {}", this, producer);
-        subscribeToChildren(producer, sourceSensor, this);
+        subscriptions().subscribeToChildren(producer, sourceSensor, this);
     }
 
     @Override
     protected void addProducerHardcoded(Entity producer) {
-        subscribe(producer, sourceSensor, this);
+        subscriptions().subscribe(producer, sourceSensor, this);
         onProducerAdded(producer);
     }
 
@@ -138,7 +138,7 @@ public class Aggregator<T,U> extends AbstractAggregator<T,U> implements SensorEv
 
     @Override
     protected void addProducerMember(Entity producer) {
-        subscribe(producer, sourceSensor, this);
+        subscriptions().subscribe(producer, sourceSensor, this);
         onProducerAdded(producer);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/Combiner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/Combiner.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/Combiner.java
index 6819a33..d0c1efd 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/Combiner.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/Combiner.java
@@ -93,7 +93,7 @@ public class Combiner<T,U> extends AbstractEnricher implements SensorEventListen
         checkState(sourceSensors.size() > 0, "must specify at least one sourceSensor");
 
         for (Sensor<T> sourceSensor : sourceSensors) {
-            subscribe(producer, sourceSensor, this);
+            subscriptions().subscribe(producer, sourceSensor, this);
         }
         
         for (Sensor<T> sourceSensor : sourceSensors) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/CustomAggregatingEnricher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/CustomAggregatingEnricher.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/CustomAggregatingEnricher.java
index 0a03dca..5ff360f 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/CustomAggregatingEnricher.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/CustomAggregatingEnricher.java
@@ -113,7 +113,7 @@ public class CustomAggregatingEnricher<S,T> extends AbstractAggregatingEnricher<
     @Override
     public void onUpdated() {
         try {
-            entity.setAttribute(target, getAggregate());
+            entity.sensors().set(target, getAggregate());
         } catch (Throwable t) {
             LOG.warn("Error calculating and setting aggregate for enricher "+this, t);
             throw Throwables.propagate(t);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java
index 5cd2071..2e24676 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/Joiner.java
@@ -73,7 +73,7 @@ public class Joiner<T> extends AbstractEnricher implements SensorEventListener<T
         this.sourceSensor = (AttributeSensor<T>) getRequiredConfig(SOURCE_SENSOR);
         this.targetSensor = (Sensor<String>) getRequiredConfig(TARGET_SENSOR);
         
-        subscribe(producer, sourceSensor, this);
+        subscriptions().subscribe(producer, sourceSensor, this);
         
         Object value = producer.getAttribute((AttributeSensor<?>)sourceSensor);
         // TODO would be useful to have a convenience to "subscribeAndThenIfItIsAlreadySetRunItOnce"

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java
index 0cf601c..7265da9 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/Propagator.java
@@ -147,10 +147,10 @@ public class Propagator extends AbstractEnricher implements SensorEventListener<
                 "Nothing to propagate; detected: propagatingAll (%s, excluding %s), sensorMapping (%s)", propagatingAll, getConfig(PROPAGATING_ALL_BUT), sensorMapping);
 
         if (propagatingAll) {
-            subscribe(producer, null, this);
+            subscriptions().subscribe(producer, null, this);
         } else {
             for (Sensor<?> sensor : sensorMapping.keySet()) {
-                subscribe(producer, sensor, this);
+                subscriptions().subscribe(producer, sensor, this);
             }
         }
         
@@ -191,7 +191,7 @@ public class Propagator extends AbstractEnricher implements SensorEventListener<
                 Object v = producer.getAttribute((AttributeSensor<?>)s);
                 // TODO we should keep a timestamp for the source sensor and echo it 
                 // (this pretends timestamps are current, which probably isn't the case when we are propagating)
-                if (v != null || includeNullValues) entity.setAttribute(destinationSensor, v);
+                if (v != null || includeNullValues) entity.sensors().set(destinationSensor, v);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorPropagatingEnricher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorPropagatingEnricher.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorPropagatingEnricher.java
index 4c198f8..f266a80 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorPropagatingEnricher.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorPropagatingEnricher.java
@@ -131,7 +131,7 @@ public class SensorPropagatingEnricher extends AbstractEnricher implements Senso
     public void setEntity(EntityLocal entity) {
         super.setEntity(entity);
         for (Sensor<?> s: sensors) {
-            subscribe(source, s, this);
+            subscriptions().subscribe(source, s, this);
         }
     }
     
@@ -146,9 +146,9 @@ public class SensorPropagatingEnricher extends AbstractEnricher implements Senso
                 new Object[] {this, event, entity, (sourceSensor == destinationSensor ? "" : " (as "+destinationSensor+")")});
         
         if (event.getSensor() instanceof AttributeSensor) {
-            entity.setAttribute((AttributeSensor)destinationSensor, event.getValue());
+            entity.sensors().set((AttributeSensor)destinationSensor, event.getValue());
         } else {
-            entity.emit((Sensor)destinationSensor, event.getValue());
+            entity.sensors().emit((Sensor)destinationSensor, event.getValue());
         }       
     }
 
@@ -163,14 +163,14 @@ public class SensorPropagatingEnricher extends AbstractEnricher implements Senso
             if (s instanceof AttributeSensor) {
                 AttributeSensor destinationSensor = (AttributeSensor<?>) getDestinationSensor(s);
                 Object v = source.getAttribute((AttributeSensor)s);
-                if (v != null || includeNullValues) entity.setAttribute(destinationSensor, v);
+                if (v != null || includeNullValues) entity.sensors().set(destinationSensor, v);
             }
         }
     }
 
     /** convenience, to be called by the host */
     public SensorPropagatingEnricher addToEntityAndEmitAll(Entity host) {
-        host.addEnricher(this);
+        host.enrichers().add(this);
         emitAllAttributes();
         return this;
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorTransformingEnricher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorTransformingEnricher.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorTransformingEnricher.java
index 92319f1..339d9b8 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorTransformingEnricher.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/SensorTransformingEnricher.java
@@ -60,9 +60,9 @@ public class SensorTransformingEnricher<T,U> extends AbstractTypeTransformingEnr
     public void onEvent(SensorEvent event) {
         if (accept((T)event.getValue())) {
             if (target instanceof AttributeSensor)
-                entity.setAttribute((AttributeSensor)target, compute((T)event.getValue()));
+                entity.sensors().set((AttributeSensor)target, compute((T)event.getValue()));
             else 
-                entity.emit(target, compute((T)event.getValue()));
+                entity.sensors().emit(target, compute((T)event.getValue()));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java b/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java
index 74f75f7..7ece9bf 100644
--- a/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java
@@ -92,8 +92,8 @@ public abstract class AbstractGroupImpl extends AbstractEntity implements Abstra
     @Override
     public void init() {
         super.init();
-        setAttribute(GROUP_SIZE, 0);
-        setAttribute(GROUP_MEMBERS, ImmutableList.<Entity>of());
+        sensors().set(GROUP_SIZE, 0);
+        sensors().set(GROUP_MEMBERS, ImmutableList.<Entity>of());
     }
 
     @Override
@@ -124,15 +124,15 @@ public abstract class AbstractGroupImpl extends AbstractEntity implements Abstra
             // FIXME do not set sensors on members; possibly we don't need FIRST at all, just look at the first in MEMBERS, and take care to guarantee order there
             Entity first = getAttribute(FIRST);
             if (first == null) {
-                ((EntityLocal) member).setAttribute(FIRST_MEMBER, true);
-                ((EntityLocal) member).setAttribute(FIRST, member);
-                setAttribute(FIRST, member);
+                ((EntityLocal) member).sensors().set(FIRST_MEMBER, true);
+                ((EntityLocal) member).sensors().set(FIRST, member);
+                sensors().set(FIRST, member);
             } else {
                 if (first.equals(member) || first.equals(member.getAttribute(FIRST))) {
                     // do nothing (rebinding)
                 } else {
-                    ((EntityLocal) member).setAttribute(FIRST_MEMBER, false);
-                    ((EntityLocal) member).setAttribute(FIRST, first);
+                    ((EntityLocal) member).sensors().set(FIRST_MEMBER, false);
+                    ((EntityLocal) member).sensors().set(FIRST, first);
                 }
             }
 
@@ -140,10 +140,10 @@ public abstract class AbstractGroupImpl extends AbstractEntity implements Abstra
             boolean changed = addMemberInternal(member);
             if (changed) {
                 log.debug("Group {} got new member {}", this, member);
-                setAttribute(GROUP_SIZE, getCurrentSize());
-                setAttribute(GROUP_MEMBERS, getMembers());
+                sensors().set(GROUP_SIZE, getCurrentSize());
+                sensors().set(GROUP_MEMBERS, getMembers());
                 // emit after the above so listeners can use getMembers() and getCurrentSize()
-                emit(MEMBER_ADDED, member);
+                sensors().emit(MEMBER_ADDED, member);
 
                 if (Boolean.TRUE.equals(getConfig(MEMBER_DELEGATE_CHILDREN))) {
                     Optional<Entity> result = Iterables.tryFind(getChildren(), Predicates.equalTo(member));
@@ -180,14 +180,14 @@ public abstract class AbstractGroupImpl extends AbstractEntity implements Abstra
             if (changed) {
                 log.debug("Group {} lost member {}", this, member);
                 // TODO ideally the following are all synched
-                setAttribute(GROUP_SIZE, getCurrentSize());
-                setAttribute(GROUP_MEMBERS, getMembers());
+                sensors().set(GROUP_SIZE, getCurrentSize());
+                sensors().set(GROUP_MEMBERS, getMembers());
                 if (member.equals(getAttribute(FIRST))) {
                     // TODO should we elect a new FIRST ?  as is the *next* will become first.  could we do away with FIRST altogether?
-                    setAttribute(FIRST, null);
+                    sensors().set(FIRST, null);
                 }
                 // emit after the above so listeners can use getMembers() and getCurrentSize()
-                emit(MEMBER_REMOVED, member);
+                sensors().emit(MEMBER_REMOVED, member);
 
                 if (Boolean.TRUE.equals(getConfig(MEMBER_DELEGATE_CHILDREN))) {
                     Optional<Entity> result = Iterables.tryFind(getChildren(), new Predicate<Entity>() {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/4d08310c/core/src/main/java/org/apache/brooklyn/entity/group/AbstractMembershipTrackingPolicy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/entity/group/AbstractMembershipTrackingPolicy.java b/core/src/main/java/org/apache/brooklyn/entity/group/AbstractMembershipTrackingPolicy.java
index c84e6bc..6d053ad 100644
--- a/core/src/main/java/org/apache/brooklyn/entity/group/AbstractMembershipTrackingPolicy.java
+++ b/core/src/main/java/org/apache/brooklyn/entity/group/AbstractMembershipTrackingPolicy.java
@@ -167,12 +167,12 @@ public abstract class AbstractMembershipTrackingPolicy extends AbstractPolicy {
         BrooklynLogging.log(LOG, BrooklynLogging.levelDebugOrTraceIfReadOnly(group),
             "Subscribing to group "+group+", for memberAdded, memberRemoved, and {}", getSensorsToTrack());
         
-        subscribe(group, DynamicGroup.MEMBER_ADDED, new SensorEventListener<Entity>() {
+        subscriptions().subscribe(group, DynamicGroup.MEMBER_ADDED, new SensorEventListener<Entity>() {
             @Override public void onEvent(SensorEvent<Entity> event) {
                 onEntityEvent(EventType.ENTITY_ADDED, event.getValue());
             }
         });
-        subscribe(group, DynamicGroup.MEMBER_REMOVED, new SensorEventListener<Entity>() {
+        subscriptions().subscribe(group, DynamicGroup.MEMBER_REMOVED, new SensorEventListener<Entity>() {
             @Override public void onEvent(SensorEvent<Entity> event) {
                 entitySensorCache.remove(event.getSource().getId());
                 onEntityEvent(EventType.ENTITY_REMOVED, event.getValue());
@@ -180,7 +180,7 @@ public abstract class AbstractMembershipTrackingPolicy extends AbstractPolicy {
         });
 
         for (Sensor<?> sensor : getSensorsToTrack()) {
-            subscribeToMembers(group, sensor, new SensorEventListener<Object>() {
+            subscriptions().subscribeToMembers(group, sensor, new SensorEventListener<Object>() {
                 @Override public void onEvent(SensorEvent<Object> event) {
                     boolean notifyOnDuplicates = getRequiredConfig(NOTIFY_ON_DUPLICATES);
                     String entityId = event.getSource().getId();
@@ -212,7 +212,7 @@ public abstract class AbstractMembershipTrackingPolicy extends AbstractPolicy {
 
     protected void unsubscribeFromGroup() {
         Group group = getGroup();
-        if (getSubscriptionTracker() != null && group != null) unsubscribe(group);
+        if (getSubscriptionTracker() != null && group != null) subscriptions().unsubscribe(group);
     }
 
     /** All entity events pass through this method. Default impl delegates to onEntityXxxx methods, whose default behaviours are no-op.


Mime
View raw message