|
Lines 104-131
Link Here
|
| 104 |
private final class UIThreadController implements Runnable { |
104 |
private final class UIThreadController implements Runnable { |
| 105 |
public void run() { |
105 |
public void run() { |
| 106 |
IUIThreadHolder uiThread = ( IUIThreadHolder )Thread.currentThread(); |
106 |
IUIThreadHolder uiThread = ( IUIThreadHolder )Thread.currentThread(); |
| 107 |
try { |
107 |
// [rh] sync exception handling and switchThread (see bug 316676) |
|
|
108 |
synchronized( uiThread.getLock() ) { |
| 108 |
try { |
109 |
try { |
| 109 |
synchronized( uiThread.getLock() ) { |
110 |
try { |
| 110 |
uiThread.updateServiceContext(); |
111 |
uiThread.updateServiceContext(); |
| 111 |
UICallBackManager.getInstance().notifyUIThreadStart(); |
112 |
UICallBackManager.getInstance().notifyUIThreadStart(); |
| 112 |
continueLifeCycle(); |
113 |
continueLifeCycle(); |
| 113 |
createUI(); |
114 |
createUI(); |
| 114 |
continueLifeCycle(); |
115 |
continueLifeCycle(); |
| 115 |
UICallBackManager.getInstance().notifyUIThreadEnd(); |
116 |
UICallBackManager.getInstance().notifyUIThreadEnd(); |
|
|
117 |
} catch( UIThreadTerminatedError thr ) { |
| 118 |
throw thr; |
| 119 |
} catch( Throwable thr ) { |
| 120 |
IServiceStateInfo stateInfo = ContextProvider.getStateInfo(); |
| 121 |
stateInfo.setAttribute( UI_THREAD_THROWABLE, thr ); |
| 116 |
} |
122 |
} |
| 117 |
} catch( UIThreadTerminatedError thr ) { |
123 |
// In any case: wait for the thread to be terminated by session timeout |
| 118 |
throw thr; |
124 |
uiThread.switchThread(); |
| 119 |
} catch( Throwable thr ) { |
125 |
} catch( UIThreadTerminatedError e ) { |
| 120 |
IServiceStateInfo stateInfo = ContextProvider.getStateInfo(); |
126 |
// If we get here, the session is being invalidated, see |
| 121 |
stateInfo.setAttribute( UI_THREAD_THROWABLE, thr ); |
127 |
// UIThread#terminateThread() |
|
|
128 |
( ( ISessionShutdownAdapter )uiThread ).processShutdown(); |
| 122 |
} |
129 |
} |
| 123 |
// In any case: wait for the thread to be terminated by session timeout |
|
|
| 124 |
uiThread.switchThread(); |
| 125 |
} catch( UIThreadTerminatedError e ) { |
| 126 |
// If we get here, the session is being invalidated, see |
| 127 |
// UIThread#terminateThread() |
| 128 |
( ( ISessionShutdownAdapter )uiThread ).processShutdown(); |
| 129 |
} |
130 |
} |
| 130 |
} |
131 |
} |
| 131 |
} |
132 |
} |