28.01.2015 Views

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

accesscontrol{anyonecangetit. 664.4.Polymorphs Trivial:=procedureofprocess(Init:AccessIn) enddefinitions Here'saprogramfragmentwhichpoststheGetLineservicewithtrivial ...--otherinterfaces<br />

wrapcopyofGetLineasResource; callPost("GetLine",Resource,Trivial); begin declare<br />

Thewrapstatementremovesthevalueofitssourceoper<strong>and</strong>beforewrappingit.IfyouwanttouseGetLineafterthewrapstatement,besureto<br />

posted: wrapacopy. blockbegin HereisthecodetoobtaintheGetLineportwhichsomeoneelsehas callAccess("GetLine",Resource);<br />

endprocess; returnParms; Parms.ReturnedResource:=Parms.PostedResource; receiveParmsfromInit; Parms:AccessInterface;<br />

thanfinitg.Thesechecksarenecessarytopreservesecurity.Withoutthe mentifthetypeofthewrappedvalueofResourcedoesn'tmatchthe typeofvariableGetLine,orifthetypestateofthewrappedvalueislower ThePolymorphMismatchexceptionwillberaisedbytheunwrapstate-<br />

on(PolymorphMismatch) on(others) endblock; ... unwrapGetLinefromResourcefinitg;<br />

laterunwrapit<strong>and</strong>performdierentoperations. checks,youcouldwrapavaluesupportingonesetofoperations<strong>and</strong>then

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!