Hi All,
I am calling a java program from a unix script .
My oblectives are
1)to pass value from scripts to main java class
2)main class should create a child thread and pass data to child and should return control back to script
3)child thread should run independtly of parent
The calling unix script is part of process and hence should return control back to its calling script immediately.
Findings
1)Without passing data thru setter getter /constructor method to child thread my objectives are met
2)When I pass the data from parent thread to child thread calling unix scripts wait till child thread finishesh its working
call.scr
java Main <list of Arguments>
Main.java
public class Main
{
public static void main(String args[]) throws Exception
{
String data2="Z";
String data1=null;
for(int i=0;i<args.length;i++)
{
data2=data2+","+args[i];
}
data1=data2;
Child cu=new Child();
cu.setData(data1);
data2=null;
data1=null;
cu.start();
}
}
Child.java
class Child extends Thread
{
public String data;
void setData(String data)
{
this.data=data;
}
public void run()
{
----------> processing on data
}
}
I think due to passing of data from parent thread to child thread (Inter thread data communication/Inter process communication)
the threads are not working as desired.
Plz anybody can suggest something.....
Thanx.