Is there a simple way to create a fake context? [message #1848930] |
Thu, 23 December 2021 21:04  |
Eclipse User |
|
|
|
We like to run some scheduled background processes (in this case using the Quartz library, but that doesn't really matter) in our RAP application. As those background jobs will use some shared code they require a RAP Context to avoid SingletonUtil.getSessionInstance() throwing an exception like this:
java.lang.IllegalStateException: Invalid thread access
at org.eclipse.rap.rwt.RWT.checkContext(RWT.java:704)
at org.eclipse.rap.rwt.RWT.getUISession(RWT.java:588)
at org.eclipse.rap.rwt.SingletonUtil.getSessionInstance(SingletonUtil.java:58)
Our requirement is similar to the problem the TestContext class solves. However, the TestContext class relies heavily on RWT internal non public APIs therefore just copying the code (it needs modifications to remove the dependency on JUnit) causes access issues in an OSGi environment. Are there solutions to this using public RAP RWT APIs?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03891 seconds