API Example :: EBIEVTCAL.RPGLE

EBI Java API :: RPGLE EBIEVTCAL Source Code




     Z*  CRTBNDRPG DFTACTGRP(*NO) ACTGRP(*CALLER)
     H**********************************************************************************************
     H*  EBIEVTCAL - Demonstrate calling the EBI Notification API
     H**********************************************************************************************
     H DEBUG DATEDIT(*YMD)
     H**********************************************************************************************
     H*
     H* Synopsis: Demonstrates how to call a Java method using prototyping.
     H*
     H* Company       : EXTOL International Inc.
     H* System        : EXTOL Business Integrator
     H* Programmer    : D. Ogozalek
     H* Date          : 20 July 2007
     H* (C) Copyright : EXTOL International, Inc.  2007
     H*
     H* Maintenance   :   
     H*  Date Comment: Type comment here
     D**********************************************************************************************
     D*  "Prototyping" of Java methods that will be called. Extol Code                            *
     D**********************************************************************************************
     D*
     D* Prototype the constructor for the String java class
     D*  constructor signature: public String(String original)
     D  StringConstr   PR              O   EXTPROC(*JAVA:
     D                                      'java.lang.String':
     D                                      *CONSTRUCTOR)
     D    bytes                     256A   CONST VARYING
     D*
     D* Prototype the constructor for the Long java class
     D*  constructor signature: public Long(String s)
     D  LongConstr     PR              O   EXTPROC(*JAVA:
     D                                      'java.lang.Long':
     D                                      *CONSTRUCTOR)
     D   stringLong                    O   CLASS(*JAVA:'java.lang.String')
     D*
     D* Prototype the sendItemNotification method on the SendEbiItemNotif java class
     D*   signature: sendItemNotification(String formattedTypeName, String notificationMessage,
     D*                                    String notification Message, Long sequenceNumber)
     D*
     D  sendNotif      PR                  EXTPROC(*JAVA:
     D                                      'SendEbiItmNotif':
     D                                      'sendItemNotification')
     D                                      STATIC
     D   typeName                      O   CLASS(*JAVA:'java.lang.String')
     D                                     CONST
     D   itemKeyVal                    O   CLASS(*JAVA:'java.lang.String')
     D                                     CONST
     D   notifMsgVal                   O   CLASS(*JAVA:'java.lang.String')
     D                                     CONST
     D   seqNbrVal                     O   CLASS(*JAVA:'java.lang.Long')
     D                                     CONST
     D*
     D**********************************************************************************************
     D* Miscellaneous "variables" that are really Java objects used during method invocations      *
     D**********************************************************************************************
     D*
     D  itemKeyValueJ  S               O   CLASS(*JAVA:'java.lang.String')
     D  notifMessageJ  S               O   CLASS(*JAVA:'java.lang.String')
     D  notifTypeJ     S               O   CLASS(*JAVA:'java.lang.String')
     D  tempString     S               O   CLASS(*JAVA:'java.lang.String')
     D  seqNumberJ     S               O   CLASS(*JAVA:'java.lang.Long')
     D*
     D  NotifMessage   S             30
     D  BusPrcSct      S             25
     D  Oscmd          S            512A
     D  Oscmd2         S            512A
     D
     D* Array for the ADDENVVAR command that will set the classpath
     D ADDENVCMD       S             80    DIM(8) CTDATA PERRCD(1)
     D ADDENVVAR       S             80    DIM(2) CTDATA PERRCD(1)
     C*****************************************************************************
     C                   Exsr      SetJavaVer
     C                   Exsr      SetClassPath

     C                   Eval      itemKeyValueJ = StringConstr('')

     C                   Eval      NotifMessage = 'Triggered EBI Notification'
     C                   Eval      notifMessageJ = StringConstr(NotifMessage)
     C
     C                   Eval      BusPrcSct  = 'notification.api'
     C                   Eval      notifTypeJ = StringConstr(BusPrcSct)
     c
     C                   Eval      tempString = StringConstr('100')
     C                   Eval      seqNumberJ = LongConstr(tempString)
     C*
     c
     C                   CallP     sendNotif(notifTypeJ:itemKeyValueJ:
     C                                       notifMessageJ:seqNumberJ)
     C
     C                   Eval      *Inlr = *On
     C**********************************************************************************************
     C* Set the Java Version Variable, to run the java program(s) with.
     C**********************************************************************************************
     C     SetJavaVer    BegSr
     C* Call QCMDEXC with the ADDENVVAR command to set the java version

     C                   EVAL      CmdLen =170
     C                   Eval      Oscmd = *Blanks
     C                   Eval      Oscmd = %TrimR(ADDENVVAR(1))+' '+
     C                                      %TrimR(ADDENVVAR(2))

     C                   Call      'QCMDEXC'
     C                   Parm                    Oscmd                          command line
     C                   Parm                    CmdLen           15 5          command length
     C                   EndSr
     C**********************************************************************************************
     C* Set the classpath Envrionment Variable, so we can find the java program(s)
     C**********************************************************************************************
     C     SetClassPath  BEGSR
     C                   EVAL      CmdLen = 512
     C*setup the command
     C*
     C                   Eval      Oscmd2 = %TrimR(ADDENVCMD(1))+
     C                                      %TrimR(ADDENVCMD(2))+
     C                                      %TrimR(ADDENVCMD(3))+
     C                                      %TrimR(ADDENVCMD(4))+
     C                                      %TrimR(ADDENVCMD(5))+
     C                                      %TrimR(ADDENVCMD(6))+
     C                                      %TrimR(ADDENVCMD(7))+' '+
     C                                      %TrimR(ADDENVCMD(8))
     C
     C* Call QCMDEXC with the ADDENVCMD command to set the classpath
     C                   Call      'QCMDEXC'
     C                   Parm                    Oscmd2                         command line
     C                   Parm                    CmdLen           15 5          command length
     C*
     C                   ENDSR
     C**********************************************************************************************
** ClassPath
ADDENVVAR ENVVAR(CLASSPATH) VALUE('.:/ebi_notification/notification
:/ebi_notification/notification/conf
:/ebi_notification/notification/lib/dom4j.jar
:/ebi_notification/notification/lib/jboss-j2ee.jar
:/ebi_notification/notification/lib/jbossall-client.jar
:/ebi_notification/notification/lib/log4j.jar
:/ebi_notification/notification/lib/EBI.jar:')
REPLACE(*YES)
** Version
ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPERTIES) VALUE('-Djava.version=1.5;')
REPLACE(*YES)




By: on