You can use ALH API to get a context or a runtime object of a current script evaluation. It is equivalent to $context$ and self.
 

public Object_ getContext() {
...
}