brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [21/36] incubator-brooklyn git commit: Rename o.a.b.sensor.feed to o.a.b.feed and o.a.b.core.feed
Date Wed, 19 Aug 2015 22:54:09 GMT
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/core/src/test/java/org/apache/brooklyn/sensor/feed/http/JsonFunctionsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/sensor/feed/http/JsonFunctionsTest.java b/core/src/test/java/org/apache/brooklyn/sensor/feed/http/JsonFunctionsTest.java
deleted file mode 100644
index 41201af..0000000
--- a/core/src/test/java/org/apache/brooklyn/sensor/feed/http/JsonFunctionsTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.sensor.feed.http;
-
-import java.util.NoSuchElementException;
-
-import org.apache.brooklyn.sensor.feed.http.JsonFunctions;
-import org.apache.brooklyn.util.collections.Jsonya;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.collections.Jsonya.Navigator;
-import org.apache.brooklyn.util.guava.Functionals;
-import org.apache.brooklyn.util.guava.Maybe;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import com.jayway.jsonpath.PathNotFoundException;
-
-public class JsonFunctionsTest {
-
-    public static JsonElement europeMap() {
-        Navigator<MutableMap<Object, Object>> europe = Jsonya.newInstance().at("europe", "uk", "edinburgh")
-                .put("population", 500*1000)
-                .put("weather", "wet", "lighting", "dark")
-                .root().at("europe").at("france").put("population", 80*1000*1000)
-                .root();
-        return new JsonParser().parse( europe.toString() );
-    }
-
-    @Test
-    public void testWalk1() {
-        JsonElement pop = JsonFunctions.walk("europe", "france", "population").apply(europeMap());
-        Assert.assertEquals( (int)JsonFunctions.cast(Integer.class).apply(pop), 80*1000*1000 );
-    }
-
-    @Test
-    public void testWalk2() {
-        String weather = Functionals.chain(
-            JsonFunctions.walk("europe.uk.edinburgh.weather"),
-            JsonFunctions.cast(String.class) ).apply(europeMap());
-        Assert.assertEquals(weather, "wet");
-    }
-
-    @Test(expectedExceptions=NoSuchElementException.class)
-    public void testWalkWrong() {
-        Functionals.chain(
-            JsonFunctions.walk("europe", "spain", "barcelona"),
-            JsonFunctions.cast(String.class) ).apply(europeMap());
-    }
-
-
-    @Test
-    public void testWalkM() {
-        Maybe<JsonElement> pop = JsonFunctions.walkM("europe", "france", "population").apply( Maybe.of(europeMap()) );
-        Assert.assertEquals( (int)JsonFunctions.castM(Integer.class).apply(pop), 80*1000*1000 );
-    }
-
-    @Test
-    public void testWalkMWrong1() {
-        Maybe<JsonElement> m = JsonFunctions.walkM("europe", "spain", "barcelona").apply( Maybe.of( europeMap()) );
-        Assert.assertTrue(m.isAbsent());
-    }
-
-    @Test(expectedExceptions=Exception.class)
-    public void testWalkMWrong2() {
-        Maybe<JsonElement> m = JsonFunctions.walkM("europe", "spain", "barcelona").apply( Maybe.of( europeMap()) );
-        JsonFunctions.castM(String.class).apply(m);
-    }
-
-    
-    @Test
-    public void testWalkN() {
-        JsonElement pop = JsonFunctions.walkN("europe", "france", "population").apply( europeMap() );
-        Assert.assertEquals( (int)JsonFunctions.cast(Integer.class).apply(pop), 80*1000*1000 );
-    }
-
-    @Test
-    public void testWalkNWrong1() {
-        JsonElement m = JsonFunctions.walkN("europe", "spain", "barcelona").apply( europeMap() );
-        Assert.assertNull(m);
-    }
-
-    public void testWalkNWrong2() {
-        JsonElement m = JsonFunctions.walkN("europe", "spain", "barcelona").apply( europeMap() );
-        String n = JsonFunctions.cast(String.class).apply(m);
-        Assert.assertNull(n);
-    }
-
-    @Test
-    public void testGetPath1(){
-        Integer obj = (Integer) JsonFunctions.getPath("$.europe.uk.edinburgh.population").apply(europeMap());
-        Assert.assertEquals((int) obj, 500*1000);
-    }
-
-    @Test
-    public void testGetPath2(){
-        String obj = (String) JsonFunctions.getPath("$.europe.uk.edinburgh.lighting").apply(europeMap());
-        Assert.assertEquals(obj, "dark");
-    }
-
-    @Test
-    public void testGetMissingPathIsNullOrThrows(){
-        try {
-            // TODO is there a way to force this to return null if not found?
-            // for me (Alex) it throws but for others it seems to return null
-            Object obj = JsonFunctions.getPath("$.europe.spain.malaga").apply(europeMap());
-            Assert.assertNull(obj);
-        } catch (PathNotFoundException e) {
-            // not unexpected
-        }
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/core/src/test/java/org/apache/brooklyn/sensor/feed/shell/ShellFeedIntegrationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/sensor/feed/shell/ShellFeedIntegrationTest.java b/core/src/test/java/org/apache/brooklyn/sensor/feed/shell/ShellFeedIntegrationTest.java
deleted file mode 100644
index b274cbc..0000000
--- a/core/src/test/java/org/apache/brooklyn/sensor/feed/shell/ShellFeedIntegrationTest.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * 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
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.sensor.feed.shell;
-
-import static org.testng.Assert.assertTrue;
-
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.brooklyn.api.entity.EntityLocal;
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.core.entity.EntityInternal;
-import org.apache.brooklyn.core.entity.EntityInternal.FeedSupport;
-import org.apache.brooklyn.core.sensor.Sensors;
-import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport;
-import org.apache.brooklyn.core.test.entity.TestEntity;
-import org.apache.brooklyn.sensor.feed.function.FunctionFeedTest;
-import org.apache.brooklyn.sensor.feed.shell.ShellFeed;
-import org.apache.brooklyn.sensor.feed.shell.ShellFeedIntegrationTest;
-import org.apache.brooklyn.sensor.feed.shell.ShellPollConfig;
-import org.apache.brooklyn.sensor.feed.ssh.SshPollValue;
-import org.apache.brooklyn.sensor.feed.ssh.SshValueFunctions;
-import org.apache.brooklyn.test.Asserts;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.apache.brooklyn.util.stream.Streams;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-public class ShellFeedIntegrationTest extends BrooklynAppUnitTestSupport {
-
-    private static final Logger log = LoggerFactory.getLogger(ShellFeedIntegrationTest.class);
-    
-    final static AttributeSensor<String> SENSOR_STRING = Sensors.newStringSensor("aString", "");
-    final static AttributeSensor<Integer> SENSOR_INT = Sensors.newIntegerSensor("anInt", "");
-    final static AttributeSensor<Long> SENSOR_LONG = Sensors.newLongSensor("aLong", "");
-
-    private LocalhostMachineProvisioningLocation loc;
-    private EntityLocal entity;
-    private ShellFeed feed;
-    
-    @BeforeMethod(alwaysRun=true)
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        loc = new LocalhostMachineProvisioningLocation();
-        entity = app.createAndManageChild(EntitySpec.create(TestEntity.class));
-        app.start(ImmutableList.of(loc));
-    }
-
-    @AfterMethod(alwaysRun=true)
-    @Override
-    public void tearDown() throws Exception {
-        if (feed != null) feed.stop();
-        super.tearDown();
-        if (loc != null) Streams.closeQuietly(loc);
-    }
-    
-    @Test(groups="Integration")
-    public void testReturnsShellExitStatus() throws Exception {
-        feed = ShellFeed.builder()
-                .entity(entity)
-                .poll(new ShellPollConfig<Integer>(SENSOR_INT)
-                        .command("exit 123")
-                        .onFailure(SshValueFunctions.exitStatus()))
-                .build();
-
-        EntityTestUtils.assertAttributeEqualsEventually(entity, SENSOR_INT, 123);
-    }
-    
-    @Test(groups="Integration")
-    public void testFeedDeDupe() throws Exception {
-        testReturnsShellExitStatus();
-        entity.addFeed(feed);
-        log.info("Feed 0 is: "+feed);
-        
-        testReturnsShellExitStatus();
-        log.info("Feed 1 is: "+feed);
-        entity.addFeed(feed);
-                
-        FeedSupport feeds = ((EntityInternal)entity).feeds();
-        Assert.assertEquals(feeds.getFeeds().size(), 1, "Wrong feed count: "+feeds.getFeeds());
-    }
-    
-    // TODO timeout no longer supported; would be nice to have a generic task-timeout feature,
-    // now that the underlying impl uses SystemProcessTaskFactory
-    @Test(enabled=false, groups={"Integration", "WIP"})
-    public void testShellTimesOut() throws Exception {
-        feed = ShellFeed.builder()
-                .entity(entity)
-                .poll(new ShellPollConfig<String>(SENSOR_STRING)
-                        .command("sleep 10")
-                        .timeout(1, TimeUnit.MILLISECONDS)
-                        .onException(new FunctionFeedTest.ToStringFunction()))
-                .build();
-
-        Asserts.succeedsEventually(new Runnable() {
-            public void run() {
-                String val = entity.getAttribute(SENSOR_STRING);
-                assertTrue(val != null && val.contains("timed out after 1ms"), "val=" + val);
-            }});
-    }
-    
-    @Test(groups="Integration")
-    public void testShellUsesEnv() throws Exception {
-        feed = ShellFeed.builder()
-                .entity(entity)
-                .poll(new ShellPollConfig<String>(SENSOR_STRING)
-                        .env(ImmutableMap.of("MYENV", "MYVAL"))
-                        .command("echo hello $MYENV")
-                        .onSuccess(SshValueFunctions.stdout()))
-                .build();
-        
-        Asserts.succeedsEventually(new Runnable() {
-            public void run() {
-                String val = entity.getAttribute(SENSOR_STRING);
-                assertTrue(val != null && val.contains("hello MYVAL"), "val="+val);
-            }});
-    }
-    
-    @Test(groups="Integration")
-    public void testReturnsShellStdout() throws Exception {
-        feed = ShellFeed.builder()
-                .entity(entity)
-                .poll(new ShellPollConfig<String>(SENSOR_STRING)
-                        .command("echo hello")
-                        .onSuccess(SshValueFunctions.stdout()))
-                .build();
-        
-        Asserts.succeedsEventually(new Runnable() {
-            public void run() {
-                String val = entity.getAttribute(SENSOR_STRING);
-                assertTrue(val != null && val.contains("hello"), "val="+val);
-            }});
-    }
-
-    @Test(groups="Integration")
-    public void testReturnsShellStderr() throws Exception {
-        final String cmd = "thiscommanddoesnotexist";
-        
-        feed = ShellFeed.builder()
-                .entity(entity)
-                .poll(new ShellPollConfig<String>(SENSOR_STRING)
-                        .command(cmd)
-                        .onFailure(SshValueFunctions.stderr()))
-                .build();
-        
-        Asserts.succeedsEventually(new Runnable() {
-            public void run() {
-                String val = entity.getAttribute(SENSOR_STRING);
-                assertTrue(val != null && val.contains(cmd), "val="+val);
-            }});
-    }
-    
-    @Test(groups="Integration")
-    public void testFailsOnNonZero() throws Exception {
-        feed = ShellFeed.builder()
-                .entity(entity)
-                .poll(new ShellPollConfig<String>(SENSOR_STRING)
-                        .command("exit 123")
-                        .onSuccess(new Function<SshPollValue, String>() {
-                            @Override
-                            public String apply(SshPollValue input) {
-                                return "Exit status (on success) " + input.getExitStatus();
-                            }})
-                        .onFailure(new Function<SshPollValue, String>() {
-                            @Override
-                            public String apply(SshPollValue input) {
-                                return "Exit status (on failure) " + input.getExitStatus();
-                            }}))
-                .build();
-        
-        Asserts.succeedsEventually(new Runnable() {
-            public void run() {
-                String val = entity.getAttribute(SENSOR_STRING);
-                assertTrue(val != null && val.contains("Exit status (on failure) 123"), "val="+val);
-            }});
-    }
-    
-    // Example in ShellFeed javadoc
-    @Test(groups="Integration")
-    public void testDiskUsage() throws Exception {
-        feed = ShellFeed.builder()
-                .entity(entity)
-                .poll(new ShellPollConfig<Long>(SENSOR_LONG)
-                        .command("df -P | tail -1")
-                        .onSuccess(new Function<SshPollValue, Long>() {
-                            public Long apply(SshPollValue input) {
-                                String[] parts = input.getStdout().split("[ \\t]+");
-                                System.out.println("input="+input+"; parts="+Arrays.toString(parts));
-                                return Long.parseLong(parts[2]);
-                            }}))
-                .build();
-        
-        Asserts.succeedsEventually(new Runnable() {
-            public void run() {
-                Long val = entity.getAttribute(SENSOR_LONG);
-                assertTrue(val != null && val >= 0, "val="+val);
-            }});
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/core/src/test/java/org/apache/brooklyn/sensor/feed/ssh/SshFeedIntegrationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/sensor/feed/ssh/SshFeedIntegrationTest.java b/core/src/test/java/org/apache/brooklyn/sensor/feed/ssh/SshFeedIntegrationTest.java
deleted file mode 100644
index de9d5f1..0000000
--- a/core/src/test/java/org/apache/brooklyn/sensor/feed/ssh/SshFeedIntegrationTest.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * 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
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.sensor.feed.ssh;
-
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.brooklyn.api.entity.EntityInitializer;
-import org.apache.brooklyn.api.entity.EntityLocal;
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.core.entity.Attributes;
-import org.apache.brooklyn.core.entity.Entities;
-import org.apache.brooklyn.core.entity.EntityInternal;
-import org.apache.brooklyn.core.entity.EntityInternal.FeedSupport;
-import org.apache.brooklyn.core.sensor.Sensors;
-import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport;
-import org.apache.brooklyn.core.test.entity.TestEntity;
-import org.apache.brooklyn.sensor.feed.ssh.SshFeed;
-import org.apache.brooklyn.sensor.feed.ssh.SshFeedIntegrationTest;
-import org.apache.brooklyn.sensor.feed.ssh.SshPollConfig;
-import org.apache.brooklyn.sensor.feed.ssh.SshPollValue;
-import org.apache.brooklyn.sensor.feed.ssh.SshValueFunctions;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.exceptions.Exceptions;
-import org.apache.brooklyn.util.stream.Streams;
-import org.apache.brooklyn.util.text.StringFunctions;
-import org.apache.brooklyn.util.text.StringPredicates;
-import org.apache.brooklyn.util.time.Duration;
-import org.apache.brooklyn.util.time.Time;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-import org.apache.brooklyn.location.ssh.SshMachineLocation;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicates;
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableList;
-
-public class SshFeedIntegrationTest extends BrooklynAppUnitTestSupport {
-
-    private static final Logger log = LoggerFactory.getLogger(SshFeedIntegrationTest.class);
-    
-    final static AttributeSensor<String> SENSOR_STRING = Sensors.newStringSensor("aString", "");
-    final static AttributeSensor<Integer> SENSOR_INT = Sensors.newIntegerSensor("aLong", "");
-
-    private LocalhostMachineProvisioningLocation loc;
-    private SshMachineLocation machine;
-    private EntityLocal entity;
-    private SshFeed feed;
-    
-    @BeforeMethod(alwaysRun=true)
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        loc = app.newLocalhostProvisioningLocation();
-        machine = loc.obtain();
-        entity = app.createAndManageChild(EntitySpec.create(TestEntity.class));
-        app.start(ImmutableList.of(loc));
-    }
-
-    @AfterMethod(alwaysRun=true)
-    @Override
-    public void tearDown() throws Exception {
-        if (feed != null) feed.stop();
-        super.tearDown();
-        if (loc != null) Streams.closeQuietly(loc);
-    }
-    
-    /** this is one of the most common pattern */
-    @Test(groups="Integration")
-    public void testReturnsSshStdoutAndInfersMachine() throws Exception {
-        final TestEntity entity2 = app.createAndManageChild(EntitySpec.create(TestEntity.class)
-            // inject the machine location, because the app was started with a provisioning location
-            // and TestEntity doesn't provision
-            .location(machine));
-        
-        feed = SshFeed.builder()
-                .entity(entity2)
-                .poll(new SshPollConfig<String>(SENSOR_STRING)
-                        .command("echo hello")
-                        .onSuccess(SshValueFunctions.stdout()))
-                .build();
-        
-        EntityTestUtils.assertAttributeEventuallyNonNull(entity2, SENSOR_STRING);
-        String val = entity2.getAttribute(SENSOR_STRING);
-        Assert.assertTrue(val.contains("hello"), "val="+val);
-        Assert.assertEquals(val.trim(), "hello");
-    }
-
-    @Test(groups="Integration")
-    public void testFeedDeDupe() throws Exception {
-        testReturnsSshStdoutAndInfersMachine();
-        entity.addFeed(feed);
-        log.info("Feed 0 is: "+feed);
-        
-        testReturnsSshStdoutAndInfersMachine();
-        log.info("Feed 1 is: "+feed);
-        entity.addFeed(feed);
-                
-        FeedSupport feeds = ((EntityInternal)entity).feeds();
-        Assert.assertEquals(feeds.getFeeds().size(), 1, "Wrong feed count: "+feeds.getFeeds());
-    }
-    
-    @Test(groups="Integration")
-    public void testReturnsSshExitStatus() throws Exception {
-        feed = SshFeed.builder()
-                .entity(entity)
-                .machine(machine)
-                .poll(new SshPollConfig<Integer>(SENSOR_INT)
-                        .command("exit 123")
-                        .checkSuccess(Predicates.alwaysTrue())
-                        .onSuccess(SshValueFunctions.exitStatus()))
-                .build();
-
-        EntityTestUtils.assertAttributeEqualsEventually(entity, SENSOR_INT, 123);
-    }
-    
-    @Test(groups="Integration")
-    public void testReturnsSshStdout() throws Exception {
-        feed = SshFeed.builder()
-                .entity(entity)
-                .machine(machine)
-                .poll(new SshPollConfig<String>(SENSOR_STRING)
-                        .command("echo hello")
-                        .onSuccess(SshValueFunctions.stdout()))
-                .build();
-        
-        EntityTestUtils.assertAttributeEventually(entity, SENSOR_STRING, 
-            Predicates.compose(Predicates.equalTo("hello"), StringFunctions.trim()));
-    }
-
-    @Test(groups="Integration")
-    public void testReturnsSshStderr() throws Exception {
-        final String cmd = "thiscommanddoesnotexist";
-        
-        feed = SshFeed.builder()
-                .entity(entity)
-                .machine(machine)
-                .poll(new SshPollConfig<String>(SENSOR_STRING)
-                        .command(cmd)
-                        .onFailure(SshValueFunctions.stderr()))
-                .build();
-        
-        EntityTestUtils.assertAttributeEventually(entity, SENSOR_STRING, StringPredicates.containsLiteral(cmd));
-    }
-    
-    @Test(groups="Integration")
-    public void testFailsOnNonZero() throws Exception {
-        feed = SshFeed.builder()
-                .entity(entity)
-                .machine(machine)
-                .poll(new SshPollConfig<String>(SENSOR_STRING)
-                        .command("exit 123")
-                        .onFailure(new Function<SshPollValue, String>() {
-                            @Override
-                            public String apply(SshPollValue input) {
-                                return "Exit status " + input.getExitStatus();
-                            }}))
-                .build();
-        
-        EntityTestUtils.assertAttributeEventually(entity, SENSOR_STRING, StringPredicates.containsLiteral("Exit status 123"));
-    }
-    
-    @Test(groups="Integration")
-    public void testAddedEarly() throws Exception {
-        final TestEntity entity2 = app.addChild(EntitySpec.create(TestEntity.class)
-            .location(machine)
-            .addInitializer(new EntityInitializer() {
-                @Override
-                public void apply(EntityLocal entity) {
-                    SshFeed.builder()
-                        .entity(entity)
-                        .onlyIfServiceUp()
-                        .poll(new SshPollConfig<String>(SENSOR_STRING)
-                            .command("echo hello")
-                            .onSuccess(SshValueFunctions.stdout()))
-                        .build();
-                }
-            }));
-        Time.sleep(Duration.seconds(2));
-        // would be nice to hook in and assert no errors
-        Assert.assertEquals(entity2.getAttribute(SENSOR_STRING), null);
-        Entities.manage(entity2);
-        Time.sleep(Duration.seconds(2));
-        Assert.assertEquals(entity2.getAttribute(SENSOR_STRING), null);
-        entity2.setAttribute(Attributes.SERVICE_UP, true);
-    
-        EntityTestUtils.assertAttributeEventually(entity2, SENSOR_STRING, StringPredicates.containsLiteral("hello"));
-    }
-
-    
-    @Test(groups="Integration")
-    public void testDynamicEnvAndCommandSupplier() throws Exception {
-        final TestEntity entity2 = app.createAndManageChild(EntitySpec.create(TestEntity.class).location(machine));
-        
-        final AtomicInteger count = new AtomicInteger();
-        Supplier<Map<String, String>> envSupplier = new Supplier<Map<String,String>>() {
-            @Override
-            public Map<String, String> get() {
-                return MutableMap.of("COUNT", ""+count.incrementAndGet());
-            }
-        };
-        Supplier<String> cmdSupplier = new Supplier<String>() {
-            @Override
-            public String get() {
-                return "echo count-"+count.incrementAndGet()+"-$COUNT";
-            }
-        };
-        
-        feed = SshFeed.builder()
-                .entity(entity2)
-                .poll(new SshPollConfig<String>(SENSOR_STRING)
-                        .env(envSupplier)
-                        .command(cmdSupplier)
-                        .onSuccess(SshValueFunctions.stdout()))
-                .build();
-        
-        EntityTestUtils.assertAttributeEventuallyNonNull(entity2, SENSOR_STRING);        
-        final String val1 = assertDifferentOneInOutput(entity2);
-        
-        EntityTestUtils.assertAttributeEventually(entity2, SENSOR_STRING, Predicates.not(Predicates.equalTo(val1)));        
-        final String val2 = assertDifferentOneInOutput(entity2);
-        log.info("vals from dynamic sensors are: "+val1.trim()+" and "+val2.trim());
-    }
-
-    private String assertDifferentOneInOutput(final TestEntity entity2) {
-        String val = entity2.getAttribute(SENSOR_STRING);
-        Assert.assertTrue(val.startsWith("count"), "val="+val);
-        try {
-            String[] fields = val.trim().split("-");
-            int field1 = Integer.parseInt(fields[1]); 
-            int field2 = Integer.parseInt(fields[2]);
-            Assert.assertEquals(Math.abs(field2-field1), 1, "expected difference of 1");
-        } catch (Throwable t) {
-            Exceptions.propagateIfFatal(t);
-            Assert.fail("Wrong output from sensor, got '"+val.trim()+"', giving error: "+t);
-        }
-        return val;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/core/src/test/java/org/apache/brooklyn/sensor/feed/windows/WindowsPerformanceCounterFeedLiveTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/sensor/feed/windows/WindowsPerformanceCounterFeedLiveTest.java b/core/src/test/java/org/apache/brooklyn/sensor/feed/windows/WindowsPerformanceCounterFeedLiveTest.java
deleted file mode 100644
index 42a25c0..0000000
--- a/core/src/test/java/org/apache/brooklyn/sensor/feed/windows/WindowsPerformanceCounterFeedLiveTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.sensor.feed.windows;
-
-import java.util.Map;
-
-import org.apache.brooklyn.api.entity.EntityLocal;
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.api.location.MachineLocation;
-import org.apache.brooklyn.api.location.MachineProvisioningLocation;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.core.sensor.Sensors;
-import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
-import org.apache.brooklyn.core.test.entity.TestEntity;
-import org.apache.brooklyn.sensor.feed.windows.WindowsPerformanceCounterFeed;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-/**
- * WindowsPerformanceCounterFeed Live Test.
- * <p>
- * This test is currently disabled. To run, you must configure a location named {@code WindowsLiveTest}
- * or adapt the {@link #LOCATION_SPEC} below.
- * <p>
- * The location must provide Windows nodes that are running an SSH server on port 22. The login credentials must
- * be either be auto-detectable or configured in brooklyn.properties in the usual fashion.
- * <p>
- * Here is an example configuration from brooklyn.properties for a pre-configured Windows VM
- * running an SSH server with public key authentication:
- * <pre>
- * {@code brooklyn.location.named.WindowsLiveTest=byon:(hosts="ec2-xx-xxx-xxx-xx.eu-west-1.compute.amazonaws.com")
- * brooklyn.location.named.WindowsLiveTest.user=Administrator
- * brooklyn.location.named.WindowsLiveTest.privateKeyFile = ~/.ssh/id_rsa
- * brooklyn.location.named.WindowsLiveTest.publicKeyFile = ~/.ssh/id_rsa.pub
- * }</pre>
- * The location must by {@code byon} or another primitive type. Unfortunately, it's not possible to
- * use a jclouds location, as adding a dependency on brooklyn-locations-jclouds would cause a
- * cyclic dependency.
- */
-public class WindowsPerformanceCounterFeedLiveTest extends BrooklynAppLiveTestSupport {
-
-    final static AttributeSensor<Double> CPU_IDLE_TIME = Sensors.newDoubleSensor("cpu.idleTime", "");
-    final static AttributeSensor<Integer> TELEPHONE_LINES = Sensors.newIntegerSensor("telephone.lines", "");
-
-    private static final String LOCATION_SPEC = "named:WindowsLiveTest";
-
-    private Location loc;
-    private EntityLocal entity;
-
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        super.setUp();
-        
-        Map<String,?> allFlags = MutableMap.<String,Object>builder()
-                .put("tags", ImmutableList.of(getClass().getName()))
-                .build();
-        MachineProvisioningLocation<? extends MachineLocation> provisioningLocation =
-                (MachineProvisioningLocation<? extends MachineLocation>)
-                        mgmt.getLocationRegistry().resolve(LOCATION_SPEC, allFlags);
-        loc = provisioningLocation.obtain(ImmutableMap.of());
-
-        entity = app.createAndManageChild(EntitySpec.create(TestEntity.class));
-        app.start(ImmutableList.of(loc));
-    }
-
-    @Test(groups={"Live","Disabled"}, enabled=false)
-    public void testRetrievesPerformanceCounters() throws Exception {
-        // We can be pretty sure that a Windows instance in the cloud will have zero telephone lines...
-        entity.setAttribute(TELEPHONE_LINES, 42);
-        WindowsPerformanceCounterFeed feed = WindowsPerformanceCounterFeed.builder()
-                .entity(entity)
-                .addSensor("\\Processor(_total)\\% Idle Time", CPU_IDLE_TIME)
-                .addSensor("\\Telephony\\Lines", TELEPHONE_LINES)
-                .build();
-        try {
-            EntityTestUtils.assertAttributeEqualsEventually(entity, TELEPHONE_LINES, 0);
-        } finally {
-            feed.stop();
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/core/src/test/java/org/apache/brooklyn/sensor/feed/windows/WindowsPerformanceCounterFeedTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/sensor/feed/windows/WindowsPerformanceCounterFeedTest.java b/core/src/test/java/org/apache/brooklyn/sensor/feed/windows/WindowsPerformanceCounterFeedTest.java
deleted file mode 100644
index 9a27e8e..0000000
--- a/core/src/test/java/org/apache/brooklyn/sensor/feed/windows/WindowsPerformanceCounterFeedTest.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * 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
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.sensor.feed.windows;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.apache.brooklyn.api.entity.EntityLocal;
-import org.apache.brooklyn.api.entity.EntitySpec;
-import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.core.sensor.Sensors;
-import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport;
-import org.apache.brooklyn.core.test.entity.TestEntity;
-import org.apache.brooklyn.sensor.feed.windows.WindowsPerformanceCounterFeed;
-import org.apache.brooklyn.sensor.feed.windows.WindowsPerformanceCounterPollConfig;
-import org.apache.brooklyn.test.EntityTestUtils;
-import org.apache.brooklyn.util.text.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
-
-import io.cloudsoft.winrm4j.winrm.WinRmToolResponse;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-
-public class WindowsPerformanceCounterFeedTest extends BrooklynAppUnitTestSupport {
-
-    private Location loc;
-    private EntityLocal entity;
-
-    @BeforeMethod(alwaysRun=true)
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        loc = new LocalhostMachineProvisioningLocation();
-        entity = app.createAndManageChild(EntitySpec.create(TestEntity.class));
-        app.start(ImmutableList.of(loc));
-    }
-
-    @AfterMethod(alwaysRun=true)
-    @Override
-    public void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    private static final Logger log = LoggerFactory.getLogger(WindowsPerformanceCounterFeedTest.class);
-
-    @Test
-    public void testIteratorWithSingleValue() {
-        Iterator<?> iterator = new WindowsPerformanceCounterFeed
-                .PerfCounterValueIterator("\"10/14/2013 15:28:24.406\",\"0.000000\"");
-        assertTrue(iterator.hasNext());
-        assertEquals(iterator.next(), "0.000000");
-        assertFalse(iterator.hasNext());
-    }
-
-    @Test
-    public void testIteratorWithMultipleValues() {
-        Iterator<?> iterator = new WindowsPerformanceCounterFeed
-                .PerfCounterValueIterator("\"10/14/2013 15:35:50.582\",\"8803.000000\",\"405622.000000\"");
-        assertTrue(iterator.hasNext());
-        assertEquals(iterator.next(), "8803.000000");
-        assertTrue(iterator.hasNext());
-        assertEquals(iterator.next(), "405622.000000");
-        assertFalse(iterator.hasNext());
-    }
-
-    @Test
-    public void testSendPerfCountersToSensors() {
-        AttributeSensor<String> stringSensor = Sensors.newStringSensor("foo.bar");
-        AttributeSensor<Integer> integerSensor = Sensors.newIntegerSensor("bar.baz");
-        AttributeSensor<Double> doubleSensor = Sensors.newDoubleSensor("baz.quux");
-
-        Collection<WindowsPerformanceCounterPollConfig<?>> polls = ImmutableSet.<WindowsPerformanceCounterPollConfig<?>>of(
-                new WindowsPerformanceCounterPollConfig(stringSensor).performanceCounterName("\\processor information(_total)\\% processor time"),
-                new WindowsPerformanceCounterPollConfig(integerSensor).performanceCounterName("\\integer.sensor"),
-                new WindowsPerformanceCounterPollConfig(doubleSensor).performanceCounterName("\\double\\sensor\\with\\multiple\\sub\\paths")
-        );
-
-        WindowsPerformanceCounterFeed.SendPerfCountersToSensors sendPerfCountersToSensors = new WindowsPerformanceCounterFeed.SendPerfCountersToSensors(entity, polls);
-
-        assertNull(entity.getAttribute(stringSensor));
-
-        StringBuilder responseBuilder = new StringBuilder();
-        // NOTE: This builds the response in a different order to which they are passed to the SendPerfCountersToSensors constructor
-        // this tests that the values are applied correctly even if the (possibly non-deterministic) order in which
-        // they are returned by the Get-Counter scriptlet is different
-        addMockResponse(responseBuilder, "\\\\machine.name\\double\\sensor\\with\\multiple\\sub\\paths", "3.1415926");
-        addMockResponse(responseBuilder, "\\\\win-lge7uj2blau\\processor information(_total)\\% processor time", "99.9");
-        addMockResponse(responseBuilder, "\\\\machine.name\\integer.sensor", "15");
-
-        sendPerfCountersToSensors.onSuccess(new WinRmToolResponse(responseBuilder.toString(), "", 0));
-
-        EntityTestUtils.assertAttributeEquals(entity, stringSensor, "99.9");
-        EntityTestUtils.assertAttributeEquals(entity, integerSensor, 15);
-        EntityTestUtils.assertAttributeEquals(entity, doubleSensor, 3.1415926);
-    }
-
-    private void addMockResponse(StringBuilder responseBuilder, String path, String value) {
-        responseBuilder.append(path);
-        responseBuilder.append(Strings.repeat(" ", 200 - (path.length() + value.length())));
-        responseBuilder.append(value);
-        responseBuilder.append("\r\n");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/policy/src/main/java/org/apache/brooklyn/policy/enricher/HttpLatencyDetector.java
----------------------------------------------------------------------
diff --git a/policy/src/main/java/org/apache/brooklyn/policy/enricher/HttpLatencyDetector.java b/policy/src/main/java/org/apache/brooklyn/policy/enricher/HttpLatencyDetector.java
index 8c8f8f7..c5d7415 100644
--- a/policy/src/main/java/org/apache/brooklyn/policy/enricher/HttpLatencyDetector.java
+++ b/policy/src/main/java/org/apache/brooklyn/policy/enricher/HttpLatencyDetector.java
@@ -36,10 +36,10 @@ import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.config.ConfigKeys;
 import org.apache.brooklyn.core.entity.trait.Startable;
 import org.apache.brooklyn.core.sensor.Sensors;
+import org.apache.brooklyn.feed.http.HttpFeed;
+import org.apache.brooklyn.feed.http.HttpPollConfig;
+import org.apache.brooklyn.feed.http.HttpValueFunctions;
 import org.apache.brooklyn.sensor.enricher.AbstractEnricher;
-import org.apache.brooklyn.sensor.feed.http.HttpFeed;
-import org.apache.brooklyn.sensor.feed.http.HttpPollConfig;
-import org.apache.brooklyn.sensor.feed.http.HttpValueFunctions;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.core.flags.SetFromFlag;
 import org.apache.brooklyn.util.javalang.AtomicReferences;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabase.java
----------------------------------------------------------------------
diff --git a/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabase.java b/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabase.java
index ffa8bd6..7cd3bd4 100644
--- a/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabase.java
+++ b/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbyDatabase.java
@@ -36,10 +36,10 @@ import org.apache.brooklyn.core.sensor.BasicAttributeSensorAndConfigKey;
 import org.apache.brooklyn.core.sensor.PortAttributeSensorAndConfigKey;
 import org.apache.brooklyn.entity.software.base.SoftwareProcess;
 import org.apache.brooklyn.entity.software.base.SoftwareProcessImpl;
+import org.apache.brooklyn.feed.jmx.JmxHelper;
 import org.apache.brooklyn.entity.java.UsesJava;
 import org.apache.brooklyn.entity.java.UsesJmx;
 import org.apache.brooklyn.core.config.BasicConfigKey;
-import org.apache.brooklyn.sensor.feed.jmx.JmxHelper;
 import org.apache.brooklyn.util.collections.MutableMap;
 
 import com.google.common.base.Objects.ToStringHelper;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbySchema.java
----------------------------------------------------------------------
diff --git a/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbySchema.java b/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbySchema.java
index 23cfb2c..07417a5 100644
--- a/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbySchema.java
+++ b/sandbox/database/src/main/java/org/apache/brooklyn/entity/database/derby/DerbySchema.java
@@ -33,10 +33,10 @@ import org.apache.brooklyn.entity.database.Schema;
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.entity.EntityLocal;
 import org.apache.brooklyn.entity.java.UsesJmx;
+import org.apache.brooklyn.feed.jmx.JmxAttributePollConfig;
+import org.apache.brooklyn.feed.jmx.JmxFeed;
+import org.apache.brooklyn.feed.jmx.JmxHelper;
 import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.sensor.feed.jmx.JmxAttributePollConfig;
-import org.apache.brooklyn.sensor.feed.jmx.JmxFeed;
-import org.apache.brooklyn.sensor.feed.jmx.JmxHelper;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/sandbox/extra/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeSaltImpl.java
----------------------------------------------------------------------
diff --git a/sandbox/extra/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeSaltImpl.java b/sandbox/extra/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeSaltImpl.java
index 0070b39..da93a1e 100644
--- a/sandbox/extra/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeSaltImpl.java
+++ b/sandbox/extra/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNodeSaltImpl.java
@@ -39,10 +39,10 @@ import org.apache.brooklyn.core.effector.ssh.SshEffectorTasks;
 import org.apache.brooklyn.core.entity.Entities;
 import org.apache.brooklyn.core.sensor.DependentConfiguration;
 import org.apache.brooklyn.entity.stock.EffectorStartableImpl;
+import org.apache.brooklyn.feed.ssh.SshFeed;
+import org.apache.brooklyn.feed.ssh.SshPollConfig;
 import org.apache.brooklyn.entity.software.base.SoftwareProcess;
 import org.apache.brooklyn.entity.database.postgresql.PostgreSqlNode;
-import org.apache.brooklyn.sensor.feed.ssh.SshFeed;
-import org.apache.brooklyn.sensor.feed.ssh.SshPollConfig;
 import org.apache.brooklyn.util.ssh.BashCommands;
 
 import com.google.common.collect.ImmutableMap;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterImpl.java
----------------------------------------------------------------------
diff --git a/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterImpl.java b/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterImpl.java
index 8c2a3af..40e38c5 100644
--- a/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterImpl.java
+++ b/sandbox/extra/src/main/java/org/apache/brooklyn/entity/salt/SaltStackMasterImpl.java
@@ -20,9 +20,8 @@ package org.apache.brooklyn.entity.salt;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
+import org.apache.brooklyn.core.feed.ConfigToAttributes;
 import org.apache.brooklyn.entity.software.base.SoftwareProcessImpl;
-import org.apache.brooklyn.sensor.feed.ConfigToAttributes;
 
 public class SaltStackMasterImpl extends SoftwareProcessImpl implements SaltStackMaster {
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixFeed.java
----------------------------------------------------------------------
diff --git a/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixFeed.java b/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixFeed.java
index 587a152..ef26e8c 100644
--- a/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixFeed.java
+++ b/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixFeed.java
@@ -37,13 +37,13 @@ import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.config.ConfigKeys;
 import org.apache.brooklyn.core.entity.Attributes;
 import org.apache.brooklyn.core.entity.EntityFunctions;
+import org.apache.brooklyn.core.feed.AbstractFeed;
+import org.apache.brooklyn.core.feed.AttributePollHandler;
+import org.apache.brooklyn.core.feed.PollHandler;
+import org.apache.brooklyn.core.feed.Poller;
 import org.apache.brooklyn.core.location.SupportsPortForwarding;
 import org.apache.brooklyn.core.location.access.BrooklynAccessUtils;
-import org.apache.brooklyn.sensor.feed.AbstractFeed;
-import org.apache.brooklyn.sensor.feed.AttributePollHandler;
-import org.apache.brooklyn.sensor.feed.PollHandler;
-import org.apache.brooklyn.sensor.feed.Poller;
-import org.apache.brooklyn.sensor.feed.http.HttpValueFunctions;
+import org.apache.brooklyn.feed.http.HttpValueFunctions;
 import org.apache.brooklyn.util.core.http.HttpTool;
 import org.apache.brooklyn.util.core.http.HttpToolResponse;
 import org.apache.brooklyn.util.net.Cidr;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixPollConfig.java
----------------------------------------------------------------------
diff --git a/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixPollConfig.java b/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixPollConfig.java
index 978261c..388994b 100644
--- a/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixPollConfig.java
+++ b/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixPollConfig.java
@@ -21,9 +21,9 @@ package org.apache.brooklyn.entity.monitoring.zabbix;
 import javax.annotation.Nullable;
 
 import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.sensor.feed.PollConfig;
-import org.apache.brooklyn.sensor.feed.http.HttpValueFunctions;
-import org.apache.brooklyn.sensor.feed.http.JsonFunctions;
+import org.apache.brooklyn.core.feed.PollConfig;
+import org.apache.brooklyn.feed.http.HttpValueFunctions;
+import org.apache.brooklyn.feed.http.JsonFunctions;
 import org.apache.brooklyn.util.collections.MutableList;
 import org.apache.brooklyn.util.core.http.HttpToolResponse;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixServerImpl.java
----------------------------------------------------------------------
diff --git a/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixServerImpl.java b/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixServerImpl.java
index b4f0f6d..9476673 100644
--- a/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixServerImpl.java
+++ b/sandbox/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/zabbix/ZabbixServerImpl.java
@@ -28,10 +28,10 @@ import org.apache.brooklyn.core.entity.AbstractEntity;
 import org.apache.brooklyn.core.entity.trait.Startable;
 import org.apache.brooklyn.entity.group.AbstractMembershipTrackingPolicy;
 import org.apache.brooklyn.entity.group.DynamicGroup;
+import org.apache.brooklyn.feed.http.HttpFeed;
+import org.apache.brooklyn.feed.http.HttpPollConfig;
+import org.apache.brooklyn.feed.http.HttpValueFunctions;
 import org.apache.brooklyn.location.ssh.SshMachineLocation;
-import org.apache.brooklyn.sensor.feed.http.HttpFeed;
-import org.apache.brooklyn.sensor.feed.http.HttpPollConfig;
-import org.apache.brooklyn.sensor.feed.http.HttpValueFunctions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/sandbox/nosql/src/main/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastNodeImpl.java
----------------------------------------------------------------------
diff --git a/sandbox/nosql/src/main/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastNodeImpl.java b/sandbox/nosql/src/main/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastNodeImpl.java
index 6ee1729..d618f0c 100644
--- a/sandbox/nosql/src/main/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastNodeImpl.java
+++ b/sandbox/nosql/src/main/java/org/apache/brooklyn/entity/nosql/hazelcast/HazelcastNodeImpl.java
@@ -26,9 +26,9 @@ import org.slf4j.LoggerFactory;
 import org.apache.brooklyn.core.entity.Attributes;
 import org.apache.brooklyn.core.location.access.BrooklynAccessUtils;
 import org.apache.brooklyn.entity.software.base.SoftwareProcessImpl;
-import org.apache.brooklyn.sensor.feed.http.HttpFeed;
-import org.apache.brooklyn.sensor.feed.http.HttpPollConfig;
-import org.apache.brooklyn.sensor.feed.http.HttpValueFunctions;
+import org.apache.brooklyn.feed.http.HttpFeed;
+import org.apache.brooklyn.feed.http.HttpPollConfig;
+import org.apache.brooklyn.feed.http.HttpValueFunctions;
 import org.apache.brooklyn.util.text.Strings;
 
 import com.google.common.base.Functions;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java
index 0d66ba3..bbe5bf2 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynClusterImpl.java
@@ -30,9 +30,9 @@ import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic.ServiceProble
 import org.apache.brooklyn.entity.brooklynnode.effector.BrooklynClusterUpgradeEffectorBody;
 import org.apache.brooklyn.entity.brooklynnode.effector.SelectMasterEffectorBody;
 import org.apache.brooklyn.entity.group.DynamicClusterImpl;
+import org.apache.brooklyn.feed.function.FunctionFeed;
+import org.apache.brooklyn.feed.function.FunctionPollConfig;
 import org.apache.brooklyn.sensor.enricher.Enrichers;
-import org.apache.brooklyn.sensor.feed.function.FunctionFeed;
-import org.apache.brooklyn.sensor.feed.function.FunctionPollConfig;
 import org.apache.brooklyn.util.time.Duration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java
index 91622dd..538c170 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynEntityMirrorImpl.java
@@ -33,8 +33,8 @@ import org.apache.brooklyn.core.entity.EntityDynamicType;
 import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
 import org.apache.brooklyn.core.sensor.Sensors;
-import org.apache.brooklyn.sensor.feed.http.HttpFeed;
-import org.apache.brooklyn.sensor.feed.http.HttpPollConfig;
+import org.apache.brooklyn.feed.http.HttpFeed;
+import org.apache.brooklyn.feed.http.HttpPollConfig;
 import org.apache.brooklyn.util.collections.Jsonya;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.core.config.ConfigBag;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java
index c1dd4ed..02f5965 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeImpl.java
@@ -41,6 +41,7 @@ import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic.ServiceNotUpLogic;
 import org.apache.brooklyn.core.entity.trait.Startable;
+import org.apache.brooklyn.core.feed.ConfigToAttributes;
 import org.apache.brooklyn.core.location.Locations;
 import org.apache.brooklyn.core.location.access.BrooklynAccessUtils;
 import org.apache.brooklyn.core.mgmt.BrooklynTaskTags;
@@ -51,15 +52,14 @@ import org.apache.brooklyn.entity.brooklynnode.effector.SetHighAvailabilityPrior
 import org.apache.brooklyn.entity.software.base.SoftwareProcessImpl;
 import org.apache.brooklyn.entity.software.base.SoftwareProcess.StopSoftwareParameters.StopMode;
 import org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks;
+import org.apache.brooklyn.feed.http.HttpFeed;
+import org.apache.brooklyn.feed.http.HttpPollConfig;
+import org.apache.brooklyn.feed.http.HttpValueFunctions;
+import org.apache.brooklyn.feed.http.JsonFunctions;
 import org.apache.http.HttpStatus;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.brooklyn.sensor.enricher.Enrichers;
-import org.apache.brooklyn.sensor.feed.ConfigToAttributes;
-import org.apache.brooklyn.sensor.feed.http.HttpFeed;
-import org.apache.brooklyn.sensor.feed.http.HttpPollConfig;
-import org.apache.brooklyn.sensor.feed.http.HttpValueFunctions;
-import org.apache.brooklyn.sensor.feed.http.JsonFunctions;
 import org.apache.brooklyn.util.collections.Jsonya;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.core.config.ConfigBag;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/effector/SetHighAvailabilityModeEffectorBody.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/effector/SetHighAvailabilityModeEffectorBody.java b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/effector/SetHighAvailabilityModeEffectorBody.java
index ca938e9..17baf37 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/effector/SetHighAvailabilityModeEffectorBody.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/effector/SetHighAvailabilityModeEffectorBody.java
@@ -26,8 +26,8 @@ import org.apache.brooklyn.core.effector.Effectors;
 import org.apache.brooklyn.entity.brooklynnode.BrooklynNode;
 import org.apache.brooklyn.entity.brooklynnode.EntityHttpClient;
 import org.apache.brooklyn.entity.brooklynnode.BrooklynNode.SetHighAvailabilityModeEffector;
-import org.apache.brooklyn.sensor.feed.http.HttpValueFunctions;
-import org.apache.brooklyn.sensor.feed.http.JsonFunctions;
+import org.apache.brooklyn.feed.http.HttpValueFunctions;
+import org.apache.brooklyn.feed.http.JsonFunctions;
 import org.apache.brooklyn.util.core.config.ConfigBag;
 import org.apache.brooklyn.util.core.http.HttpToolResponse;
 import org.apache.brooklyn.util.guava.Functionals;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributeFeed.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributeFeed.java b/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributeFeed.java
index 42dcc1c..1078d90 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributeFeed.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributeFeed.java
@@ -34,10 +34,10 @@ import org.apache.brooklyn.api.sensor.AttributeSensor;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.config.ConfigKeys;
 import org.apache.brooklyn.core.entity.EntityInternal;
-import org.apache.brooklyn.sensor.feed.AbstractFeed;
-import org.apache.brooklyn.sensor.feed.PollHandler;
-import org.apache.brooklyn.sensor.feed.Poller;
-import org.apache.brooklyn.sensor.feed.ssh.SshPollValue;
+import org.apache.brooklyn.core.feed.AbstractFeed;
+import org.apache.brooklyn.core.feed.PollHandler;
+import org.apache.brooklyn.core.feed.Poller;
+import org.apache.brooklyn.feed.ssh.SshPollValue;
 import org.apache.brooklyn.util.core.flags.TypeCoercions;
 import org.apache.brooklyn.util.core.task.system.ProcessTaskWrapper;
 import org.apache.brooklyn.util.time.Duration;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributePollConfig.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributePollConfig.java b/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributePollConfig.java
index c6e1c6b..badc7e4 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributePollConfig.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/chef/ChefAttributePollConfig.java
@@ -19,7 +19,7 @@
 package org.apache.brooklyn.entity.chef;
 
 import org.apache.brooklyn.api.sensor.AttributeSensor;
-import org.apache.brooklyn.sensor.feed.PollConfig;
+import org.apache.brooklyn.core.feed.PollConfig;
 
 import com.google.common.base.Function;
 import com.google.common.base.Functions;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/java/JavaAppUtils.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/java/JavaAppUtils.java b/software/base/src/main/java/org/apache/brooklyn/entity/java/JavaAppUtils.java
index c7a743c..9656878 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/java/JavaAppUtils.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/java/JavaAppUtils.java
@@ -32,11 +32,11 @@ import javax.management.openmbean.CompositeData;
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.entity.EntityLocal;
 import org.apache.brooklyn.core.config.render.RendererHints;
+import org.apache.brooklyn.feed.http.HttpValueFunctions;
+import org.apache.brooklyn.feed.jmx.JmxAttributePollConfig;
+import org.apache.brooklyn.feed.jmx.JmxFeed;
 import org.apache.brooklyn.policy.enricher.RollingTimeWindowMeanEnricher;
 import org.apache.brooklyn.policy.enricher.TimeFractionDeltaEnricher;
-import org.apache.brooklyn.sensor.feed.http.HttpValueFunctions;
-import org.apache.brooklyn.sensor.feed.jmx.JmxAttributePollConfig;
-import org.apache.brooklyn.sensor.feed.jmx.JmxFeed;
 import org.apache.brooklyn.util.math.MathFunctions;
 import org.apache.brooklyn.util.text.ByteSizeStrings;
 import org.apache.brooklyn.util.time.Duration;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxAttributeSensor.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxAttributeSensor.java b/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxAttributeSensor.java
index 64ef6ac..ae80754 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxAttributeSensor.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxAttributeSensor.java
@@ -30,9 +30,9 @@ import org.apache.brooklyn.core.config.ConfigKeys;
 import org.apache.brooklyn.core.effector.AddSensor;
 import org.apache.brooklyn.core.sensor.DependentConfiguration;
 import org.apache.brooklyn.core.sensor.HttpRequestSensor;
-import org.apache.brooklyn.sensor.feed.jmx.JmxAttributePollConfig;
-import org.apache.brooklyn.sensor.feed.jmx.JmxFeed;
-import org.apache.brooklyn.sensor.feed.jmx.JmxHelper;
+import org.apache.brooklyn.feed.jmx.JmxAttributePollConfig;
+import org.apache.brooklyn.feed.jmx.JmxFeed;
+import org.apache.brooklyn.feed.jmx.JmxHelper;
 import org.apache.brooklyn.sensor.ssh.SshCommandSensor;
 import org.apache.brooklyn.util.core.config.ConfigBag;
 import org.apache.brooklyn.util.core.task.DynamicTasks;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxSupport.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxSupport.java b/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxSupport.java
index 62fa577..f633f3c 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxSupport.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/java/JmxSupport.java
@@ -31,10 +31,10 @@ import org.apache.brooklyn.config.ConfigKey.HasConfigKey;
 import org.apache.brooklyn.core.entity.EntityInternal;
 import org.apache.brooklyn.core.location.Locations;
 import org.apache.brooklyn.core.location.access.BrooklynAccessUtils;
+import org.apache.brooklyn.feed.jmx.JmxHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.brooklyn.location.ssh.SshMachineLocation;
-import org.apache.brooklyn.sensor.feed.jmx.JmxHelper;
 import org.apache.brooklyn.util.collections.MutableList;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.core.BrooklynMavenArtifacts;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/java/VanillaJavaAppImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/java/VanillaJavaAppImpl.java b/software/base/src/main/java/org/apache/brooklyn/entity/java/VanillaJavaAppImpl.java
index a81de86..90da4a9 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/java/VanillaJavaAppImpl.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/java/VanillaJavaAppImpl.java
@@ -25,7 +25,7 @@ import java.util.Map;
 
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.entity.software.base.SoftwareProcessImpl;
-import org.apache.brooklyn.sensor.feed.jmx.JmxFeed;
+import org.apache.brooklyn.feed.jmx.JmxFeed;
 import org.apache.brooklyn.util.core.flags.SetFromFlag;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/machine/MachineEntityImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/machine/MachineEntityImpl.java b/software/base/src/main/java/org/apache/brooklyn/entity/machine/MachineEntityImpl.java
index 72d7bef..58c64fd 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/machine/MachineEntityImpl.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/machine/MachineEntityImpl.java
@@ -28,10 +28,10 @@ import org.apache.brooklyn.core.location.Machines;
 import org.apache.brooklyn.entity.software.base.AbstractSoftwareProcessSshDriver;
 import org.apache.brooklyn.entity.software.base.EmptySoftwareProcessDriver;
 import org.apache.brooklyn.entity.software.base.EmptySoftwareProcessImpl;
+import org.apache.brooklyn.feed.ssh.SshFeed;
+import org.apache.brooklyn.feed.ssh.SshPollConfig;
+import org.apache.brooklyn.feed.ssh.SshPollValue;
 import org.apache.brooklyn.location.ssh.SshMachineLocation;
-import org.apache.brooklyn.sensor.feed.ssh.SshFeed;
-import org.apache.brooklyn.sensor.feed.ssh.SshPollConfig;
-import org.apache.brooklyn.sensor.feed.ssh.SshPollValue;
 import org.apache.brooklyn.util.core.task.DynamicTasks;
 import org.apache.brooklyn.util.core.task.system.ProcessTaskWrapper;
 import org.apache.brooklyn.util.exceptions.Exceptions;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessSshDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessSshDriver.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessSshDriver.java
index a64999c..e381c79 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessSshDriver.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessSshDriver.java
@@ -35,6 +35,7 @@ import org.apache.brooklyn.core.effector.ssh.SshEffectorTasks;
 import org.apache.brooklyn.core.entity.Attributes;
 import org.apache.brooklyn.core.entity.Entities;
 import org.apache.brooklyn.core.entity.EntityInternal;
+import org.apache.brooklyn.core.feed.ConfigToAttributes;
 import org.apache.brooklyn.core.mgmt.BrooklynTaskTags;
 import org.apache.brooklyn.entity.software.base.lifecycle.NaiveScriptRunner;
 import org.apache.brooklyn.entity.software.base.lifecycle.ScriptHelper;
@@ -49,7 +50,6 @@ import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 
 import org.apache.brooklyn.location.ssh.SshMachineLocation;
-import org.apache.brooklyn.sensor.feed.ConfigToAttributes;
 import org.apache.brooklyn.util.core.internal.ssh.SshTool;
 import org.apache.brooklyn.util.core.internal.ssh.sshj.SshjTool;
 import org.apache.brooklyn.util.core.task.DynamicTasks;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java
index f2dc269..b67780b 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java
@@ -51,12 +51,12 @@ import org.apache.brooklyn.core.entity.lifecycle.Lifecycle.Transition;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic.ServiceNotUpLogic;
 import org.apache.brooklyn.core.location.LocationConfigKeys;
 import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
+import org.apache.brooklyn.feed.function.FunctionFeed;
+import org.apache.brooklyn.feed.function.FunctionPollConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.brooklyn.location.ssh.SshMachineLocation;
 import org.apache.brooklyn.sensor.enricher.AbstractEnricher;
-import org.apache.brooklyn.sensor.feed.function.FunctionFeed;
-import org.apache.brooklyn.sensor.feed.function.FunctionPollConfig;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.collections.MutableSet;
 import org.apache.brooklyn.util.core.config.ConfigBag;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java
index 24614af..bd6f477 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java
@@ -51,6 +51,7 @@ import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
 import org.apache.brooklyn.core.entity.trait.Startable;
 import org.apache.brooklyn.core.entity.trait.StartableMethods;
+import org.apache.brooklyn.core.feed.ConfigToAttributes;
 import org.apache.brooklyn.core.location.AbstractLocation;
 import org.apache.brooklyn.core.location.Locations;
 import org.apache.brooklyn.core.location.Machines;
@@ -76,7 +77,6 @@ import com.google.common.collect.Iterables;
 
 import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
 import org.apache.brooklyn.location.ssh.SshMachineLocation;
-import org.apache.brooklyn.sensor.feed.ConfigToAttributes;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.core.config.ConfigBag;
 import org.apache.brooklyn.util.core.task.DynamicTasks;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/daf40919/software/base/src/main/java/org/apache/brooklyn/feed/jmx/JmxAttributePollConfig.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/feed/jmx/JmxAttributePollConfig.java b/software/base/src/main/java/org/apache/brooklyn/feed/jmx/JmxAttributePollConfig.java
new file mode 100644
index 0000000..ae19f45
--- /dev/null
+++ b/software/base/src/main/java/org/apache/brooklyn/feed/jmx/JmxAttributePollConfig.java
@@ -0,0 +1,74 @@
+/*
+ * 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
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.feed.jmx;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.brooklyn.api.sensor.AttributeSensor;
+import org.apache.brooklyn.core.feed.PollConfig;
+
+import com.google.common.base.Function;
+import com.google.common.base.Functions;
+
+public class JmxAttributePollConfig<T> extends PollConfig<Object, T, JmxAttributePollConfig<T>>{
+
+    private ObjectName objectName;
+    private String attributeName;
+
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    public JmxAttributePollConfig(AttributeSensor<T> sensor) {
+        super(sensor);
+        onSuccess((Function)Functions.identity());
+    }
+
+    public JmxAttributePollConfig(JmxAttributePollConfig<T> other) {
+        super(other);
+        this.objectName = other.objectName;
+        this.attributeName = other.attributeName;
+    }
+
+    public ObjectName getObjectName() {
+        return objectName;
+    }
+    
+    public String getAttributeName() {
+        return attributeName;
+    }
+    
+    public JmxAttributePollConfig<T> objectName(ObjectName val) {
+        this.objectName = val; return this;
+    }
+    
+    public JmxAttributePollConfig<T> objectName(String val) {
+        try {
+            return objectName(new ObjectName(val));
+        } catch (MalformedObjectNameException e) {
+            throw new IllegalArgumentException("Invalid object name ("+val+")", e);
+        }
+    }
+    
+    public JmxAttributePollConfig<T> attributeName(String val) {
+        this.attributeName = val; return this;
+    }
+    
+    @Override protected String toStringBaseName() { return "jmx"; }
+    @Override protected String toStringPollSource() { return objectName+":"+attributeName; }
+
+}


Mime
View raw message