Support callback in JavaScript and Java communication.