Package org.springframework.remoting.rmi

Examples of org.springframework.remoting.rmi.RmiServiceExporter


            this.port = registryPort;

            // Now expose the skeleton to the stub over RMI
              // --------------------------------------------
              // create the exporter
              exporter = new RmiServiceExporter();
              //set the object into the exporter
              exporter.setService(this);
              // set the service name
              exporter.setServiceName(this.objectName);
              // set the service interface
View Full Code Here


            this.port = registryPort;

            // Now expose the skeleton to the stub over RMI
              // --------------------------------------------
              // create the exporter
              exporter = new RmiServiceExporter();
              //set the object into the exporter
              exporter.setService(this);
              // set the service name
              exporter.setServiceName(this.objectName);
              // set the service interface
View Full Code Here

            this.port = registryPort;

            // Now expose the skeleton to the stub over RMI
              // --------------------------------------------
              // create the exporter
              exporter = new RmiServiceExporter();
              //set the object into the exporter
              exporter.setService(this);
              // set the service name
              exporter.setServiceName(this.objectName);
              // set the service interface
View Full Code Here

    }

    public <T> Exporter<T> export(final Invoker<T> invoker) throws RpcException {
        if (! Remote.class.isAssignableFrom(invoker.getInterface())
                && "spring".equals(invoker.getUrl().getParameter("codec", "spring"))) {
            final RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
            rmiServiceExporter.setRegistryPort(invoker.getUrl().getPort());
            rmiServiceExporter.setServiceName(invoker.getUrl().getPath());
            rmiServiceExporter.setServiceInterface(invoker.getInterface());
            rmiServiceExporter.setService(proxyFactory.getProxy(invoker));
            try {
                rmiServiceExporter.afterPropertiesSet();
            } catch (RemoteException e) {
                throw new RpcException(e.getMessage(), e);
            }
            Exporter<T> exporter = new Exporter<T>() {
                public Invoker<T> getInvoker() {
                    return invoker;
                }
                public void unexport() {
                    try {
                        rmiServiceExporter.destroy();
                    } catch (Throwable e) {
                        logger.warn(e.getMessage(), e);
                    }
                    try {
                        invoker.destroy();
View Full Code Here

*/
      for (int i = 0; i < 10; i++)
      {
         try
         {
            RmiServiceExporter exporter = new RmiServiceExporter();
            exporter.setServiceName("SpringRMICallbackServerService:" + clientSessionId);
            exporter.setService(callbackServer);
            exporter.setServiceInterface(org.jboss.test.remoting.performance.spring.rmi.SpringRMICallbackServer.class);
            exporter.setRegistryPort(1299);
            exporter.afterPropertiesSet();
            log.info("exported SpringRMICallbackServerService:" + clientSessionId);
            break;
         }
         catch (Exception e)
         {
View Full Code Here

*/
      for (int i = 0; i < 10; i++)
      {
         try
         {
            RmiServiceExporter exporter = new RmiServiceExporter();
            exporter.setServiceName("SpringRMICallbackServerService:" + clientSessionId);
            exporter.setService(callbackServer);
            exporter.setServiceInterface(org.jboss.test.remoting.performance.spring.rmi.SpringRMICallbackServer.class);
            exporter.setRegistryPort(1299);
            exporter.afterPropertiesSet();
            log.info("exported SpringRMICallbackServerService:" + clientSessionId);
            break;
         }
         catch (Exception e)
         {
View Full Code Here

*/
      for (int i = 0; i < 10; i++)
      {
         try
         {
            RmiServiceExporter exporter = new RmiServiceExporter();
            exporter.setServiceName("SpringHttpCallbackServerService:" + clientSessionId);
            exporter.setService(callbackServer);
            exporter.setServiceInterface(org.jboss.test.remoting.performance.spring.http.client.SpringHttpCallbackServer.class);
            exporter.setRegistryPort(1299);
            exporter.afterPropertiesSet();
            log.info("exported SpringHttpCallbackServerService:" + clientSessionId);
            break;
         }
         catch (Exception e)
         {
View Full Code Here

    public int getDefaultPort() {
        return DEFAULT_PORT;
    }

    protected <T> Runnable doExport(final T impl, Class<T> type, URL url) throws RpcException {
        final RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
        rmiServiceExporter.setRegistryPort(url.getPort());
        rmiServiceExporter.setServiceName(url.getPath());
        rmiServiceExporter.setServiceInterface(type);
        rmiServiceExporter.setService(impl);
        try {
            rmiServiceExporter.afterPropertiesSet();
        } catch (RemoteException e) {
            throw new RpcException(e.getMessage(), e);
        }
        return new Runnable() {
            public void run() {
                try {
                    rmiServiceExporter.destroy();
                } catch (Throwable e) {
                    logger.warn(e.getMessage(), e);
                }
            }
        };
View Full Code Here

        this.port = port;
        initial();
    }

    public void initial() {
        export = new RmiServiceExporter();
        export.setServiceName("endpoint");
        export.setService(this);// 暴露自己
        export.setServiceInterface(CommunicationEndpoint.class);
        export.setRegistryHost(host);
        export.setRegistryPort(port);
View Full Code Here

    }

    public <T> Exporter<T> export(final Invoker<T> invoker) throws RpcException {
        if (! Remote.class.isAssignableFrom(invoker.getInterface())
                && "spring".equals(invoker.getUrl().getParameter("codec", "spring"))) {
            final RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
            rmiServiceExporter.setRegistryPort(invoker.getUrl().getPort());
            rmiServiceExporter.setServiceName(invoker.getUrl().getPath());
            rmiServiceExporter.setServiceInterface(invoker.getInterface());
            rmiServiceExporter.setService(proxyFactory.getProxy(invoker));
            try {
                rmiServiceExporter.afterPropertiesSet();
            } catch (RemoteException e) {
                throw new RpcException(e.getMessage(), e);
            }
            Exporter<T> exporter = new Exporter<T>() {
                public Invoker<T> getInvoker() {
                    return invoker;
                }
                public void unexport() {
                    try {
                        rmiServiceExporter.destroy();
                    } catch (Throwable e) {
                        logger.warn(e.getMessage(), e);
                    }
                    try {
                        invoker.destroy();
View Full Code Here

TOP

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

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.