Using Task Resource Injection

Hi,

I've successfully implemented and tested a normal Executor using the DistributedTask interface.

Everything works fine, but now I need to implement also Task Resource Injection (http://www.gigaspaces.com/wiki/display/XAP66/Executors+Component#ExecutorsComponent-TaskResourceInjection) and this doesn't seem to work.

My PU is like this:

class MyPU {
  private Properties prop;
  MyPU() {prop = new Properties();}
  ...
}

And My Task is:

@AutowireTask
class MyTask implements DistributedTask<Integer, Long> {

@Resource(name="prop")
private transient Properties prop;

public Integer execute() throws Exception {
        System.out.println("Before");
        System.out.println(prop.size());
        System.out.println("After");
        return 1;
}

...

}

The Task, when executed, correctly prints "Before" in the server but then, in the client, throws a NullPointerException because prop is null.

Did I miss something?

Thanks in advance ;)

This thread was imported from the previous forum.
For your reference, the original is available here

asked 2009-03-19 10:13:08 -0500

epper gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete