Spring Framework UrlBasedRemoteAccessor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework UrlBasedRemoteAccessor class.

This code example shows how to use the following methods:getServiceUrl, overrideThreadContextClassLoader, resetThreadContextClassLoader
		if (this.burlapProxy == null) {
			throw new IllegalStateException("BurlapClientInterceptor is not properly initialized - " +
					"invoke 'prepare' before attempting any operations"); 
		} 
 
		ClassLoader originalClassLoader = overrideThreadContextClassLoader();
		try { 
			return invocation.getMethod().invoke(this.burlapProxy, invocation.getArguments());
		} 
		catch (InvocationTargetException ex) {
			Throwable targetEx = ex.getTargetException();
			if (targetEx instanceof BurlapRuntimeException) {
				Throwable cause = targetEx.getCause();
				throw convertBurlapAccessException(cause != null ? cause : targetEx);
			} 
			else if (targetEx instanceof UndeclaredThrowableException) {
				UndeclaredThrowableException utex = (UndeclaredThrowableException) targetEx;
				throw convertBurlapAccessException(utex.getUndeclaredThrowable());
			} 
			else { 

7
CodeRank
This code example shows how to use the following methods:getServiceUrl, getBeanClassLoader, getServiceInterface
	 * @return the Hessian proxy 
	 * @throws MalformedURLException if thrown by the proxy factory 
	 * @see com.caucho.hessian.client.HessianProxyFactory#create 
	 */ 
	protected Object createHessianProxy(HessianProxyFactory proxyFactory) throws MalformedURLException {
		Assert.notNull(getServiceInterface(), "'serviceInterface' is required");
		return proxyFactory.create(getServiceInterface(), getServiceUrl(), getBeanClassLoader());
	} 
 
 
	@Override 
	public Object invoke(MethodInvocation invocation) throws Throwable {
		if (this.hessianProxy == null) {
			throw new IllegalStateException("HessianClientInterceptor is not properly initialized - " +
					"invoke 'prepare' before attempting any operations"); 
		} 
 
		ClassLoader originalClassLoader = overrideThreadContextClassLoader();
		try { 
			return invocation.getMethod().invoke(this.hessianProxy, invocation.getArguments());
6
CodeRank
This code example shows how to use the following methods:getServiceInterface, getServiceUrl
    public void destroy() throws Exception {
        ServiceHelper.stopService(producer);
    } 
 
    public Class<?> getServiceInterface() {
        return super.getServiceInterface(); 
    } 
 
    public String getServiceUrl() {
        return super.getServiceUrl(); 
    } 
 
    public Object getObject() throws Exception {
        return serviceProxy;
    } 
 
    public Class<?> getObjectType() {
        return getServiceInterface(); 
    } 
 
6
CodeRank
This code example shows how to use the following methods:afterPropertiesSet, getServiceUrl
    private HproseMode mode = HproseMode.MemberMode;
    private HproseFilter filter = null;
 
    @Override 
    public void afterPropertiesSet() { 
        super.afterPropertiesSet(); 
        try { 
            client = HproseClient.create(getServiceUrl(), mode);
        } 
        catch (Exception ex) {
            exception = ex;
        } 
        if (client instanceof HproseHttpClient) {
            HproseHttpClient httpClient = (HproseHttpClient)client;
            httpClient.setKeepAlive(keepAlive);
            httpClient.setKeepAliveTimeout(keepAliveTimeout);
            httpClient.setTimeout(timeout);
            httpClient.setProxyHost(proxyHost);
            httpClient.setProxyPort(proxyPort);
            httpClient.setProxyUser(proxyUser);
4
CodeRank
This code example shows how to use the following methods:
/** 
 * {@link FactoryBean} for creating a {@link UrlBasedRemoteAccessor} 
 * (aka consumer) for accessing an HTTP based JSON-RPC service. 
 * 
 */ 
public class JsonProxyFactoryBean 
	extends UrlBasedRemoteAccessor 
	implements MethodInterceptor, 
	InitializingBean, 
	FactoryBean<Object>, 
	ApplicationContextAware { 
 
	private boolean				useNamedParams		= false; 
	private Object				proxyObject			= null; 
	private RequestListener		requestListener		= null; 
	private ObjectMapper		objectMapper		= null; 
	private JsonRpcHttpClient	jsonRpcHttpClient	= null; 
	private Map<String, String>	extraHttpHeaders	= new HashMap<String, String>(); 
	private ApplicationContext	applicationContext; 
 
3
CodeRank
See Code Examples for Spring Framework UrlBasedRemoteAccessor Methods: