Package org.springframework.remoting.httpinvoker

Examples of org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor


        // Set up the Spring bean to call into the URL specified for the consumer endpoint
        HttpInvokerProxyFactoryBean pfb = new HttpInvokerProxyFactoryBean();
        pfb.setServiceInterface(Person.class);
        pfb.setServiceUrl("http://localhost:8192/service/");
        pfb.setHttpInvokerRequestExecutor(new SimpleHttpInvokerRequestExecutor());
        pfb.afterPropertiesSet();

        // Grab the object via the proxy factory bean
        Person test = (Person) pfb.getObject();
View Full Code Here


          String action = commit ? TransactionMgr.COMMIT_TXN : TransactionMgr.ROLLBACK_TXN;
          for (Object invokerObject : transactionData.distributedInvokers) {
            if (invokerObject instanceof HttpInvokerClientConfiguration) {
             
              HttpInvokerClientConfiguration invoker = (HttpInvokerClientConfiguration)invokerObject;
              HttpInvokerRequestExecutor nestedHttpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor();
              RemoteInvocation call = new RemoteInvocation(action, new Class<?>[0], new Object[0]);
              call.addAttribute(TXN_ID, transactionData.distributedTransactionID);
              try {
                nestedHttpInvokerRequestExecutor.executeRequest(invoker, call);
              }
              catch (Exception e) {
                _log.error("Completing distributed transaction failed", e);
              }
            }
View Full Code Here

            // to which current invoker points aborting the transaction, in which case we don't neeed
            // to re-tell it to abort the transaction
            if (invokerObject != rootData.currentInvoker) {
              if (invokerObject instanceof HttpInvokerClientConfiguration) {
                HttpInvokerClientConfiguration invoker = (HttpInvokerClientConfiguration)invokerObject;
                HttpInvokerRequestExecutor nestedHttpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor();
                RemoteInvocation call = new RemoteInvocation(ABORT_TXN, new Class<?>[0], new Object[0]);
                  call.addAttribute(TXN_ID, rootData.distributedTransactionID);
                try {
                  nestedHttpInvokerRequestExecutor.executeRequest(invoker, call);
                }
                catch (Exception e) {
                  _log.error("Aborting distributed transaction failed", e);
                }
              }
View Full Code Here

          String action = commit ? TransactionMgr.COMMIT_TXN : TransactionMgr.ROLLBACK_TXN;
          for (Object invokerObject : transactionData.distributedInvokers) {
            if (invokerObject instanceof HttpInvokerClientConfiguration) {
             
              HttpInvokerClientConfiguration invoker = (HttpInvokerClientConfiguration)invokerObject;
              HttpInvokerRequestExecutor nestedHttpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor();
              RemoteInvocation call = new RemoteInvocation(action, new Class<?>[0], new Object[0]);
              call.addAttribute(TXN_ID, transactionData.distributedTransactionID);
              try {
                nestedHttpInvokerRequestExecutor.executeRequest(invoker, call);
              }
              catch (Exception e) {
                _log.error("Completing distributed transaction failed", e);
              }
            }
View Full Code Here

            // to which current invoker points aborting the transaction, in which case we don't neeed
            // to re-tell it to abort the transaction
            if (invokerObject != rootData.currentInvoker) {
              if (invokerObject instanceof HttpInvokerClientConfiguration) {
                HttpInvokerClientConfiguration invoker = (HttpInvokerClientConfiguration)invokerObject;
                HttpInvokerRequestExecutor nestedHttpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor();
                RemoteInvocation call = new RemoteInvocation(ABORT_TXN, new Class<?>[0], new Object[0]);
                  call.addAttribute(TXN_ID, rootData.distributedTransactionID);
                try {
                  nestedHttpInvokerRequestExecutor.executeRequest(invoker, call);
                }
                catch (Exception e) {
                  _log.error("Aborting distributed transaction failed", e);
                }
              }
View Full Code Here

          String action = commit ? TransactionMgr.COMMIT_TXN : TransactionMgr.ROLLBACK_TXN;
          for (Object invokerObject : transactionData.distributedInvokers) {
            if (invokerObject instanceof HttpInvokerClientConfiguration) {
             
              HttpInvokerClientConfiguration invoker = (HttpInvokerClientConfiguration)invokerObject;
              HttpInvokerRequestExecutor nestedHttpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor();
              RemoteInvocation call = new RemoteInvocation(action, new Class<?>[0], new Object[0]);
              call.addAttribute(TXN_ID, transactionData.distributedTransactionID);
              try {
                nestedHttpInvokerRequestExecutor.executeRequest(invoker, call);
              }
              catch (Exception e) {
                _log.error("Completing distributed transaction failed", e);
              }
            }
View Full Code Here

            // to which current invoker points aborting the transaction, in which case we don't neeed
            // to re-tell it to abort the transaction
            if (invokerObject != rootData.currentInvoker) {
              if (invokerObject instanceof HttpInvokerClientConfiguration) {
                HttpInvokerClientConfiguration invoker = (HttpInvokerClientConfiguration)invokerObject;
                HttpInvokerRequestExecutor nestedHttpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor();
                RemoteInvocation call = new RemoteInvocation(ABORT_TXN, new Class<?>[0], new Object[0]);
                  call.addAttribute(TXN_ID, rootData.distributedTransactionID);
                try {
                  nestedHttpInvokerRequestExecutor.executeRequest(invoker, call);
                }
                catch (Exception e) {
                  _log.error("Aborting distributed transaction failed", e);
                }
              }
View Full Code Here

        final HttpInvokerProxyFactoryBean httpProxyFactoryBean = new HttpInvokerProxyFactoryBean();
        httpProxyFactoryBean.setServiceUrl(url.toIdentityString());
        httpProxyFactoryBean.setServiceInterface(serviceType);
        String client = url.getParameter(Constants.CLIENT_KEY);
        if (client == null || client.length() == 0 || "simple".equals(client)) {
          SimpleHttpInvokerRequestExecutor httpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor() {
        protected void prepareConnection(HttpURLConnection con,
            int contentLength) throws IOException {
          super.prepareConnection(con, contentLength);
          con.setReadTimeout(url.getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT));
          con.setConnectTimeout(url.getParameter(Constants.CONNECT_TIMEOUT_KEY, Constants.DEFAULT_CONNECT_TIMEOUT));
        }
          };
          httpProxyFactoryBean.setHttpInvokerRequestExecutor(httpInvokerRequestExecutor);
        } else if ("commons".equals(client)) {
          CommonsHttpInvokerRequestExecutor httpInvokerRequestExecutor = new CommonsHttpInvokerRequestExecutor();
          httpInvokerRequestExecutor.setReadTimeout(url.getParameter(Constants.CONNECT_TIMEOUT_KEY, Constants.DEFAULT_CONNECT_TIMEOUT));
          httpProxyFactoryBean.setHttpInvokerRequestExecutor(httpInvokerRequestExecutor);
        } else if (client != null && client.length() > 0) {
          throw new IllegalStateException("Unsupported http protocol client " + client + ", only supported: simple, commons");
        }
        httpProxyFactoryBean.afterPropertiesSet();
View Full Code Here

TOP

Related Classes of org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor

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.