Java Programming

From HSYCO
Revision as of 09:45, 18 February 2014 by Hsyco (talk | contribs)
Jump to navigation Jump to search

The Java extension of HSYCO is based on a class called user, declared in a user.java file, contained in the hsyco/com/hsyco directory and compiled in a java.class file.


Note The user.class file must exist for the HSYCO to work correctly, even if there is no customized Java code.


HSYCO SERVER ships with an empty user.class file pre-installed.

The user class should extend the userBase class, a skeleton class that provides methods to execute actions on the field devices, as well as internal functions, and the callback framework methods, which are the methods called by HSYCO after any event is detected.

The dummy user.java file contains only the class declaration:


/*  HSYCO CONTROLLER, USER CODE
 *  (c) 2014 Home Systems Consulting SpA
 *  For information, see the Home Systems Consulting web site:
 *  http://www.homesystemsconsulting.com/
 */

package com.hsyco;
public class user extends userBase {
}


The HSYCO run-time environment should be restarted for user.class changes to become effective.

The standard setting of the AutoKillFiles parameter in hsyco.ini cause the automatic restart of HSYCO when user.class is changed.

This chapter describes the callback methods and all the command and utility methods provided by userBase.

These methods are the only official HSYCO Java API methods.

You should avoid using other public methods provided by other classes within the HSYCO package. These methods could change without notice in any new HSYCO release, causing compatibility issues between your code and different versions of HSYCO.