EspressManager is primarily run as an application. If you wish to use ChartAPI to connect to EspressManager running as an application, you can use API methods to specify the IP address or machine name where EspressManager is located, as well as the port number that EspressManager is listening on.
You use the following two API methods to set the connection information:
static void setServerAddress(java.lang.String address); static void setServerPortNumber(int port);
For example, the following lines of code:
QbChart.setServerAddress("someMachine"); QbChart.setServerPortNumber(somePortNumber);
will connect to EspressManager running on someMachine
and listening on somePortNumber
.
Please note that if EspressManager connection information is not specified, the code will attempt to connect to EspressManager on the local machine and listening to the default port number (22071).
Please note that these methods exist in QbChart
and QbChartDesigner
.
EspressManager can also be run as a servlet. If you wish to use Chart API to connect to EspressManager running as a servlet, you will have to use the following methods:
public static void useServlet(boolean b); public static void setServletRunner(String comm_url); public static void setServletContext(String context);
For example, the following lines of code:
QbChart.useServlet(true); QbChart.setServletRunner("http://someMachine:somePortNumber"); QbChart.setServletContext("EspressChart/servlet");
will connect to EspressManager running at http://someMachine:somePortNumber/EspressChart/servlet
.
Please note that these methods exist in QbChart
and QbChartDesigner
.