Regarding adding Java function to Ignition

Team, I just wrote a Java interface to our shop floor control system, now I want to integrate this into Ignition in such a way that it’s easy to call the modules from the python scripts. I understand that the foundation of the system is Tomcat (from the forum) and I’ve written servlets before…
I need to have the service persistent so that the configuration parameters are only read once and my service has some instance variables related to the state of connection the MES system which I need to persist between function calls. How do I create a instance of my service one time, then get a reference to my service so I can call the access methods to query or update the MES system as needed?

I assume my service will need to start/stop when the gateway starts and stops. Then somehow, I need to discover a reference to my service at runtime, so I can call the access methods. I could create a web service which listens to another ports and provide xml encoding/decoding, but that’s kind of heavy lifting for what I want to do. Is there a easier way to do this that doesn’t require the heavy lifting? :question:

Should I find/get an instance to my service using JNDI using a factory method?

Assume the new MES interface will live on the Gateway server.

Let me restate my question above.
I create an instance of my interface class on the ignition gateway on gateway startup, then access the instance to via the script in “action performed” method?

I assume I need to add my jar to the classpath, But I don’t know how to call the init method. One option is to create a tomcat servlet which lives on the Gateway Tomcat instance. The servlet init could handle the starting of my class. I don’t really want to implement a services interface though to call the methods.

Have you taken a look at the SDK?

http://www.inductiveautomation.com/news/item/257

Thank you for you reply… I will take a look at your link. :heart: