Calling the applet from Javascript
Posted: Sat May 30, 2015 5:48 pm
I'm having intermittent crashes when calling the applet to load up a file and am sure its something I'm not doing right.
I see two different methods used..
this one elevates privileges
this one calls runnable, elevates privileges and waits on a thread.
1.) Why the difference?
2.) If I add a function which should I use?
3.) If I return a value there is no built in thread accessors?
4.) What happens if these get stacked? elevate, calls another elevate?
thanks,
Scott
I see two different methods used..
this one elevates privileges
Code: Select all
public String getSerializedDocument() {
//EXM-27477 This method might come from Javascript code, elevate privileges.
return AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
StringBuilder builder = new StringBuilder();
BufferedReader reader = new BufferedReader(editorComponent
Code: Select all
public void setDocumentContent(final String url, final String xmlContent)
throws AuthorComponentException {
documentURL = url;
Runnable runnable = new Runnable() {
@Override
public void run() {
//EXM-27477 This method might come from Javascript code, elevate privileges.
AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
invokeOnAWT(new Runnable() {
@Override
public void run() {
2.) If I add a function which should I use?
3.) If I return a value there is no built in thread accessors?
4.) What happens if these get stacked? elevate, calls another elevate?
thanks,
Scott