/** * Determine whether the given RMI exception indicates a connect failure. * <p>Treats RMI's ConnectException, ConnectIOException, UnknownHostException, * NoSuchObjectException and StubNotFoundException as connect failure. * @param ex the RMI exception to check * @return whether the exception should be treated as connect failure * @see java.rmi.ConnectException * @see java.rmi.ConnectIOException * @see java.rmi.UnknownHostException * @see java.rmi.NoSuchObjectException * @see java.rmi.StubNotFoundException */ public static boolean isConnectFailure(RemoteException ex) { return (ex instanceof ConnectException || ex instanceof ConnectIOException || ex instanceof UnknownHostException || ex instanceof NoSuchObjectException || ex instanceof StubNotFoundException || ex.getCause() instanceof SocketException); }
/** * Determine whether the given RMI exception indicates a connect failure. * <p>Treats RMI's ConnectException, ConnectIOException, UnknownHostException, * NoSuchObjectException and StubNotFoundException as connect failure. * @param ex the RMI exception to check * @return whether the exception should be treated as connect failure * @see java.rmi.ConnectException * @see java.rmi.ConnectIOException * @see java.rmi.UnknownHostException * @see java.rmi.NoSuchObjectException * @see java.rmi.StubNotFoundException */ public static boolean isConnectFailure(RemoteException ex) { return (ex instanceof ConnectException || ex instanceof ConnectIOException || ex instanceof UnknownHostException || ex instanceof NoSuchObjectException || ex instanceof StubNotFoundException || ex.getCause() instanceof SocketException); }
/** * Returns the Throwable which was reconstructed, or null if not possible. */ @Override public Throwable getCause() { return super.getCause(); }
/** * Determine whether the given RMI exception indicates a connect failure. * <p>Treats RMI's ConnectException, ConnectIOException, UnknownHostException, * NoSuchObjectException and StubNotFoundException as connect failure. * @param ex the RMI exception to check * @return whether the exception should be treated as connect failure * @see java.rmi.ConnectException * @see java.rmi.ConnectIOException * @see java.rmi.UnknownHostException * @see java.rmi.NoSuchObjectException * @see java.rmi.StubNotFoundException */ public static boolean isConnectFailure(RemoteException ex) { return (ex instanceof ConnectException || ex instanceof ConnectIOException || ex instanceof UnknownHostException || ex instanceof NoSuchObjectException || ex instanceof StubNotFoundException || ex.getCause() instanceof SocketException); }
private OWLServerException processException(RemoteException re) { for (Throwable cause = re.getCause(); cause != null; cause = cause.getCause()) { if (cause instanceof OWLServerException) { return (OWLServerException) cause; } } return new OWLServerException(re); }
/** * Converts the {@link javax.jcr.observation.Event} instances in the given * iterator to an instance of {@link RemoteEventCollection} for them to be dispatched * to the client-side event listener. * * @param events The {@link javax.jcr.observation.Event Events} to be * dispatched. */ public void onEvent(EventIterator events) { try { RemoteEventCollection remoteEvent = factory.getRemoteEvent(listenerId, events); queue.put(remoteEvent); } catch (RemoteException re) { Throwable t = (re.getCause() == null) ? re : re.getCause(); log.error("Problem creating remote event for " + listenerId, t); } }
@Override public void sampleOccurred(SampleEvent e) { try { listener.sampleOccurred(e); } catch (RemoteException err) { if (err.getCause() instanceof java.net.ConnectException){ throw new JMeterError("Could not return sample",err); } log.error("sampleOccurred", err); } }
@Override public RemoteSecurityContext getSecurityContext() throws RemoteException, ImplementationException { try { return new SecurityDelegate(masterToken); } catch (RemoteException e) { if (e.getCause() != null) throw new ImplementationException( "problem initializing security context", e.getCause()); throw e; } catch (IOException e) { throw new ImplementationException( "problem initializing security context", e); } }
@Override public RemoteSecurityContext getSecurityContext() throws RemoteException, ImplementationException { try { return new SecurityDelegate(masterToken); } catch (RemoteException e) { if (e.getCause() != null) throw new ImplementationException( "problem initializing security context", e.getCause()); throw e; } catch (IOException e) { throw new ImplementationException( "problem initializing security context", e); } }
private static void handleRemoteException(RemoteException re) throws LcaException, RegistrationException { Throwable t = re.getCause(); if (t == null) throw new LcaException("network exception occurred"); if (t instanceof LcaException) throw (LcaException) t; if (t instanceof RegistrationException) throw (RegistrationException) t; throw new LcaException("downstream exception occurred.", t); }
listener.processBatch(l); } catch (RemoteException err) { if (err.getCause() instanceof java.net.ConnectException){ throw new JMeterError("Could not return sample",err);
listener.sampleOccurred((SampleEvent) obj); } catch (RemoteException err) { if (err.getCause() instanceof java.net.ConnectException){ throw new JMeterError("Could not return sample",err);
final Throwable cause = e.getCause(); if(!(cause instanceof EOFException)) { LOG.log(Level.WARNING, "Invocation failure", e);
recoveryCoord = remoteCoord.register_resource(subcoord); } catch (RemoteException e) { TraceTm.jotm.warn("Cannot make interposition :" + e.getCause()); return; } finally {
final Throwable cause = e.getCause(); if(!(cause instanceof EOFException)) { LOG.log(Level.WARNING, "Invocation failure", e);
recoveryCoord = remoteCoord.register_resource(subcoord); } catch (RemoteException e) { TraceTm.jotm.warn("Cannot make interposition :" + e.getCause(), e); return; } finally {
final Throwable cause = e.getCause(); if(cause instanceof EOFException) { try {
final Throwable cause = e.getCause(); if(cause instanceof EOFException) { try {
@SuppressWarnings("deprecation") public Object update(Object entry, Transaction txn, long lease, long timeout, int modifiers) throws TransactionException, UnusableEntryException, RemoteException, InterruptedException { if (!UpdateModifiers.isWriteOnly(modifiers) && !UpdateModifiers.isUpdateOrWrite(modifiers)) modifiers = Modifiers.add(modifiers, UpdateModifiers.UPDATE_ONLY); if (!UpdateModifiers.isNoReturnValue(modifiers)) modifiers = Modifiers.add(modifiers, UpdateModifiers.RETURN_PREV_ON_UPDATE); try { LeaseContext<?> result = _actionManager.write(entry, txn, lease, timeout, modifiers); return result == null ? null : result.getObject(); } catch (RemoteException e) { Throwable cause = e.getCause(); if (cause instanceof EntryNotInSpaceException) throw (EntryNotInSpaceException) cause; if (cause instanceof EntryAlreadyInSpaceException) throw (EntryAlreadyInSpaceException) cause; if (cause instanceof EntryVersionConflictException) throw (EntryVersionConflictException) cause; throw e; } catch (InterruptedSpaceException e) { Throwable cause = e.getCause(); if (cause instanceof InterruptedException) throw (InterruptedException) cause; throw e; } }