Java 8 RemoteException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 RemoteException class.

This code example shows how to use the following methods:
	protected RemoteInvocation doReadRemoteInvocation(ObjectInputStream ois)
			throws IOException, ClassNotFoundException {
 
		Object obj = ois.readObject();
		if (!(obj instanceof RemoteInvocation)) { 
			throw new RemoteException("Deserialized object needs to be assignable to type [" +
					RemoteInvocation.class.getName() + "]: " + obj);
		} 
		return (RemoteInvocation) obj; 
	} 
 
	/** 
	 * Create an ObjectOutputStream for the given OutputStream. 
	 * <p>The default implementation creates a plain 
	 * {@link java.io.ObjectOutputStream}. 
	 * @param os the OutputStream to write to 
	 * @return the new ObjectOutputStream instance to use 
	 * @throws java.io.IOException if creation of the ObjectOutputStream failed 
	 */ 
	protected ObjectOutputStream createObjectOutputStream(OutputStream os) throws IOException {
7
CodeRank
This code example shows how to use the following methods:getClass, getCause
	 */ 
	public static Exception convertRmiAccessException(
			Method method, RemoteException ex, boolean isConnectFailure, String serviceName) {
 
		if (logger.isDebugEnabled()) {
			logger.debug("Remote service [" + serviceName + "] threw exception", ex);
		} 
		if (ReflectionUtils.declaresException(method, ex.getClass())) {
			return ex;
		} 
		else { 
			if (isConnectFailure) {
				return new RemoteConnectFailureException("Could not connect to remote service [" + serviceName + "]", ex);
			} 
			else { 
				return new RemoteAccessException("Could not access remote service [" + serviceName + "]", ex);
			} 
		} 
	} 
 

8
CodeRank
This code example shows how to use the following methods:getCause
		catch (RemoteConnectFailureException ex) { 
			return handleRemoteConnectFailure(invocation, ex); 
		} 
		catch (RemoteException ex) { 
			if (isConnectFailure(ex)) { 
				return handleRemoteConnectFailure(invocation, ex); 
			} 
			else { 
				throw ex; 
			} 
		} 
	} 
 
	/** 
	 * Determine whether the given RMI exception indicates a connect failure. 
	 * <p>The default implementation delegates to RmiClientInterceptorUtils. 
	 * @param ex the RMI exception to check 
	 * @return whether the exception should be treated as connect failure 
	 * @see org.springframework.remoting.rmi.RmiClientInterceptorUtils#isConnectFailure 
	 */ 

7
CodeRank
This code example shows how to use the following methods:
	protected RemoteInvocationResult doReadRemoteInvocationResult(ObjectInputStream ois)
			throws IOException, ClassNotFoundException {
 
		Object obj = ois.readObject();
		if (!(obj instanceof RemoteInvocationResult)) {
			throw new RemoteException("Deserialized object needs to be assignable to type [" +
					RemoteInvocationResult.class.getName() + "]: " + obj);
		} 
		return (RemoteInvocationResult) obj;
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:
			return returnValue.toString();
		} 
		catch (Exception e) {
			_log.error(e, e);
 
			throw new RemoteException(e.getMessage());
		} 
	} 
 
	private static Log _log = LogFactoryUtil.getLog(ThemeServiceSoap.class);
} 
6
CodeRank
This code example shows how to use the following methods:
				reason, serviceContext);
		} 
		catch (Exception e) {
			_log.error(e, e);
 
			throw new RemoteException(e.getMessage());
		} 
	} 
 
	private static Log _log = LogFactoryUtil.getLog(FlagsEntryServiceSoap.class);
} 
6
CodeRank
This code example shows how to use the following methods:
			PortletPreferencesServiceUtil.deleteArchivedPreferences(portletItemId);
		} 
		catch (Exception e) {
			_log.error(e, e);
 
			throw new RemoteException(e.getMessage());
		} 
	} 
 
	private static Log _log = LogFactoryUtil.getLog(PortletPreferencesServiceSoap.class);
} 
6
CodeRank
This code example shows how to use the following methods:
			return com.liferay.portal.model.ImageSoap.toSoapModel(returnValue);
		} 
		catch (Exception e) {
			_log.error(e, e);
 
			throw new RemoteException(e.getMessage());
		} 
	} 
 
	private static Log _log = LogFactoryUtil.getLog(ImageServiceSoap.class);
} 
6
CodeRank
This code example shows how to use the following methods:
			return com.liferay.portal.model.PluginSettingSoap.toSoapModel(returnValue);
		} 
		catch (Exception e) {
			_log.error(e, e);
 
			throw new RemoteException(e.getMessage());
		} 
	} 
 
	private static Log _log = LogFactoryUtil.getLog(PluginSettingServiceSoap.class);
} 
6
CodeRank
This code example shows how to use the following methods:
			return com.liferay.polls.model.PollsVoteSoap.toSoapModel(returnValue);
		} 
		catch (Exception e) {
			_log.error(e, e);
 
			throw new RemoteException(e.getMessage());
		} 
	} 
 
	private static Log _log = LogFactoryUtil.getLog(PollsVoteServiceSoap.class);
} 
6
CodeRank
See Code Examples for Java 8 RemoteException Methods: