Example usage for org.springframework.remoting RemoteProxyFailureException RemoteProxyFailureException

List of usage examples for org.springframework.remoting RemoteProxyFailureException RemoteProxyFailureException

Introduction

In this page you can find the example usage for org.springframework.remoting RemoteProxyFailureException RemoteProxyFailureException.

Prototype

public RemoteProxyFailureException(String msg, Throwable cause) 

Source Link

Document

Constructor for RemoteProxyFailureException.

Usage

From source file:org.logicblaze.lingo.cache.impl.JmsClusteredCacheManagerFactory.java

protected void subscribeToEvents(TransactionalCacheManager answer) {
    JmsServiceExporter exporter = getServiceExporter();
    exporter.setServiceInterface(CommandExecutor.class);
    exporter.setService(answer);//  ww w.  ja v a2 s .  c  o m
    try {
        serviceExporter.afterPropertiesSet();
    } catch (Exception e) {
        throw new RemoteProxyFailureException("Failed to create JmsServiceExporter: " + e.getMessage(), e);
    }
}

From source file:org.logicblaze.lingo.cache.impl.JmsClusteredCacheManagerFactory.java

public JmsProxyFactoryBean getFactoryBean() {
    if (factoryBean == null) {
        factoryBean = createFactoryBean();
        try {/* w w  w  . j  a  va  2  s . c o  m*/
            factoryBean.afterPropertiesSet();
        } catch (JMSException e) {
            throw new RemoteProxyFailureException("Failed to create JmsProxyFactoryBean: " + e.getMessage(), e);
        }
    }
    return factoryBean;
}

From source file:org.phprpc.spring.remoting.PHPRPC_ClientInterceptor.java

public Object invoke(MethodInvocation invocation) throws Throwable {
    if (phprpcProxy == null) {
        throw new IllegalStateException("PHPRPC_ClientInterceptor is not properly initialized - "
                + "invoke 'prepare' before attempting any operations");
    }//from  ww  w  .ja  v a2  s.  c o  m

    try {
        return invocation.getMethod().invoke(phprpcProxy, invocation.getArguments());
    } catch (InvocationTargetException ex) {
        throw ex.getTargetException();
    } catch (Throwable ex) {
        throw new RemoteProxyFailureException(
                "Failed to invoke PHPRPC proxy for remote service [" + getServiceUrl() + "]", ex);
    }
}

From source file:org.xins.common.spring.XinsClientInterceptor.java

public Object invoke(MethodInvocation invocation) throws Throwable {
    if (this.capi == null) {
        throw new IllegalStateException("XinsClientInterceptor is not properly initialized - "
                + "invoke 'prepare' before attempting any operations");
    }//from   w w w  .j  a va  2 s. co  m

    try {
        return invocation.getMethod().invoke(this.capi, invocation.getArguments());
    } catch (InvocationTargetException ex) {
        if (ex.getTargetException() instanceof XINSCallException) {
            XINSCallException callEx = (XINSCallException) ex.getTargetException();
            throw convertXinsAccessException(callEx);
        }
        throw ex.getTargetException();
    } catch (Throwable ex) {
        throw new RemoteProxyFailureException(
                "Failed to invoke XINS API for remote service [" + getServiceUrl() + "]", ex);
    }
}

From source file:org.springframework.remoting.rmi.RmiClientInterceptorUtils.java

/**
 * Perform a raw method invocation on the given RMI stub,
 * letting reflection exceptions through as-is.
 * @param invocation the AOP MethodInvocation
 * @param stub the RMI stub/*ww  w.j  a  va2s.c  o m*/
 * @return the invocation result, if any
 * @throws InvocationTargetException if thrown by reflection
 */
@Nullable
public static Object invokeRemoteMethod(MethodInvocation invocation, Object stub)
        throws InvocationTargetException {

    Method method = invocation.getMethod();
    try {
        if (method.getDeclaringClass().isInstance(stub)) {
            // directly implemented
            return method.invoke(stub, invocation.getArguments());
        } else {
            // not directly implemented
            Method stubMethod = stub.getClass().getMethod(method.getName(), method.getParameterTypes());
            return stubMethod.invoke(stub, invocation.getArguments());
        }
    } catch (InvocationTargetException ex) {
        throw ex;
    } catch (NoSuchMethodException ex) {
        throw new RemoteProxyFailureException("No matching RMI stub method found for: " + method, ex);
    } catch (Throwable ex) {
        throw new RemoteProxyFailureException("Invocation of RMI stub method failed: " + method, ex);
    }
}