Working with custom Java services in WaveMaker is not radically different from working with Java in web applications. So far, we've added resources to the classpath and got our project into a proper editor. The last Java topic specific to WaveMaker to be aware of is RuntimeAccess
(http://dev.wavemaker.com/docs/javadoc/6.5/com/wavemaker/runtime/RuntimeAccess.html). The com.wavemaker.runtime.RuntimeAccess
class is the runtime bean that provides our interface to the session, request/response, and other project services.
To obtain an instance of the runtime bean, use the static method getInstance()
. Ensure you've imported RuntimeAccess
:
import com.wavemaker.runtime.RuntimeAccess;
To get an instance of the runtime, use the following line of code:
RuntimeAccess runtime = RuntimeAccess.getInstance();
Note
Never attempt to renew RuntimeAccess
or otherwise attempt to access the session outside of a request. It is not supported and it doesn't work.
From RuntimeAccess
, we can obtain four useful...