Method call from java to agent