Changeset 526 for trunk/zoo-project


Ignore:
Timestamp:
Nov 4, 2014, 4:41:26 PM (6 years ago)
Author:
djay
Message:

Add simple example of Java ZOO-API use

Location:
trunk/zoo-project/zoo-services/hello-java
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-services/hello-java/HelloJava.java

    r1 r526  
    3232        HashMap tmp=(HashMap)(inputs.get("S"));
    3333        String v=tmp.get("value").toString();
    34         hm1.put("value","Hello "+v+" from JAVA World !!");
     34        hm1.put("value",ZOO._("Hello "+v+" from JAVA World !!"));
    3535        outputs.put("Result",hm1);
    36         return 3;
    37   }
     36        return ZOO.SERVICE_SUCCEEDED;
     37    }
     38    public static int JavaLongProcess(HashMap conf,HashMap inputs, HashMap outputs) {
     39        HashMap hm1 = new HashMap();
     40        hm1.put("dataType","string");
     41        HashMap tmp=(HashMap)(inputs.get("S"));
     42        String v=tmp.get("value").toString();
     43        Integer i;
     44        for(i=0;i<100;i+=5){
     45            ZOO.updateStatus(conf,String.valueOf(i),"Currently executing tasks "+String.valueOf(i/5)+"..");
     46            try{
     47                Thread.sleep(2000);
     48            }catch(java.lang.InterruptedException e){
     49            }finally{
     50            }
     51        }
     52        hm1.put("value",ZOO._("Hello "+v+" from JAVA World !!"));
     53        outputs.put("Result",hm1);
     54        return ZOO.SERVICE_SUCCEEDED;
     55    }
    3856}
     57
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png