crised / electrical

Electrical M2M software to get an Electrical Bill approximation
0 stars 0 forks source link

Finish Java Daemon #18

Open crised opened 10 years ago

crised commented 10 years ago

C Code is basically done.

We have the variables that are to be read and stored it into db.

Java client needs to be modified to suit the server needs.

service javadaemon start service javadaemon stop

How to make Java Daemon: http://stackoverflow.com/a/7814594/1341526

blabno commented 10 years ago

How client should handle following exceptions?

HttpHostConnectException

When device cannot connect to server I would simply log that and wait for another loop pass.

Authentication exception

This is configuration issue so I would exit client.

Database related exeptions

Such exceptions are internal errors of device do I would simple exit client.

crised commented 10 years ago

I agree, except in Database, because the postgresql service can be restarted, so I would give it one more loop pass.

I would log everything into syslog. Maybe we can do this by piping in Linux, if so please include exact command in init script.

blabno commented 10 years ago

I've implemented logging to syslog with standard java logging mechanism f0a73bd4e829490b6264c8a99d2b72a2ab1d18de