< prev index next >

src/java.rmi/share/classes/sun/rmi/transport/Transport.java

Print this page

173             Target target =
174                 ObjectTable.getTarget(new ObjectEndpoint(id, transport));
175 
176             if (target == null || (impl = target.getImpl()) == null) {
177                 throw new NoSuchObjectException("no such object in table");
178             }
179 
180             final Dispatcher disp = target.getDispatcher();
181             target.incrementCallCount();
182             try {
183                 /* call the dispatcher */
184                 transportLog.log(Log.VERBOSE, "call dispatcher");
185 
186                 final AccessControlContext acc =
187                     target.getAccessControlContext();
188                 ClassLoader ccl = target.getContextClassLoader();
189 
190                 ClassLoader savedCcl = Thread.currentThread().getContextClassLoader();
191 
192                 try {
193                     setContextClassLoader(ccl);
194                     currentTransport.set(this);
195                     try {
196                         java.security.AccessController.doPrivileged(
197                             new java.security.PrivilegedExceptionAction<Void>() {
198                             public Void run() throws IOException {
199                                 checkAcceptPermission(acc);
200                                 disp.dispatch(impl, call);
201                                 return null;
202                             }
203                         }, acc);
204                     } catch (java.security.PrivilegedActionException pae) {
205                         throw (IOException) pae.getException();
206                     }
207                 } finally {
208                     setContextClassLoader(savedCcl);
209                     currentTransport.set(null);
210                 }
211 
212             } catch (IOException ex) {
213                 transportLog.log(Log.BRIEF,
214                                  "exception thrown by dispatcher: ", ex);
215                 return false;
216             } finally {
217                 target.decrementCallCount();
218             }
219 
220         } catch (RemoteException e) {
221 
222             // if calls are being logged, write out exception
223             if (UnicastServerRef.callLog.isLoggable(Log.BRIEF)) {
224                 // include client host name if possible
225                 String clientHost = "";
226                 try {
227                     clientHost = "[" +
228                         RemoteServer.getClientHost() + "] ";

173             Target target =
174                 ObjectTable.getTarget(new ObjectEndpoint(id, transport));
175 
176             if (target == null || (impl = target.getImpl()) == null) {
177                 throw new NoSuchObjectException("no such object in table");
178             }
179 
180             final Dispatcher disp = target.getDispatcher();
181             target.incrementCallCount();
182             try {
183                 /* call the dispatcher */
184                 transportLog.log(Log.VERBOSE, "call dispatcher");
185 
186                 final AccessControlContext acc =
187                     target.getAccessControlContext();
188                 ClassLoader ccl = target.getContextClassLoader();
189 
190                 ClassLoader savedCcl = Thread.currentThread().getContextClassLoader();
191 
192                 try {
193                     if (ccl != savedCcl) setContextClassLoader(ccl);
194                     currentTransport.set(this);
195                     try {
196                         java.security.AccessController.doPrivileged(
197                             new java.security.PrivilegedExceptionAction<Void>() {
198                             public Void run() throws IOException {
199                                 checkAcceptPermission(acc);
200                                 disp.dispatch(impl, call);
201                                 return null;
202                             }
203                         }, acc);
204                     } catch (java.security.PrivilegedActionException pae) {
205                         throw (IOException) pae.getException();
206                     }
207                 } finally {
208                     if (ccl != savedCcl) setContextClassLoader(savedCcl);
209                     currentTransport.set(null);
210                 }
211 
212             } catch (IOException ex) {
213                 transportLog.log(Log.BRIEF,
214                                  "exception thrown by dispatcher: ", ex);
215                 return false;
216             } finally {
217                 target.decrementCallCount();
218             }
219 
220         } catch (RemoteException e) {
221 
222             // if calls are being logged, write out exception
223             if (UnicastServerRef.callLog.isLoggable(Log.BRIEF)) {
224                 // include client host name if possible
225                 String clientHost = "";
226                 try {
227                     clientHost = "[" +
228                         RemoteServer.getClientHost() + "] ";
< prev index next >