extending a cics web application using jcics · • fundamentals of using the jcics api ... in the...
TRANSCRIPT
ExtendingaCICSWebapplicationusingJCICS
ThiscourseprovidesJavaapplicationdeveloperswithaguidetoCICSservices,demonstratinghowtoaccessthemusingtheJCICSAPI.Topicscoveredinclude:
• FundamentalsofusingtheJCICSAPI• UsingJZOStomapnativerecord-basedlanguagestructurestoJavadatatypes• CommunicatingwithotherCICSprogramsusingaCOMMAREA• LINKingtoaJavaapplicationdeployedinLiberty• AccessingCICSresources,forexampleVSAMandtemporarystoragequeues• ManagingunitofworkscopeinJava• HandlingerrorsinJava
Studentsshouldbefamiliarwiththeconceptsandtechniquesdiscussedin"DevelopingaRESTfulWebapplicationforLibertyinCICS"beforetakingthiscourse.
http://www.redbooks.ibm.com/abstracts/crse0302.html?Open
Section1Lecture1HelloandwelcometotheCICSJavacoursetoextendaCICSwebapplicationusingtheJCICSAPI.MynameisIanBurnettandI’mpartoftheCICSdevelopmentteam,basedintheIBMHursleylabintheUK.
ThiscoursewillshowyouhowtoextendyourknowledgeofJavadevelopmentinCICS,inordertoproducefeature-richapplicationsthatusearangeofCICSfeatures.
Wewillbuilduponknowledgegainedinthe“DevelopingaRESTfulWebapplicationforLibertyinCICS”course,anduseyourexistingdevelopmentenvironmenttoproducemorecomplexJavaapplications.
WewillstartthecoursebylookingatthefundamentalconceptsyouneedtounderstandasaJavadeveloperwheninteractingwithCICS.Usingthesefundamentals,wewillcreateasimplepieceofcodetoinvokeCICSprogramsfromtheLibertyenvironment.
AfterwehaveunderstoodtheprinciplesofinvokingotherCICSprogramstomanipulatedata,wewilllookatseveralresourcesavailableinCICSandstudytheAPIsusedtointeractwiththoseresourcesdirectlyfromJava.
AnotheraspectofCICSapplicationsisthattheyadheretotheACIDpropertiesofatransaction,andtheabilitytodelineateresourceupdatesintounitsofworkisalsoavailabletoJavaapplications.WewilllookathowCICSprovidesunit-of-worksupport,andalsohowthatfitswiththeJCICSAPI.
Developingapplicationsthatareenterprise-ready,requiresrobustprogrammingpracticestogracefullyhandleapplicationandsystemerrors.OurfinaltopicwillbetocovertheconceptsandpracticalitiesofhandlingerrorconditionsusingJava.
OurcodesamplesareavailablefromtheCICSdevGithubrepositoryandprovidefully-workingexamplesofusingtheJCICSAPIsthatwewillbediscussing,alongwithadditionalsupportingmaterial.
TherepositoryshowncontainsmanyJavasourcefilesthatusetheJAX-RSinterface,inordertoprovideasimplemechanismofinvokingJavacodeinaCICSenvironment.AlltheexamplesusetheHTTPGETverb,andreturnJSONdata.RESTfulapplicationswouldtypicallyuseavarietyofHTTPverbs,howeverthesamplecodeisnotintendedasareferenceforthedevelopmentofRESTfulapplications,butmerelytoalloweasytestingusingasimplewebbrowser.
Duringthiscourse,wewillassumethatyouhaveaLibertyJVMserverrunninginCICS.ThesamplecodeprovidedrequiresuseoffacilitiesdefinedbytheJAX-RSspecification,thereforeyourLibertyserver.xmlfileshouldbeconfiguredtoincludethisfeature.
WewillalsoassumeyourworkstationisconfiguredwithadevelopmentenvironmentthatcontainsthenecessaryJCICSJavalibraries.Adynamicwebprojectissufficienttopackagethecodesamples,andforsimplicity,theLibertydrop-insdirectorycanbeusedfordeployment,althoughCICSbundlesmaybeusedifrequired.
Refertothe“DevelopingaRESTfulWebapplicationforLibertyinCICS”courseifyouneedfurtherinformationonconfiguringJavainyourCICSenvironment.
Thank-youforwatchingthiscourse.
Section2Lecture1TheabilityforprogramswrittenindifferentlanguagestocommunicateandshareresourceswhilstrunningasasingletaskisakeystrengthofCICS.AswediscussedinapreviouscoursetheinterfacetoaCICSprogramisdefinedusingeitheraCOMMAREA,orChannelsandContainers.
DifferentlanguagesdefinethelayoutoftheCOMMAREAorcontainerusinglanguagespecificstructures.
TheClanguageallowsfieldstobedefinedwithdatatypessuchascharacters,integersandfloatingpoints.
COBOLprogramsdefinestoragelayoutusingfields,representedbypictureclauses,tospecifythedifferentnumericandcharacterdatatypes.
UsuallytheselanguagestructuresareseparatedoutintoasourcefilereferredtoasacopybookinCOBOL,orasaheaderfileintheClanguage.Inpracticalterms,acopybookoftenrepresentsanentitysuchasanemployeeorastockitem.
Aswellasdescribinginterfaces,alanguagestructurecanalsobeusedtodescribethelayoutofdatastoredinsequentialrecordssuchasVSAMfilesorTemporaryStorageQueues.
TointerfacewithexistingprogramsfromJavaweneedameansofaccessingdatawithinstructuredrecords.
WhenusingtheJCICSAPItolinktoaCICSprogramCOMMAREAdataispassedasabytearray.
UsingthestandardJavalanguageconstructs,itispossibletoconstruct,populate,andreadfromthisbytearraydirectly.However,thereareseveralproblemswiththisapproach.
Firstly,manualbytearraymanipulationistimeconsumingtodevelopanderrorprone.
Secondly,arecordmaycontainanelementinaformatthatisnotnativelysupportedbythestandardJavalibraries.Forexample,packeddecimalfieldsarecommononz/OS,buthavenoJavadatatypeequivalent.
Finally,manipulationofindividualbyteswithinabytearraydoesnotfitverywellwiththeobject-orientedprogrammingmodelofJava.
ThesolutiontotheseproblemsistogenerateaJavabeanfromthecopybookwithaccessormethodswhichgetandsetthefieldsautomaticallyconvertingdataasrequired.
Thegeneratedbeanprovidesamappingbetweentheobject-orientedJavaprogrammingmodel,andtherecordorientatedprogrammingmodel.
Wewillcoverthegenerationofthesebeansinafollowinglecture.
Duringthiscourse,itwillbeusefultouseasamplecopybooktodemonstratehowandwherebytearraysareusedintheJCICSAPI.
ThesamplematerialsprovideanexampleCOBOLcopybookthatdefinesseveralfieldsinan80-byterecord.
Therecordrepresentsanentryinastockwarehouse.Inourapplication,afileisusedtoholdthousandsoftheserecords,representingthetotalstockinventoryforawarehouse.
AsweexploretheJCICSAPIinthiscourse,wewillbeusingthesamplerecordtodemonstratecommunicationbetweenvariousapplicationcomponents.
Lookinginmoredetailatthe80-byterecorddefinedinthesample,wecanseeseveralfields.
Firstly,an8-bytefieldisusedasthepartID,itrepresentstheuniquekeyforthisrecordwithinthestockdatabase.NotwopartswithinthedatabasehavethesamepartID.
Asecond8-bytefieldisusedtorepresenttheIDofthesupplierofthatpart.Thiswouldlikelyreferenceanentryinanotherfile,whichcontainedalistofallthesuppliersused.
Eachparthasaunitprice,thatisdefinedusingthepackeddecimalformat.
Twodatesarestoredintherecord–thelasttimeanorderwasplaced,andthenexttimeanorderwillbeplacedforthispart.
Anumericfieldcontainsinformationaboutthenumberofthesepartsthatarecurrentlyheldinthewarehouse.
Finally,adescriptionofthispartisstoredinthesecondhalfoftherecordintextformat.
Thesupportingmaterialcontainsanothersamplecopybooktorepresentasupplier.Thiswillbeusefullaterwhendemonstratingcaseswhererelationshipsexistbetweenrecords.
Inthenextlecture,wewilllookattheJZOStoolkitandhowtherecordgeneratorcomponentcanbeusedtomapfromoursampleCOBOLcopybooktoanobject-orientedJavaclass.
Section2Lecture2JavarecordsareusedtomapnativerecordbasedlanguagestructurestoJavadatatypes.IBMsuppliestwoJavarecordgenerationtools.
OneoptionistheJ2CrecordimporterprovidedwithIBMDeveloperforzSystemsEnterpriseEditionwithintheJ2Cfeature.
TheotheroptionistheJZOSRecordGeneratorwhichwewilldescribeinthiscourse.
TheJZOSrecordgeneratorcreatesaJavaclass,basedonacopybookfromCOBOLoraDSECTfromassembler.Inourexample,wewillgenerateaJavaclassfromthestockpartcopybookthatwelookedatinthepreviouslecture.GeneratingaJavarecordisatwo-stageprocess.
ThefirststageistocompiletheCOBOLprogramspecifyingtheADATAparametertogeneratetheADATAfile.
ThesecondstageistoruntheJZOSrecordgeneratorusingtheADATAfileasinput,togenerateaJavasourcefile
TheJavasourcefilecanbeincludedinajavaprojectorcanbecompileddirectlyintoaJavalibrary.
IncludingthegeneratedJavasourcefileintheJavaapplicationprojectisusefulwhenthegeneratedcodeneedsfurthercustomizationsuchaschangingencodingsforspecificfields.TodothatrequiresimportingthegeneratedJavasourcefileintoyourEclipsedevelopmentenvironment,andthenaddingtheJZOSlibrarytotheprojectbuildpath.However,iftheCOBOLcopybookchangesandrecordneedstoberegenerated-thiswillrequiredevelopmentefforttoupdatethesourceintheEclipsedevelopmentenvironment.
AnalternativeapproachistocompilethegeneratedsourcefileandpackageitintoaJavaarchive,orjarfile,whichcanbeincludedwiththeJavaapplication.ThisuseofacompiledjarfileavoidstherequirementtoaddtheJZOSlibrariestotheEclipseworkspaceandallowsmultiplerecordstobepackagedwithinasinglelibrary.AnotheradvantageofthisapproachisthatitcanbeautomatedandtheJARfileplacedinarepositoryfordependencymanagement.
Thesampleapplicationthataccompaniesthiscoursefollowsthe“compileandJAR”approach.Itsuppliesalibraryjarfilecontainingacompiledrecordclassthatcorrespondstothestockpartcopybook.
Inthissection,wehavelookedathowtheinterfacetoCICSprogramscanbedefined,andhowJavaapplicationscanuserecordgeneratorstomaptothisinterface.WethenshowedhowtheJZOSrecordgeneratorcouldbeusedtobuildaJavarecordfromthecompilerADATA.Finally,weshowedhowtopackagetheJavarecordintoalibraryfordistributiontodevelopers.
Inthenextsection,wewilllookatusingthisgeneratedrecordwhenlinkingtoaCICSCOBOLprogramfromaJavaapplication.
Formoredetailsonthesesteps,includingaworkedexamplewithcompleteJCL,havealookatthe“BuildingJavarecordsfromCOBOLwithIBMJZOS”ontheCICSdevelopercenter.
Thankyouforwatching.
Section3Lecture1Inthe“DevelopingaRESTfulWebapplicationforLibertyinCICS”course,welookedattheconceptofaCICSprogram.
Aprogramisaunitofcompiledcodethatprovidesapplicationlogic,andcanbedevelopedusingoneofmanylanguagessupportedintheCICSenvironment,includingJava.
TheterminologyusedwhencallingfromoneCICSprogramtoanotherisknownasalink.Thelinkcommandpassescontroltothetargetprogramandwaitsforittocomplete.
AlinkdiffersfromaJavamethodcallinthatthetargetprogramcanbeimplementedinanylanguagesupportedbyCICSandcanalsoresideonadifferentCICSsystem.
AJavamethodcallhoweverisconsiderablymorelightweightthanalinkcommand
WhenusingtheJCICSAPI,firstcreateaninstanceoftheProgramclass,andspecifythenameofthetargetprogramusingthesetName()method.
Toissuethelinksimplyinvokethelinkmethodontheprogramobject.Herewedonotpassanyargumentsonthelinkmethodsonodataispassedtothetargetprogram.
Whencommunicatingfromoneprogramtoanother,therearetwomainwaystopassdata---eitherthroughtheuseofacommarea-orthroughtheuseofchannelsandcontainers.
Nowlet’slookatpassingacommareaonalinkcommand
Acommareaisanareaofmemoryusedtopassdatabetweentwoprograms.
FromaCICSperspective,acommareaisjustasequenceofbytes,CICSdoesnotattempttoformatthedatastructureandjustfacilitatesthetransferofthedatabetweentheprograms.
Thedatastructureisdescribedusinganinterface,wherethefieldsaredefinedusingalanguagespecificstructuresuchasaCOBOLcopybookaswediscussedinthepreviouslecture.
ForaJavaapplicationtocommunicatewithanapplicationwritteninanotherlanguagewecanuseabytearraytorepresentthecommareaandtoholdthedatatobetransferred.Asnotedintheprevioussection,generatedJavaclassescanbeusedtomoreeasilyconstructtherequiredbytearray.
Inthisexample,welookatpassingasinglerecordfromourJavaapplicationintoanexistingCICSprogramusingtheCOMMAREAinterface.Thisrecordisdefinedbythestandardstockpartrecordformatcoveredearlier.
WhenusingtheJZOSrecordgeneratortooling,wecalledourgeneratedclass“StockPart”.So,ourfirsttaskistocreateaninstanceofthisclass,andpopulateitwithrelevantdata.
TheJZOSrecordgeneratortoolingdefinesgetterandsettermethodsintheJavaclass,thenamesofthesemethodscorrespondtothefieldsoftheoriginalCOBOLcopybook.
GetterandSettermethods,otherwiseknownas“accessor”methods,allowaJavadevelopertouseanobject-orientedapproachwhenbuildingarecord.
OncetheJavaobjecthasbeeninstantiated,wecanconvertitintoabytearrayusingthegetByteBuffer()method.Thisreturnsaserializedversionofthestructuredrecorddefinedintheoriginalcopybook.
Nowthatwehavethedataready,wecanusethistolinktothetargetprogram.
WecreateanewinstanceoftheProgramclass,andspecifythenameofthetargetprogramthatwewishtoLINKtousingthesetName()method.
Wetheninvokethelinkmethodonourprogramobject-thistimepassingtheStockPartbytearray
Onsuccessfulreturnfromthetargetprogram,anyupdatestothecommareawillbereflectedinthebytearray.
Here,wetaketheupdatedbytearrayandconstructanewStockPartobjecttorepresentthereturneddata.Subsequentcodemaythenreadvaluesfromthisnewly-constructedobjectusingtheaccessormethods.
Acommareaisabidirectionaltransfermechanism,andprogramscanusethisareatosendanyformatofdataineitherdirection.OurpreviousexamplesentarecordintheStockPartformat,andreceivedarecordinthesameformat.
Withalargeenoughdataarea,anyrecordformatcanbereturned.
Inthisexample,weuseaStockPartobjecttoconstructabytearraythatwillbepassedtoatargetprogram.Whencalled,thatprogramwilllookupthesupplierrecordandpopulatethecommareawitharecordformatdetailingthesupplierofthatpart.
HavingpreviouslycreatedasuitableJZOSclasstomaptherecordforasupplier-whenthelinkmethodcompletes-wecangenerateanewinstanceofthesupplierobjectfromthereturnedbytearray.Theresultingobjectcanbequeriedforthesupplierinformation.
CICSoffersanoptimizationonalinkcommandbyspecifyingthesizeofthedatatothetargetprogram-abenefitalsoavailablefromtheJCICSAPI.
Asanexample,apartlookuproutinemayonlyneeda8-bytepartnumberasinput,butwillrequirean80-bytecommareatoreturnthedata.Specifyingtheoptionalintparameterafterthebytearrayallowsthecallertospecifythedatalengthusedonthesend.
Inthisexample,abytearrayoflength80iscreatedbythecallingprogram,butthedatalengthisspecifiedas8.WhenCICSpassescontroltothetargetprogram,onlythefirst8bytesaretransmitted.Theremainderofthe80-bytecommareaispaddedwithzeroes.Whenthetargetprogramreturns,all80-bytesaresentbacktothecallingprogram.
ThisoptimizationcanbeusedtoreduceCPUandresponsetimes,especiallywherelargecommareasarerequiredforreturnvaluesorwherelinksflowbetweenCICSsystems.
RecallthattheothermethodofpassingdatafromoneprogramtoanotherisbyChannelsandContainers.Achannelisaconduitbetweenprograms,ittypicallyholdsoneormorecontainerstobepassedbetweentheprograms.Acontainerisanamedblockofdata.
Channelsandcontainersoffertheadvantagethatmorethan32KBofdatacanbepassed.Bycontrast,commareasareconfinedtoa32KBlimit.
Multiplecontainerscanbepassedbetweenprogramswithinachannel.Achannelisthereforeanalogoustoaparameterlist.
AworkedexampleofusingchannelsandcontainersinJCICSisavailableinthe“DevelopingaRESTfulWebapplicationforLibertyinCICS”course.Thesamplematerialsforthiscoursealsocontainanexampleofusingchannelsandcontainerstopassdata.
ThislecturehaslookedatthewaysinwhichtheJCICSAPIcanbeusedtoLINKtoanotherCICSprogram.
ThesamplesourcecodeprovidedwiththiscoursehasexamplesofalltheJCICScommandscoveredinthislecture.
ThenextlecturewilllookathowwecanlinkfromaCICSprogramintoaJavacomponentinaLibertyJVMserver
Section3Lecture2WebSphereLibertyprovidesaJavaEnterpriseEditionorJavaEEplatform,andisdesignedtohelpdeveloperscreatelarge-scaleenterpriseapplications.
UsingLinktoLiberty,anyCICSprogramcannowcallJavaEEapplicationsinaLibertyJVMserver.
TheCICSLINKcommandcaninvokePlainOldJavaObjects(POJOs)thathavebeendeployedinsideaWebapplication...justasiftheywereanyCICSprogram.
ToachievethisseamlessLINK,aCICSdefinedJavaannotationisappliedtoaJavamethodwithintheLibertyapplication.TheannotationindicatesthatthemethodshouldbeexposedastheentrypointforaCICSJavaprogram
WhentheapplicationisinstalledCICSwilldetecttheannotationmeta-dataandautomaticallycreateandinstallaPROGRAMresourceforeachentrypointdetected.
OncethesePROGRAMresourceshavebeencreated,thenaCICSapplicationwritteninanylanguagecanusetheLINKcommandandinvokethedesiredJavamethodpassingachannelastheinterface.Notethatacommareacannotbepassedinthisscenario.
Inthisexample,wehaveaclassorPOJOinaWebapplicationthatexposesthegetSupplierInfo()methodasanentrypoint.The@CICSProgramannotationisusedtoindicatethismethodshouldbemadeavailableasaPROGRAMresource.Whentheapplicationisinstalled,aCICSprogramresourcenamedGETSUPPLisautomaticallycreated,andisreadytobeinvoked.
DataispassedbetweencallingprogramandtheLibertyapplicationusingChannelsandContainers.
WithinthetargetJavamethod,JCICSisusedtogetareferencetothecurrentchannelandtoobtainthedatafromcontainersprovidedbythecaller.
Oursamplecodeprovidesacompleteimplementationofthegetsupplierinfomethod.ThesamplecodecouldbeextendedtouseJavaEEcapabilitiessuchasJAX-RSclientAPItorequestinformationfromasupplierusingaremote,RESTfulwebservice.
FromtheperspectiveofthecallingCOBOLapplication,ithasusedtheCICSLINKcommandtoinvokeanamedprogrampassingindataviaacontainer,andreceivedaresponseusingaCOBOLstructure.
ThePOJOcomponentinthewebapplicationwasabletoreceiveandprocessthecontainersandexploitJavaEE7functionality.
Inthissection,wehavelookedathowwecanlinktootherCICSprogramsusingmethodsontheJCICSProgramclass.
Usingourgeneratedrecord,wepasseddatatoexistingCICSapplicationsusingthecommareainterface.Thealternativemethodofpassingdatabetweenprograms-theCICSchannelsandcontainerssupport-wascoveredinthe“DevelopingaRESTfulWebapplicationforLibertyinCICS”course.
Finally,welookedathowCICScanmakeLibertyapplicationsavailabletotraditionalprograms,usingtheLinktoLibertycapability.
Inthenextsection,wewilllookathowtoaccessotherCICSresourcesusingtheJCICSAPI.
Section4Lecture1CICSprovidesaccesstoarangeofresourcetypes.SomeoftheseresourceslikeTemporaryStorageQueuesareuniquetoCICS,whileotherssuchasVSAMfilesarecommonacrossz/OS.Inthissection,wewillbelookingataccessingtheseresourcesusingtheJCICSAPI.
We'llcometotheCICS-specificresourcesshortly,butfirstlet’sstartwithVSAMfiles.
InCICS,datamanagementservicesaretraditionallyknownasCICSfilecontrol.CICSfilecontroloffersyouaccesstodatasetsthataremanagedbytheVirtualStorageAccessMethod,orVSAM.
Basicdirect-accessmethod,orBDAM,datasetsarenotsupportedbytheJCICSAPI,sothislecturewillfocusonVSAMfiles.
CICSfilecontrolletsyouread,update,add,delete,andbrowsedatainVSAMdatasets.YoucanalsoaccessCICSshareddatatablesandcouplingfacilitydatatablesusingthefilecontrolAPIs.
FilesmaybesharedbyapplicationswithinaCICSregion,oracrossthewiderz/OSsysplex.
ACICSapplicationprogramreadsandwritesitsdataintheformofindividualrecords.EachreadorwriterequestismadebyaCICScommand.
Toaccessarecord,theapplicationprogrammustidentifyboththerecordandthedatasetthatholdsit.
Thereareseveralmethodsthatcanbeusedtoidentifyarecord–whichonetousedependsonthetypeofVSAMfileinuse.WewilllookatthedifferenttypesofVSAMfilelater.
AnapplicationusesaCICSfileresourcetoidentifyadataset.ThisfileresourcehasauniquenamewithintheCICSregion,allowingtheapplicationtoremainagnosticoftheunderlyingdatasetname.
Itisnotnecessaryforanapplicationtoopenorcloseafileexplicitly,CICSmanagestheresourceonbehalfofallapplications.
Inthisdiagram,anapplicationaccessesaVSAMfileusingCICSfilecontrol.
TheapplicationidentifiesthedatasettobeusedbyreferencingtheCICSFILEresourcenamedSTOCK1.
TheSTOCK1fileresourceisdefinedtoreferencetheMVSdatasetTESTdotDATAdotSTOCK.
Theapplicationcouldlaterbedeployedintoadifferentsystem,whereafileresourceofthesamenamereferencesadifferentMVSdataset.
CICSsupportsaccesstothefollowingtypesofVSAMdataset:
• Key-sequenceddataset,orKSDS• Entry-sequenceddataset,orESDS• andRelativerecorddataset,orRRDS
Akey-sequenceddatasethaseachofitsrecordsidentifiedbyakey.Thekeyofeachrecordisafieldinapredefinedpositionwithintherecord.Eachkeymustbeuniqueinthedataset.
Anentry-sequenceddatasetisoneinwhicheachrecordisidentifiedbyitsrelativebyteaddressoroffset.
Arelativerecorddatasethasrecordsthatareidentifiedbytheirrelativerecordnumberororder.
TheVSAMdatasetstopicintheIBMKnowledgeCenterhasamorecomprehensivedescriptionofthesedifferentVSAMdatasets.
Ourexamplewilluseakey-sequenceddataset.
BeforewecanuseVSAMfiles,weneedtodefinethedatasetusingthez/OSutilityIDCAMS.
TheexampleshowssomesampleinputtotheIDCAMSutilitytodefineaVSAMfilenamedTEST.DATA.STOCK.WewillusethisdatasetinourexampletostorestockinformationfromtheStockPartrecordwegeneratedusingJZOSearlier.
Therecordskeywordindicatestheamountofspacethatthedisksubsystemneedstoreserveforthedataset,whiletheINDEXEDkeywordspecifiestheVSAMdatasetistobeusedforkey-sequenceddata.
TheKEYSkeywordspecifiesthateachrecordhasauniquekeythatiseightbytesinlengthandbeginsatoffsetzero.ThismatchestheSTOCKPARTrecordwedefinedearlier.
Finally,theRECORDSIZEkeywordspecifiesthatonaverage,eachrecordwillbeeightybytesinlength,withamaximumlengthofeightybytes.WhileVSAMfilessupportvariable-lengthrecords,oursimpleapplicationonlyusesfixed-lengthrecords.
Forthefullexample,seetheaccompanyingsampleprojectmaterialsinGithub.
Asdescribedearlier,aCICSapplicationisabstractedfromthephysicaldatasetsitusesbymeansofaCICSFILEresource.Inordertouseoursampleapplication,youwillneedtodefineandinstallaFILEdefinitionintotheCICSregion.
Forthisexample,mostofthedefaultswillbesuitable,withsomeexceptions.
Thefileresourcedefinitionrequiresanameofuptoeightcharacters–thesamplecodeusestheSMPLXMPLname.
IfyoudonotspecifythefileasaDDstatementinyourCICSstartupjob,youwillneedtospecifythephysicaldatasetnameusingtheDSNAMEattributeonthedefinition.
TofullydemonstratetheJCICSfilecontrolAPI,youshouldsetalloftheadd,browse,delete,read,andupdateattributestoyes,otherwiseCICSwillthrowanexceptionwhentheapplicationattemptstoperformanoperationthatisnotpermitted.
NowwearegoingtodevelopthewebapplicationtoaccesstheVSAMfile.
ThesampleclassVSAMKSDSfileresourceprovidesanumberofmethodstodemonstratethevariousaspectsofaccessingaVSAMfile.
Thesimplestofthesemethodsisthe“writenewrecord”methodwhichcreatesanewstockpartandaddsittotheVSAMfile.
Aswiththeexamplesinthe“DevelopingaRESTfulWebapplicationforLibertyinCICS”course,weuseasimpleRESTfulinterfacetoinvoketheJavacode.
TheCICSApplicationclassspecifiesabaseapplicationpathof“rest”,thereforeanyRESTfulresourcesaccessedinthiswebapplicationwillusethisstringasarootURI.
TheVSAMKSDSfileresourceclassspecifiesarelativeresourceURIofksdsusingthePathannotation,whilethewritenewrecordmethodspecifiesapathof“write”relativetotheparentresource.
Forthewritenewrecordmethod,wewouldthereforeusetheURI“rest/ksds/write”relativetothebaseURIoftheapplicationwheninstalledintoCICS.
OnlytheHTTPGETverbisrecognizedinthisapplication,asindicatedbytheGETannotationonthemethod.
ThewritenewrecordmethodreturnsaStockPartCollectionobject,whichisserializedtoJSONasdirectedbytheProducesannotationontheclass.TheStockPartCollectionobjectisasimplewrapperobjectthatcontainsalistofStockPartobjects.
TocreatearecordsuitableforinsertionintotheVSAMfile,thegeneratemethodinthestockparthelperclasscreatesaninstanceoftheJZOS-generatedStockPartclassandpopulatesitwithsampledata.
ThewritenewrecordmethodtakesthegeneratedrecordandconvertsthistoabytearrayusingtheJZOSgetbytebuffermethod.
Anothermethodinthestockparthelperclassextractstherecordkeyasabytearray.Recallthatthekeyforthestockpartrecordiseightbytesinlengthandbeginsatoffsetzero.ThehelperclassobtainsthebytearrayfromtheStockPartobjectandextractsthefirsteightbytesasanewbytearray.
Inthisexample,weareaccessingakey-sequenceddataset,orKSDSfile.ToreferencethisfileusingJCICS,wecreateaninstanceoftheKSDSclassandspecifythenameoftheCICSfileresource.
ThewritemethodontheKSDSclasstakestwobytearraysasparameters–thekeyandtherecordforwriting.
TheCICStransactionwouldautomaticallybecommittedonnormalcompletionoftheCICStask,butasasimpledemonstrationofmanagingunitsofwork,thesampleapplicationusestheTaskcommitmethodtoexplicitlycompletethecurrentunitofwork.
Finally,thequeryfilemethodisinvoked,whichreturnsaninstanceofthestockpartcollectionclass.
Thequeryfilemethodperformsafilebrowseoperation,startingattheveryfirstrecordinthefile,andreadingeachrecordintomemory.Eachrecordisconvertedtoastockpartobjectandaddedtothestockpartcollectioninstance.WhenserializedtoJSON,thisprovidesasimplemeansofviewingthecontentsofthesampleVSAMfileandhowitisaffectedbyeachfilecontroloperation.
Forclarity,thenecessaryerror-handlinglogichasnotbeenincludedhere,butisprovidedinthesamplecode.Wewillcovererror-handlinglaterinthecourse.
TheupdateRecord()methodprovidesanexampleofupdatingarecordinaVSAMfile.
Firstly,theKSDSfileisreferencedbycreatinganewinstanceoftheKSDSclass,aspreviouslydoneinthewritenewrecordmethod.
Toreaddatafromafile,arecordholderobjectisrequired.ThereadforupdatemethodontheKSDSclassisthencalled,passinginthreeparameters.
ThefirstparameteristhekeyoftherecordthatwewishtoreadfromtheVSAMfile.Inthiscase,wesupplyakeyofallzeroes,createdusingamethodinthestockparthelperclass.Akeyofallzeroesisusedinourapplication,simplytoobtainthefirstrecordintheabsenceofrealdata.
Thesecondparameterspecifiesthattheapplicationwillreadtherecordwithakeyequalto,orgreaterthan,thekeysupplied.
Thefinalparameteristherecordholderinstance,whichwillbeusedtoreceivethedatathatresultsfromtheVSAMfilereadoperation.
Onsuccessfulcompletionofthereadforupdatemethod,therecordholderinstancewillcontainabytearrayrepresentingtherecordinthedataset,aslocatedbythespecifiedkey.Thegetvaluemethodextractsthisbytearray,anditispassedtotheconstructorofthegeneratedstockpartclass.
Asecondstockpartinstanceiscreatedusingthegeneratemethodwecoveredearlier.Thepartid,orkey,fromthereadrecordiscopiedintothenewly-generatedrecord.Thisstepisusedasasimpledemonstrationofwherebusinesslogicwouldamendvaluesinareal-worldapplication.
WethenupdatetherecordintheVSAMfilebycallingtherewritemethod,supplyingthefullrecordasabytearray.
Notethatforarewriteoperation,wedonotneedtosupplythekey,asthiswasestablishedonthepreviousreadforupdateoperation.
Finally,weexplicitlycallthetaskcommitmethodtoreleaseanylocksweholdagainstthefile.
Whenexecutingthesamplecode,repeatedlyaccessingtherest/ksds/updatemethodbypressingrefreshinyourbrowserwillshowthefirstrecordinthefilebeingupdatedwithnewsampledata.
ThedeleterecordmethodintheVSAMKSDSfileresourceclassprovidesanexampleofdeletingarecordinaVSAMfile.
Theflowofthemethodisverysimilartotheupdaterecordexample,withareadforupdateoperationfindingthecorrectrecord,andthenthedeletemethodbeingcalledtodeletetherecordfromthefile.
Inthislecture,wehavelookedathowwecanusetheJCICSAPItoaccessVSAMKSDSfiles,usingourgeneratedJZOSclasstoprovideanobject-orientedmeansofaccessingstructuredrecordsondisk.ManyoftheconceptscoveredhereareequallyapplicabletoESDSandRRDSfiles.SeetheJCICSJavadocdocumentationforacompletereferenceonthesyntaxrequiredtoaccessthesetypesofVSAMfiles.
Inthenextlecture,wewilllookathowJavaapplicationscanaccessCICStemporarystoragequeues.
Section4Lecture2
CICStemporarystoragequeues,orTSQs,areameansofstoringasequenceofdataitems.
DatainaTSQcanbestoredinmainmemory,ondisk,knownasauxiliaryTSQs,orsharedviathesysplexcouplingfacility.
ThedataitemsinaTSQhaveamaximumsizeofjustunderthirtytwokilobytes,andcanbeaccessedinanyorder
TSQsarereferencedusinganameofupto16charactersinlength.Theycanbedefinedasbeingrecoverableornon-recoverableCICSresources.
Temporarystoragequeuesdonotneedtobedefinedinadvanceofanapplicationusingthem,andcanbeusedtosharedataacrossapplications.
SupportfortemporarystoragequeuesisprovidedintheJCICSAPIbyusingtheTSQclass.
InoursampleweareusingaTSQfromwithinaCICSLibertyWeb-applicationandbecauseHTTPrequestsarestateless,we'llneedsomemeansofpersistingtheTSQnameacrossmultipleHTTPrequests.
Toprovideasimple-to-usemethodofaccessingthesametemporarystoragequeuefromabrowseracrossmultiplerequests,thequeuenameisstoredinanHTTPsessionobject.
EverytimeabrowserissuesaGETrequestagainstthetemporarystorageresourceclass,thegetqueuemethodextractsthequeuenamefromtheHTTPsessionobject,andreturnsaJCICSTSQobjectthatcorrespondstothecorrectqueueforthatbrowsersession.
Examiningtheflowinmoredetail,thefirsttimeabrowseraccessesthesampleapplication,itissuesanHTTPGETrequestagainsttherestslashtsqslashwriteURI,andhasnocookietokentosendtotheserver.Thegetqueuemethodintheapplicationfindsnocookiehasbeensent,andhencenoHTTPsessionispresent.
Thegeneratequeuenamemethodisinvokedtocreateanew,uniquequeuename.ThisqueuenameisstoredinanHTTPsessionobject,whichispersistedautomaticallybytheLibertyruntime.
Thewritenewrecordmethodwillwriteanelementtothisnewqueue,andthenreturntotheclient.WhentheLibertycontainersendstheJSONresponsebacktothebrowser,italsoincludesanHTTPsessioncookieaspartoftheflow.
SubsequentrequestsfromthebrowserwillflowthisHTTPsessioncookietotheapplication,andthiscookieisusedbytheLibertyserverasakeytoretrievetheHTTPsessionobjectthatcorrespondstothebrowserinstancemakingtherequest.
BeforeweexaminetheJCICSAPIindetail,let’stakeabrieflookatsomeofthesamplecode’shelpermethods.
Thenameofthequeueusedbyoursampleapplicationiscreatedbythegeneratequeuenamemethod.Thiscreatesaqueuename,basedonaknownprefixandthecurrenttime.
ThesampletemporarystorageresourceclassprovidesexamplesofaccessingaTSQusingtheJCICSAPI,
Thewritenewrecordmethoddemonstrateshowtowriteasingleelementtoatemporarystoragequeue.
HereweusethegetqueuemethodtoobtainaninstanceoftheJCICSTSQclass.
ThisTSQobjectreferencestheCICStemporarystoragequeuethatisinusebythecurrentbrowsersession,usingthemechanismdescribedearlier.
AsamplerecordiscreatedusingthestockparthelperclasswecoveredwhenlookingatVSAMfileaccess,andabytearrayisobtainedusingtheJZOSgetbytebuffermethod.
WritingasingleelementtoaTSQisachievedbysimplycallingthewriteitemmethod,passingthedatatobewrittenasabytearray.
InasimilarmannertotheVSAMexamples,astockpartcollectionobjectisreturnedbythemethod,andisserialisedbytheLibertyserverasaJSONresponse.
Thiscollectionobjectiscreatedbythequeryqueuemethod,whichperformsabrowseacrossthequeue,addingeachqueueelementtothecollection.
Therearetwoimportantpointstonotefromthequeryqueuemethod.
Thefirstisthatelementsinatemporarystoragequeuearenumberedfromelementone,unlikemanyconstructsyoumaybeusedtoinJava.
ThesecondisthatitemsarereadfromaTSQusinganItemHolderinstance.ThisitemholderobjectperformsasimilarfunctiontotherecordholderwediscussedearlierforVSAMfiles.
AsinthepreviousVSAMexample,theupdaterecordmethodwillupdatethefirstelementinthequeue.
ThegetqueuemethodisagainusedtoobtaintheTSQcorrespondingtothecurrentbrowsersession,andanewsamplestockpartrecordiscreatedusingthestockparthelperclass.
TheTSQisupdatedthroughtheuseoftherewriteitemmethodintheTSQclass,whichtakestwoparameters–theitemindexandthenewdatatowritetothequeue.
Afterupdatingthequeue,ourqueryqueuemethodiscalledtoreturnthecontentsofthequeueasaJSONresponse.
Individualelementscannotbedeletedfromatemporarystoragequeue–itisonlypossibletodeleteanentirequeue.
ThedeletemethodintheTSQclasstakesnoargumentsanddeletesthecorrespondingtemporarystoragequeue.
ThedeletequeuemethodinoursamplecodegivesasimpleexampleofobtainingaTSQobjectandthendeletingtheunderlyingqueue.
Inthislecturewehavecoveredthebasicconceptsofatemporarystoragequeue,andlookedathowwecanusetheJCICSAPItoaccessthesequeuesfromJava.
Thankyouforwatching.
Section4Lecture3
Oneofthefundamentalconceptsoftransactionprocessingisthatresourceupdatesadheretotheatomicity,consistency,isolation,anddurabilityprinciples,commonlyknownastheACIDpropertiesofatransaction.
Resourcesaccessedbyaprogramaremanagedwithinatransactionalscopeknownasaunitofwork.AllrecoverableresourcesaccessedwithinasingleunitofworkareupdatedaccordingtotheACIDprinciples.
Aunitofworkmayeithercompletesuccessfully,knownasacommit,orunsuccessfully,knownasarollback.
InaCICStask,anactiveunitofworkisalwayspresent.
AunitofworkbeginsautomaticallyatthestartofaCICStask,beforecontrolispassedtotheapplication.UponsuccessfulcompletionofaCICStask,theunitofworkisautomaticallycommitted.
IfaCICStaskterminatesabnormally,thentheactiveunitofworkisrolled-backandanyupdatestorecoverableresourcesareundone.
UpdatestorecoverableCICSresourcesmadefromJavaapplicationswillbesubjecttothesameunitofworkconstraintsasotherCICSprograms.
Itisalsopossibleforanapplicationtomangetheunitofworkboundaries.
TheJCICScommitandrollbackmethodsintheTaskclasscanbeusedtocompletethecurrentunitofworkandupdateresourcesaccordingly.
OncethecurrentunitofworkhasbeencompletedinCICS,anewunitofworkisautomaticallycreated,ensuringthatanyresourceupdatesalwaysoccurwithinaunitofwork.
Wherelargenumbersofresourcesarebeingupdatedinlong-runningtasks,iftheapplicationdesignpermits,itisrecommendedthatunitsofworkarecommittedperiodically.Thiswillreducethenumberofoutstandinglocksthatareheldbytheapplication,andpotentiallyimproveoverallsystemthroughput.
ThewritenewrecordmethodinourVSAMsampleshowsanexampleofexplicitlycommittingthecurrentCICSunitofwork.
Inthissection,wehavelookedatthecharacteristicsofseveralCICSresources,andhowtoaccessthemusingtheJCICSAPI.
InthislecturewecoveredtheCICSsupportforunitsofwork,andhowapplicationscancontrolthescopeofupdatestorecoverableresources.
Inthenextsection,wewilllookathowJavaapplicationscansuccessfullyhandleapplicationandsystemerrors,inordertoproducemorerobustapplications.
Oursampleapplicationcodeprovidesexamplesofaccessingkey-sequencedVSAMfiles,CICStemporarystoragequeues,andalsoCICStransientdataqueuesusingJCICS.
Thankyouforwatching.
Section5Lecture1
Itisimportanttoprovidegooderror-handlinglogicinenterprise-classsoftwaretogracefullyhandlearangeofapplicationandsystemproblems.
Inthissection,wewilllookathowJavahandleserrorsingeneral,thenapplythatknowledgetotheJCICSAPI.
Duringexecutionofanapplication,variouserrorconditionsmayarise.Theseerrorconditionsmayhavemanyrootcauses,butfundamentallytheycanbecategorisedintothreemaintypes:expectederrors,unexpectederrors,andfatalerrors.
Expectederrorsareconditionsthatcanbereasonablyforeseenbyanapplicationdeveloper.Forexample,attemptingtoreadanon-existingrecordfromaVSAMfileislikelytobeaconditionthattheapplicationisexpectedtohandle.
Unexpectederrorsareconditionsthatmayoccur,butarenotnormallyexpectedtobehandledbytheapplication.Forexample,aprogrammayattempttoaccessanelementofaJavaarraywhichdoesnotexist.Thisprobablyrepresentsaprogrammingerror,andasaresult,theapplicationislikelytobeinanindeterminatestate.
Fatalerrorsarethemostseriousofallerrorconditions,andusuallyrepresentasituationfromwhichanapplicationisunlikelytobeabletorecover.AnexampleofafatalerroroccurringwouldbeiftheJavavirtualmachinefailedtoloadaJavaclassrequiredbyanapplication.
ErrorconditionsintheJavalanguagearemanagedusingtheexceptionmechanism.
IfaJavamethodencountersanerrorcondition,thenaspecialJavaobjectcalledaThrowableiscreatedtocapturethestateofthecurrentthreadatthetimeoftheerror,andthisobjectispropagatedtothecallerofthecurrentmethod–aprocessknownasthrowinganexception.Correspondingly,handlingtheerrorconditionisknownascatchinganexception.Acallingmethodusesatrykeywordtoindicatethescopeoftheerrorhandlinglogic.
TheJavalanguagespecifiesthattheobjectsusedwhenpropagatingexceptionsmustbeinstancesofatypewhichextendstheThrowableclass.TheThrowableclassitselfhastwodirectsubclasses–ExceptionandError.Therearemanysub-classesofException.However,theRuntimeExceptionsubclassisaspecialcaseandisnotclassifiedasacheckedexceptionasitrepresentsunexpectedruntimeerrors.
Together,thecheckedexception,runtimeexception,anderrorclassesrepresenterrorconditionsinJavacodethatcorrespondtotheexpected,unexpected,andfatalerrorcategoriesthatwecoveredearlier.
InJava’serrorhandlingmechanism,expectederrorsextendtheExceptionclass,andareknownascheckedexceptions.
TheJavalanguagespecifiesthatanymethodwhichcanthrowacheckedexceptionmustdeclarethisaspartofthemethodsignature,usingthethrowskeyword.
AnyJavacodewhichcallsamethoddeclaredasthrowingacheckedexceptionmusteitherprovidelogictocatchthecheckedexception,oraddtheexceptiontoit’sownmethodsignature,inordertopropagatetheexceptionfurtherupthestack.
Theconstraintsoncheckedexceptionsareenforcedatcompiletime,andfailuretoadheretothespecificationwillresultinacompilationerror.
UnexpectederrorconditionsarerepresentedbyJavaclasseswhichextendtheRuntimeexceptionclass,andareknownasuncheckedexceptions.
Uncheckedexceptionsarenotsubjecttothecompiletimecheckingmandatedforcheckedexceptions,althoughtheycanbecaughtifrequired.
FatalerrorconditionsarerepresentedbyJavaclasseswhichextendtheErrorclass.ItisconsideredpoorprogrammingpracticetocatchanyexceptionsthataresubclassesoftheErrorclass,astheserarelyrepresentaconditionfromwhichtheapplicationwillbeabletorecover.
NowletstakealookathowCICSerrorhandlingismanagedforCOBOLandotherhighlevellanguages.
TheselanguagesthatusetheEXECCICSAPIhavethreechoiceswhenhandlingerrorconditions:onaper-commandbasis,usingaconditionhandler,orusinganabendhandler.
IfaCICScommandproducesanerror,thenitwillfirsttrytoreturnaresponsecodetotheapplicationusingthedataareasuppliedintheRESPparameteroftheCICScommand.
IfaRESPparameterhasnotbeensupplied,thenCICSwillsearchforanactiveconditionhandler.ConditionhandlersareregisteredinadvanceusingtheEXECCICSHANDLECONDITIONcommand,andperformsomeformofapplication-specificrecoveryoperation.
Ifnoactiveconditionhandlerisfound,thenCICSwillabnormallyend,orabendthetask.TherearemanytypesofCICSabendsdefined,eachcorrespondingtoaspecificerrorcondition,andabendsareclassifiedbytheirfour-characterabendcode.
Whenanabendoccurs,CICSwillsearchforanactiveabendhandlerthatmatchesthegeneratedabend.Similartoconditionhandlers,anabendhandlerroutineisregisteredinadvanceusinganEXECCICSHANDLEABENDcommand.
Ifanactiveabendhandlercannotbelocated,thenCICSwillabnormallyterminatethecurrenttask,whichinturnwillrollbackanyuncommittedupdatestorecoverableresourcesinthecurrentunitofwork.
NowletsconsiderhowCICSerrorsmaptotheJCICSAPI.
TheJCICSexceptionhierarchyincludesuncheckedexceptions,checkedexceptions,andfatalerrors.
ThekeytothemappingbetweenCICSerrorsandtheJCICSexceptionhierarchyisunderstandingwheretheseexceptionscouldbethrown,howtheymaptotheCICSresponsecodes,andwhatactionyoushouldtakeasanapplicationdeveloper.
Let'sstartbylookingatcheckedexceptions.
HereweseethekeyclassesinvolvedintheJCICSexceptionhierarchy.MostJCICSmethodsaredefinedasthrowingcheckedexceptions,andthesecheckedexceptionsrepresentthemajorityofconditionsthatanapplicationmaybeexpectedtohandle.
EacherrorconditionfromaCICScommandismappedtoanexception,andthisexceptionisasubclassoftheCICSconditionexception.
Asanexample,theCICScommandtoreadanelementfromatemporarystoragequeuemayreturnanITEMERRORconditiontoindicatethequeuedidnotcontaintheelementrequested.
IntheJCICSAPI,anelementisreadfromtheTSQusingthereaditemmethod.Thismethodsignaturedeclaresitmaythrow(amongstothers)anItemErrorException,whichistheJCICSAPIequivalentoftheITEMERRORcondition.
SeethequeryqueuemethodinthetemporarystorageresourcesampleclasstoseehowtheITEMERRORandQIDERRconditionsarehandledasexpectederrors,whileanyothererrorconditionresultsinafailureoftherequest,
ThereareonlyafewuncheckedexceptionsintheJCICSAPI,andtheyallextendtheCICSruntimeexceptionclass.
AlloftheseexceptionsrepresentconditionswithinCICSthatshouldnotbehandledbyanapplication.
JavacoderunninginCICSshouldnotcatchtheseexceptions,eitherexplicitlyinacatchblock,orimplicitlybycatchingasuperclassoftheseexceptions.Instead,theyshouldbeallowedtopropagateoutoftheJavaenvironmentandbacktoCICS,wheretheunitofworkcanberolledback.
NoteincludedinthislististheAbendExceptionwhichrepresentsanabendofaCICStask,andshouldonlybecaughtifyouwishtodevelopyourownabendhandlingroutine.
ItimportanttostressthathavingatryblockthatcatchesanysuperclassofthejavadotlangdotexceptionclassshouldnotbeusedwheninvokingtheJCICSAPI.
ItimportanttostressthathavingatryblockthatcatchesanysuperclassofthejavadotlangdotexceptionclassshouldnotbeusedwheninvokingtheJCICSAPI.
<<Notetovideoteam.Youwillprobablyneedtopausethespeakerhereforashortwhile–thecomplexityofthisslidewasn’treallythoughtaboutwhenpreparingthescript.ThankfullyIamoff-screen.>>
TheJavaErrorclassrepresentsafatalerrorconditionintheJVMthatshouldnotbecaughtbyanapplication.
ThesameappliestotheCICSerrorclass,whichextendsjavadotlangdoterror.AnapplicationshouldnotattempttohandleafatalCICSerror,butinsteadallowtheexceptiontopropagatebacktotheCICSenvironmenttoallowfullrecoverytotakeplace.
IfaJavaexceptionsuchasanullpointerexceptionisallowedtopropagateoutoftheJavacodeandbacktotheJVMserverruntime,thisisgenerallysurfacedasoneoftheCICSabendsstartingwithAJ.
Mostcommonly,anuncaughtexceptionwillresultinanAJ04abend,andthecurrentunitofworkwillberolled-back.
ItisalsopossibleforaJavaapplicationtoissueanabenddirectly,usingoneoftheabendorforceabendmethodsintheTaskclass.ThisissimilarinconcepttothethrowingofJavaexception,asitcanallowsaCICSabendhandlertotakecontroloferrorprocessing.
Thevariousformsoftheabendmethodallowanapplicationtooptionallyspecifyanabendcodeorifadumpisrequired.
Theforceabendmethodsprovidethesameoptionsastheirequivalentabendmethods,butareequivalenttospecifyingtheCANCELkeywordontheEXECCICSABENDcommand.Invokingaforce
abendmethodwillalwaysterminatethetaskabnormally,andoverridesanyexistingabendhandlersthathavebeenestablishedforthetask.
InoursampleVsamKsdsFileResourceclassweusethefollowingtrycatchblocktohandleCICSerrorconditionswhendeletingitemsfromaVSAMfile
TheRecordNotFoundExceptionisacheckedexceptionbutisanormalsituationontheinitialbrowse,assocanbeignoredwhenbrowsingthefile.
AllotherCICSconditionexceptionareunexpected,andinthissituationwethrowtheJAX-RSInternalServerErrorExceptionwhichwillcauseaHTTPservererrortobereturnedtothecaller.
ThislecturehasintroducedtheconceptofcheckedanduncheckedexceptionsinJava,alongwiththethrowingandcatchingmechanismusedtopropagatetheexceptionobjects.
WehaveseenhowtheJCICSAPImapsCICSerrorconditionvaluestoexceptions,andhowCICSabendsareprocessed.
RememberitisacceptableforanapplicationtocatchandhandleCICSconditionexceptions,butitstronglyrecommendedthatCICSruntimeexceptionsareallowedtopropagatebacktotheCICSenvironment.
Finally,welookedathowJavaexceptionsaremappedtoabendsinCICSprograms,alongwiththeAPIsrequiredtoissueabendsdirectlyfromJavacode.
Thankyouforwatching.
Section6Lecture1
Inthiscourse,wehaveextendedourknowledgeofJavadevelopmentinCICS.
WecoveredsomeofthefundamentalconceptsyouneedtounderstandasaJavadeveloperwheninteractingwithCICS,andthenusedthesefundamentalstoinvokeCICSprogramsfromtheLibertyenvironment.
WethenlookedattheuseoftheJCICSAPItoaccessCICSresourcesincludingVSAMfilesandTSQs,andexaminedhowJavaapplicationscanparticipateinCICSunitofworksupport.
Finally,welookedattheconceptsandpracticalitiesofhandlingerrorconditionsusingJava.
Manycodesamples,includingtheonesusedinthiscourse,areavailableonourCICSDevgithubsite.
ThisconcludesourcoursearoundextendingaCICSwebapplicationusingJCICS.
Thank-youforwatching.