Search code examples
javaapiinterfaceremote-accessmainframe

Java API to access Mainframe remotely


I am looking for a java API to access mainframe remotely. I am looking for something similar to JTOpen or IBM Toolbox for iseries systems. Through this API, I should be able to connect to the mainframes and fetch information from the mainframe, something like this -

public static void main(String[] args){
    Mainframe myMainframe = new Mainframe(ipAddress, userName, password);
    myMainframe.connect();
    System.out.println(myMainframe.getSystemName);
    myMainframe.disconnect();
}

Solution

  • Look at JMX. It's provide API for building distributed systems. I belive it can be used in your Mainframe environment. It's server-client model. You can write interface like:

    public interface MainframeMXBean {
        public String getName();
    }
    

    and implement it in your Mainframe class, then create proxy for local usage:

    MainframeMXBean remoteMF = JMX.newMXBeanProxy(connection, jmxName, MainFrameMXBean.class);
    System.out.println(remoteMF.getName());