Package org.springframework.remoting.rmi

Examples of org.springframework.remoting.rmi.RmiProxyFactoryBean


    }

    public <T> Invoker<T> refer(final Class<T> serviceType, final URL url) throws RpcException {
        if (! Remote.class.isAssignableFrom(serviceType)
                && "spring".equals(url.getParameter("codec", "spring"))) {
            final RmiProxyFactoryBean rmiProxyFactoryBean = new RmiProxyFactoryBean();
            rmiProxyFactoryBean.setServiceUrl(url.toIdentityString());
            rmiProxyFactoryBean.setServiceInterface(serviceType);
            rmiProxyFactoryBean.setCacheStub(true);
            rmiProxyFactoryBean.setLookupStubOnStartup(true);
            rmiProxyFactoryBean.setRefreshStubOnConnectFailure(true);
            rmiProxyFactoryBean.afterPropertiesSet();
            final Object remoteObject = rmiProxyFactoryBean.getObject();
            return new Invoker<T>() {
                public Class<T> getInterface() {
                    return serviceType;
                }
                public URL getUrl() {
View Full Code Here


         <property name="serviceUrl" value="rmi://localhost:1299/SpringRMICallbackServerService"/>
         <property name="serviceInterface" value="org.jboss.test.remoting.performance.spring.rmi.SpringRMICallbackServer"/>
      </bean>
*/
     
      RmiProxyFactoryBean factory = new RmiProxyFactoryBean();
      factory.setServiceUrl("rmi://localhost:1299/SpringRMICallbackServerService:" + sessionId);
      factory.setServiceInterface(org.jboss.test.remoting.performance.spring.rmi.SpringRMICallbackServer.class);
      try
      {
         factory.afterPropertiesSet();
      }
      catch (Exception e)
      {
         System.out.println("unable to create callback proxy");
         System.out.println(e);
      }
      springRMICallbackServer = (SpringRMICallbackServer)factory.getObject();     
   }
View Full Code Here

      <property name="serviceUrl" value="rmi://localhost:1299/SpringHttpCallbackServerService"/>
      <property name="serviceInterface" value="org.jboss.test.remoting.performance.spring.http.client.SpringHttpCallbackServer"/>
   </bean>
*/
     
      RmiProxyFactoryBean factory = new RmiProxyFactoryBean();
      factory.setServiceUrl("rmi://localhost:1299/SpringHttpCallbackServerService:" + sessionId);
      factory.setServiceInterface(org.jboss.test.remoting.performance.spring.http.client.SpringHttpCallbackServer.class);
      try
      {
         factory.afterPropertiesSet();
      }
      catch (Exception e)
      {
         System.out.println("unable to create callback proxy");
         System.out.println(e);
      }
      springHttpCallbackServer = (SpringHttpCallbackServer)factory.getObject();
   }
View Full Code Here

        };
    }

    @SuppressWarnings("unchecked")
    protected <T> T doRefer(final Class<T> serviceType, final URL url) throws RpcException {
        final RmiProxyFactoryBean rmiProxyFactoryBean = new RmiProxyFactoryBean();
        rmiProxyFactoryBean.setServiceUrl(url.toIdentityString());
        rmiProxyFactoryBean.setServiceInterface(serviceType);
        rmiProxyFactoryBean.setCacheStub(true);
        rmiProxyFactoryBean.setLookupStubOnStartup(true);
        rmiProxyFactoryBean.setRefreshStubOnConnectFailure(true);
        rmiProxyFactoryBean.afterPropertiesSet();
        return (T) rmiProxyFactoryBean.getObject();
    }
View Full Code Here

        }

        // 构造对应的url
        String serviceUrl = MessageFormat.format(RMI_SERVICE_URL, params.getIp(), String.valueOf(params.getPort()));
        // 自己实现的有连接池的Stub
        RmiProxyFactoryBean proxy = new RmiProxyFactoryBean();
        proxy.setServiceUrl(serviceUrl);
        proxy.setServiceInterface(CommunicationEndpoint.class);
        proxy.afterPropertiesSet();
        return new RmiCommunicationConnection(params, (CommunicationEndpoint) proxy.getObject());// 创建链接
    }
View Full Code Here

    }

    public <T> Invoker<T> refer(final Class<T> serviceType, final URL url) throws RpcException {
        if (! Remote.class.isAssignableFrom(serviceType)
                && "spring".equals(url.getParameter("codec", "spring"))) {
            final RmiProxyFactoryBean rmiProxyFactoryBean = new RmiProxyFactoryBean();
            rmiProxyFactoryBean.setServiceUrl(url.toIdentityString());
            rmiProxyFactoryBean.setServiceInterface(serviceType);
            rmiProxyFactoryBean.setCacheStub(true);
            rmiProxyFactoryBean.setLookupStubOnStartup(true);
            rmiProxyFactoryBean.setRefreshStubOnConnectFailure(true);
            rmiProxyFactoryBean.afterPropertiesSet();
            final Object remoteObject = rmiProxyFactoryBean.getObject();
            return new Invoker<T>() {
                public Class<T> getInterface() {
                    return serviceType;
                }
                public URL getUrl() {
View Full Code Here

        return new SeleniumContext(webDriver(), baseUrl(), webDriverWaitTimeout());
    }

    @Bean
    public GlobalConfigurationManagementService globalConfigurationManagementService() {
        RmiProxyFactoryBean rmiProxyFactoryBean = new RmiProxyFactoryBean();
        rmiProxyFactoryBean.setServiceUrl("rmi://127.0.0.1:1199/GlobalConfigurationManagementService");
        rmiProxyFactoryBean.setServiceInterface(GlobalConfigurationManagementService.class);
        rmiProxyFactoryBean.afterPropertiesSet();
        return (GlobalConfigurationManagementService) rmiProxyFactoryBean.getObject();
    }
View Full Code Here

        return (GlobalConfigurationManagementService) rmiProxyFactoryBean.getObject();
    }

    @Bean
    public DataManipulationService dataManipulationService() {
        RmiProxyFactoryBean rmiProxyFactoryBean = new RmiProxyFactoryBean();
        rmiProxyFactoryBean.setServiceUrl("rmi://127.0.0.1:1199/DataManipulationService");
        rmiProxyFactoryBean.setServiceInterface(DataManipulationService.class);
        rmiProxyFactoryBean.afterPropertiesSet();
        return (DataManipulationService) rmiProxyFactoryBean.getObject();
    }
View Full Code Here

TOP

Related Classes of org.springframework.remoting.rmi.RmiProxyFactoryBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.