Fixing remote install; now starting as upstart daemon.
diff --git a/core/store/src/main/java/org/onlab/onos/store/StoreService.java b/core/store/src/main/java/org/onlab/onos/store/StoreService.java
new file mode 100644
index 0000000..a672f54
--- /dev/null
+++ b/core/store/src/main/java/org/onlab/onos/store/StoreService.java
@@ -0,0 +1,18 @@
+package org.onlab.onos.store;
+
+import com.hazelcast.core.HazelcastInstance;
+
+/**
+ * Bootstrap service to get a handle on a share Hazelcast instance.
+ */
+public interface StoreService {
+
+ /**
+ * Returns the shared Hazelcast instance for use as a distributed store
+ * backing.
+ *
+ * @return shared Hazelcast instance
+ */
+ HazelcastInstance getHazelcastInstance();
+
+}
diff --git a/core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java b/core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java
index 5f81aef..b8c1cdf 100644
--- a/core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java
+++ b/core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java
@@ -40,6 +40,7 @@
import org.onlab.onos.net.device.DeviceStore;
import org.onlab.onos.net.device.PortDescription;
import org.onlab.onos.net.provider.ProviderId;
+import org.onlab.onos.store.StoreService;
import org.onlab.util.KryoPool;
import org.slf4j.Logger;
@@ -187,12 +188,15 @@
// FIXME change to protected once we remove DistributedDeviceManagerTest.
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ protected StoreService storeService;
+
/*protected*/public HazelcastInstance theInstance;
@Activate
public void activate() {
log.info("Started");
+ theInstance = storeService.getHazelcastInstance();
// IMap event handler needs value
final boolean includeValue = true;
diff --git a/core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java b/core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java
new file mode 100644
index 0000000..d7f09f8
--- /dev/null
+++ b/core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java
@@ -0,0 +1,39 @@
+package org.onlab.onos.store.impl;
+
+import com.hazelcast.core.Hazelcast;
+import com.hazelcast.core.HazelcastInstance;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Service;
+import org.onlab.onos.store.StoreService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Auxiliary bootstrap of distributed store.
+ */
+@Component(immediate = true)
+@Service
+public class StoreManager implements StoreService {
+
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ private HazelcastInstance instance;
+
+ @Activate
+ public void activate() {
+ instance = Hazelcast.newHazelcastInstance();
+ log.info("Started");
+ }
+
+ @Deactivate
+ public void deactivate() {
+ log.info("Stopped");
+ }
+
+ @Override
+ public HazelcastInstance getHazelcastInstance() {
+ return instance;
+ }
+}