home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Java / JDesignerPro / Jdp3_0.exe / data1.cab / Program_Files / SubmitServerJob.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-09  |  3.1 KB  |  74 lines

  1. import java.awt.BorderLayout;
  2. import java.awt.Button;
  3. import java.awt.Container;
  4. import java.awt.Event;
  5. import java.awt.Label;
  6. import java.awt.Panel;
  7.  
  8. public class SubmitServerJob extends JDPClassLayout {
  9.    JDPUser user;
  10.    JDPJagg jaggSQL;
  11.    JDPPopupMessage popuppanel;
  12.    JDPMaskEdit JDPMaskEditMain;
  13.    String moduleParameter;
  14.    Panel Main;
  15.    JDPScrollPanel ScrollPanel1;
  16.    Button Button1;
  17.    Label Label1;
  18.    JDPRMIConnection RMIConnection1;
  19.  
  20.    public void InitClass(JDPUser var1, Panel var2, String var3) {
  21.       this.user = var1;
  22.       this.moduleParameter = var3;
  23.       super.targetPanel = var2;
  24.       this.jaggSQL = new JDPJagg(var1.jaggPath);
  25.       ((Container)this).setLayout(new BorderLayout());
  26.       this.popuppanel = new JDPPopupMessage(var1, this);
  27.       ((Container)this).add(this.popuppanel);
  28.       this.JDPMaskEditMain = new JDPMaskEdit();
  29.       this.Main = new Panel();
  30.       this.ScrollPanel1 = new JDPScrollPanel();
  31.       this.Button1 = new Button("Press to submit test job on Server");
  32.       this.Label1 = new Label("This demo uses JDesignerPro's lightweight RMI to submit a job on the server", 0);
  33.       this.RMIConnection1 = new JDPRMIConnection(var1);
  34.       this.Main.setLayout(new BorderLayout());
  35.       ((Container)this).add("Center", this.Main);
  36.       this.Main.add("Center", this.ScrollPanel1);
  37.       this.ScrollPanel1.add("Left", this.Button1);
  38.       this.Main.add("North", this.Label1);
  39.       var1.gParm.addElement(this);
  40.       this.InitComponents();
  41.    }
  42.  
  43.    public boolean handleEvent(Event var1) {
  44.       switch (var1.id) {
  45.          case 503:
  46.          case 504:
  47.          case 505:
  48.             this.popuppanel.postEvent(var1);
  49.             return false;
  50.          case 1001:
  51.             if (var1.target.equals(this.Button1)) {
  52.                String var2 = this.RMIConnection1.submitJob("QBATCH", "Test Job", "C", "JDPChoice", "()", "", 5, 5, true, -1, "", "", "B");
  53.                if (var2 == null) {
  54.                   this.user.mainmsg.setStatusMsg("Job submission failed.", 10);
  55.                } else if (var2.startsWith("Jobnumber:")) {
  56.                   this.user.mainmsg.setStatusMsg("Job submitted and held on QBATCH. Go to Job Queues in Server Manager to release job.", 30);
  57.                } else {
  58.                   this.user.mainmsg.setStatusMsg(var2, 15);
  59.                }
  60.  
  61.                return true;
  62.             }
  63.  
  64.             return false;
  65.          default:
  66.             return false;
  67.       }
  68.    }
  69.  
  70.    public void InitComponents() {
  71.       this.jaggSQL.setKeepConnectionOpen(false);
  72.    }
  73. }
  74.