Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
// call job/subjob with an existing context, like:
// --context=production. if without this parameter, there will use
// the default context instead.
java.io.InputStream inContext = contextPere.class.getClassLoader()
.getResourceAsStream(
"itf_sap/contextpere_0_1/contexts/" + contextStr
+ ".properties");
if (isDefaultContext && inContext == null) {
} else {
if (inContext != null) {
// defaultProps is in order to keep the original context
// value
defaultProps.load(inContext);
inContext.close();
context = new ContextProperties(defaultProps);
} else {
// print info and job continue to run, for case:
// context_param is not empty.
System.err.println("Could not find the context "
+ contextStr);
}
if (!context_param.isEmpty()) {
context.putAll(context_param);
}
System.out.println("contextStr : " + contextStr);
System.out.println("firstname : " + context.firstname);
System.out.println("lastname : " + context.lastname);
Starting job f28400 at 21:55 11/03/2013.
connecting to socket on port 3543
connected
contextStr : Default
firstname : null
lastname : null
disconnected
Job f28400 ended at 21:55 11/03/2013.
Starting job father_f28400 at 21:58 11/03/2013.
connecting to socket on port 3336
connected
contextStr : Default
firstname : david
lastname : bowie
disconnected
Job father_f28400 ended at 21:58 11/03/2013.
connecting to socket on port 3708
connected
contextStr : Default
firstname : null
lastname : null
disconnected
connecting to socket on port 3888
connected
contextStr : test
firstname : null
lastname : null
disconnected
Starting job f28400 at 22:21 11/03/2013.
connecting to socket on port 3718
connected
contextStr : Default
firstname : kirk
lastname : hammet
disconnected
Job f28400 ended at 22:21 11/03/2013.
Starting job f28400 at 22:22 11/03/2013.
connecting to socket on port 3829
connected
contextStr : test
firstname : nina
lastname : hagen
disconnected
Job f28400 ended at 22:22 11/03/2013.
Starting job father_f28400 at 22:23 11/03/2013.
connecting to socket on port 3455
connected
contextStr : test
firstname : david
lastname : bowie
disconnected
Job father_f28400 ended at 22:23 11/03/2013.
Starting job father_f28400 at 22:25 11/03/2013.
connecting to socket on port 3655
connected
contextStr : Default
firstname : kirk
lastname : hammet
disconnected
Job father_f28400 ended at 22:25 11/03/2013.
Starting job father_f28400 at 22:25 11/03/2013.
connecting to socket on port 3791
connected
contextStr : test
firstname : nina
lastname : hagen
disconnected
Job father_f28400 ended at 22:25 11/03/2013.
But the contextStr in the child says test which is NOT the father context which was supposed be transmitted down to the child
There is no indicator that shows the context of a job is being overwritten by a parent job.
connecting to socket on port 3946
connected
localhost
disconnected
connecting to socket on port 4064
connected
funny.bunny.com
disconnected
I was assuming (erroneously) that when a context 'set' was set at runtime, it would apply to all subjobs of the job that was kicked off