org.springframework.remoting.support.RemoteInvocationFactory Java Examples

The following examples show how to use org.springframework.remoting.support.RemoteInvocationFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RmiProtocol.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
protected <T> T doRefer(final Class<T> serviceType, final URL url) throws RpcException {
    final RmiProxyFactoryBean rmiProxyFactoryBean = new RmiProxyFactoryBean();
    // RMI needs extra parameter since it uses customized remote invocation object
    if (url.getParameter(Constants.DUBBO_VERSION_KEY, Version.getProtocolVersion()).equals(Version.getProtocolVersion())) {
        // Check dubbo version on provider, this feature only support
        rmiProxyFactoryBean.setRemoteInvocationFactory(new RemoteInvocationFactory() {
            @Override
            public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) {
                return new RmiRemoteInvocation(methodInvocation);
            }
        });
    }
    rmiProxyFactoryBean.setServiceUrl(url.toIdentityString());
    rmiProxyFactoryBean.setServiceInterface(serviceType);
    rmiProxyFactoryBean.setCacheStub(true);
    rmiProxyFactoryBean.setLookupStubOnStartup(true);
    rmiProxyFactoryBean.setRefreshStubOnConnectFailure(true);
    rmiProxyFactoryBean.afterPropertiesSet();
    return (T) rmiProxyFactoryBean.getObject();
}
 
Example #2
Source File: JndiRmiClientInterceptor.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Return the RemoteInvocationFactory used by this accessor.
 */
public RemoteInvocationFactory getRemoteInvocationFactory() {
	return this.remoteInvocationFactory;
}
 
Example #3
Source File: JndiRmiClientInterceptor.java    From java-technology-stack with MIT License 4 votes vote down vote up
/**
 * Return the RemoteInvocationFactory used by this accessor.
 */
public RemoteInvocationFactory getRemoteInvocationFactory() {
	return this.remoteInvocationFactory;
}
 
Example #4
Source File: JndiRmiClientInterceptor.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return the RemoteInvocationFactory used by this accessor.
 */
public RemoteInvocationFactory getRemoteInvocationFactory() {
	return this.remoteInvocationFactory;
}
 
Example #5
Source File: JndiRmiClientInterceptor.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
/**
 * Return the RemoteInvocationFactory used by this accessor.
 */
public RemoteInvocationFactory getRemoteInvocationFactory() {
	return this.remoteInvocationFactory;
}
 
Example #6
Source File: JndiRmiClientInterceptor.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Set the RemoteInvocationFactory to use for this accessor.
 * Default is a {@link DefaultRemoteInvocationFactory}.
 * <p>A custom invocation factory can add further context information
 * to the invocation, for example user credentials.
 */
public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory) {
	this.remoteInvocationFactory = remoteInvocationFactory;
}
 
Example #7
Source File: JmsInvokerClientInterceptor.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Set the {@link RemoteInvocationFactory} to use for this accessor.
 * <p>Default is a {@link DefaultRemoteInvocationFactory}.
 * <p>A custom invocation factory can add further context information
 * to the invocation, for example user credentials.
 */
public void setRemoteInvocationFactory(@Nullable RemoteInvocationFactory remoteInvocationFactory) {
	this.remoteInvocationFactory =
			(remoteInvocationFactory != null ? remoteInvocationFactory : new DefaultRemoteInvocationFactory());
}
 
Example #8
Source File: JndiRmiClientInterceptor.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Set the RemoteInvocationFactory to use for this accessor.
 * Default is a {@link DefaultRemoteInvocationFactory}.
 * <p>A custom invocation factory can add further context information
 * to the invocation, for example user credentials.
 */
public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory) {
	this.remoteInvocationFactory = remoteInvocationFactory;
}
 
Example #9
Source File: JmsInvokerClientInterceptor.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Set the {@link RemoteInvocationFactory} to use for this accessor.
 * <p>Default is a {@link DefaultRemoteInvocationFactory}.
 * <p>A custom invocation factory can add further context information
 * to the invocation, for example user credentials.
 */
public void setRemoteInvocationFactory(@Nullable RemoteInvocationFactory remoteInvocationFactory) {
	this.remoteInvocationFactory =
			(remoteInvocationFactory != null ? remoteInvocationFactory : new DefaultRemoteInvocationFactory());
}
 
Example #10
Source File: JndiRmiClientInterceptor.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Set the RemoteInvocationFactory to use for this accessor.
 * Default is a {@link DefaultRemoteInvocationFactory}.
 * <p>A custom invocation factory can add further context information
 * to the invocation, for example user credentials.
 */
public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory) {
	this.remoteInvocationFactory = remoteInvocationFactory;
}
 
Example #11
Source File: JndiRmiClientInterceptor.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Set the RemoteInvocationFactory to use for this accessor.
 * Default is a {@link DefaultRemoteInvocationFactory}.
 * <p>A custom invocation factory can add further context information
 * to the invocation, for example user credentials.
 */
public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory) {
	this.remoteInvocationFactory = remoteInvocationFactory;
}
 
Example #12
Source File: JmsInvokerClientInterceptor.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Set the {@link RemoteInvocationFactory} to use for this accessor.
 * <p>Default is a {@link DefaultRemoteInvocationFactory}.
 * <p>A custom invocation factory can add further context information
 * to the invocation, for example user credentials.
 */
public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory) {
	this.remoteInvocationFactory =
			(remoteInvocationFactory != null ? remoteInvocationFactory : new DefaultRemoteInvocationFactory());
}