Create singleton and connect with datapoint
TODO some test
This commit is contained in:
31
src/main/java/ch/hevs/isi/web/WebConnector.java
Normal file
31
src/main/java/ch/hevs/isi/web/WebConnector.java
Normal file
@ -0,0 +1,31 @@
|
||||
package ch.hevs.isi.web;
|
||||
|
||||
import ch.hevs.isi.core.DataPoint;
|
||||
import ch.hevs.isi.core.DataPointListener;
|
||||
|
||||
public class WebConnector implements DataPointListener {
|
||||
private static WebConnector mySelf = null;
|
||||
|
||||
private WebConnector (){
|
||||
|
||||
}
|
||||
|
||||
public static WebConnector getMySelf(){
|
||||
if (mySelf == null){
|
||||
mySelf = new WebConnector();
|
||||
}
|
||||
return mySelf;
|
||||
}
|
||||
public void initialize(String host, int port){
|
||||
|
||||
}
|
||||
|
||||
private void pushToWeb(DataPoint dp){
|
||||
System.out.println("To Web: " + dp.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewValue(DataPoint dp) {
|
||||
pushToWeb(dp);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user