~ubuntu-branches/ubuntu/maverick/eucalyptus/maverick

« back to all changes in this revision

Viewing changes to clc/modules/wsstack/src/main/java/com/eucalyptus/ws/client/RemoteDispatcher.java

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2010-07-21 17:27:10 UTC
  • mfrom: (1.1.38 upstream)
  • Revision ID: james.westby@ubuntu.com-20100721172710-7xv07dmdqgivc3t9
Tags: 2.0~bzr1211-0ubuntu1
* New major upstream version merge, 2.0 (r1211).
* debian/patches/:
  - 01-wsdl-stubs.patch, debian/wsdl.md5sums: wsdl stubs updated.
  - 02-Makefile.patch: Updated to reflect new code layout.
  - 07-local_support_euca_conf-in.patch: Updated to reflect new code layout.
  - 08-ubuntu-default-networking.patch: Refreshed.
  - 09-small-128-192MB.patch: Updated to point to new location.
  - 10-disable-iscsi.patch: Refreshed.
  - 11-state-cleanup-memleakfix.patch: Removed, fixed upstream.
  - 15-fix-default-ramdisk.patch: Updated to point to new location.
  - 16-kvm_libvirt_xml_default_use_kvm.patch: Updated to reflect changes.
  - 17-fix_walrus_OOM_errors.patch: Removed, fixed upstream.
  - 18-priv_security.patch: Updated to reflect upstream changes.
  - 20-brute-force-webui.patch: Updated to reflect upstream changes. 
  - 21-eucalyptus-1.7-with-gwt-1.6.4.patch: New patch, allows 
    eucalyptus-1.7 to be built against gwt 1.6.4. Based on patch courtesy 
    of Dmitrii Zagorodnov, upstream. (LP: #597330)
* debian/eucalyptus-java-common.links: 
  - Changed symlink for groovy, point to groovy.all.jar, making compatiable 
    with groovy versions >1.7. (LP: #595421)
  - Added ant.jar & jetty-rewrite-handler.jar as they are now required.
* debian/control
  - & debian/build-jars: Added libjavassist-java and libjetty-extra-java as 
    build dependencies.
  - Added libjetty-extra-java as a dependency of eucalyptus-java-common
* The binary resulting jar's have been renamed from eucalyptus-*-1.6.2.jar
  to eucalyptus-*-main.jar:    
  - debian/eucalyptus-cc.upstart
  - debian/eucalyptus-cloud.install
  - debian/eucalyptus-common.eucalyptus.upstart
  - debian/eucalyptus-java-common.install
  - debian/eucalyptus-network.upstart
  - debian/eucalyptus-sc.install
  - debian/eucalyptus-walrus.install
* debian/eucalyptus-java-common.install: New upstream jars that have been
  installed:
  - eucalyptus-db-hsqldb-ext-main.jar
  - eucalyptus-component-main.jar
* debian/control:
  - Updated Standards Version to 3.8.4 (no change)
  - Updated the upstream Homepage to: http://open.eucalyptus.com/
  - Changed Vcs-Bzr to reflect new location of Ubuntu hosted development branch.
  - Made the Build Dependency of groovy and the binary eucalyptus-java-common
    package depend on version >=1.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
package com.eucalyptus.ws.client;
65
65
 
66
66
import java.net.URI;
67
 
import java.security.GeneralSecurityException;
68
 
import java.util.List;
69
 
import java.util.concurrent.ConcurrentHashMap;
70
 
import java.util.concurrent.ConcurrentMap;
71
 
 
72
67
import org.apache.log4j.Logger;
73
68
import org.mule.RequestContext;
74
69
import org.mule.api.MuleEvent;
75
 
import org.mule.api.MuleMessage;
76
 
import org.mule.api.registry.Registry;
77
 
import org.mule.module.client.MuleClient;
78
 
 
79
70
import com.eucalyptus.bootstrap.Component;
80
 
import com.eucalyptus.bootstrap.ServiceBootstrapper;
81
71
import com.eucalyptus.util.EucalyptusCloudException;
82
 
import com.eucalyptus.util.NetworkUtil;
83
 
import com.eucalyptus.ws.client.pipeline.InternalClientPipeline;
84
 
import com.eucalyptus.ws.handlers.NioResponseHandler;
85
 
 
86
 
import edu.ucsb.eucalyptus.msgs.EucalyptusMessage;
 
72
import com.eucalyptus.ws.EucalyptusRemoteFault;
 
73
import edu.ucsb.eucalyptus.msgs.BaseMessage;
87
74
 
88
75
public class RemoteDispatcher extends ServiceDispatcher {
89
76
  private static Logger LOG = Logger.getLogger( RemoteDispatcher.class );
93
80
  }
94
81
 
95
82
  
96
 
  public void dispatch( EucalyptusMessage msg ) {
 
83
  public void dispatch( BaseMessage msg ) {
97
84
    MuleEvent context = RequestContext.getEvent( );
98
85
    try {
99
86
      this.getNioClient( ).dispatch( msg );
104
91
    }
105
92
  }
106
93
 
107
 
  public EucalyptusMessage send( EucalyptusMessage msg ) throws EucalyptusCloudException {
 
94
  public BaseMessage send( BaseMessage msg ) throws EucalyptusCloudException {
108
95
    MuleEvent context = RequestContext.getEvent( );
109
96
    try {
110
97
      return this.getNioClient( ).send( msg );
111
98
    } catch ( Exception e ) {
112
99
      LOG.error( e, e );
113
 
      throw new EucalyptusCloudException( e );
 
100
      Throwable rootCause = e;
 
101
      while( rootCause.getCause( ) != null || !( rootCause instanceof EucalyptusRemoteFault ) ) {
 
102
        rootCause = rootCause.getCause( );
 
103
      }
 
104
      if( rootCause instanceof EucalyptusRemoteFault ) {
 
105
        EucalyptusRemoteFault remoteFault = ( EucalyptusRemoteFault ) rootCause;
 
106
        throw new EucalyptusCloudException( " " + remoteFault.getFaultString( ) );
 
107
      } else {
 
108
        throw new EucalyptusCloudException( msg.getClass().getSimpleName( ) + ": " + rootCause.getMessage( ), rootCause );
 
109
      }
114
110
    } finally {
115
111
      RequestContext.setEvent( context );
116
112
    }