Research Article
MCAF: Developing an Annotation-Based Offloading Framework for Mobile Cloud Computing
Algorithm 1
Generating a new class “A_” that extends from class “A” and then overwriting the “Add” method by inserting the offloading instructions.
(1) | public class A_ extends A { | (2) | int Add(int x, int y) { | (3) | isAddClassNeedUpload = Decider.getClassUploadStatus(); | (4) | if (isAddClassNeedUpload) { | (5) | isAddClassRemoteExists = Decider.getRemoteExistsStatus(); | (6) | if (!isAddClassRemoteExists) { | (7) | ClientProxy.uploadClass(“xx/xxx/AddClass.Class”);} | (8) | return ClientProxy.getResult(“Add”, x, y); | (9) | } | (10) | return x + y; | | } | | } |
|