Package org.apache.cxf.binding.corba

Examples of org.apache.cxf.binding.corba.CorbaBindingException


    public CorbaObjectHandler[] getCorbaObjects() {
        //REVISIT, we can make the CorbaTypeListener & CorbaObjectHandler the same object.
        CorbaObjectHandler[] handlers = new CorbaObjectHandler[listeners.length];
        for (int i = 0; i < listeners.length; i++) {
            if (listeners[i] == null) {
                throw new CorbaBindingException("Uninitalized object for parameter "
                                                + params.get(i).getName());
            }
            handlers[i] = listeners[i].getCorbaObject();
        }
        return handlers;
View Full Code Here


        //       is a Fault instance and contains a detail object.
        if (ex.getCause() == null) {
            if ((ex instanceof Fault) && (((Fault)ex).getDetail() != null)) {
                faultEx = (Fault) ex;
            } else {
                throw new CorbaBindingException(ex);
            }
        } else {
            ex = ex.getCause();
        }
      
        if (ex instanceof InvocationTargetException) {
            ex = ex.getCause();
        }

        if (ex instanceof SystemException) {
            setSystemException(message, ex, destination);
            return;
        }
       
        String exClassName = null;
        if (faultEx == null) {
            //REVISIT, we should not have to depend on WebFault annotation
            //Try changing the fault name to the proper mangled java exception classname.
            WebFault fault = ex.getClass().getAnnotation(WebFault.class);
            if (fault == null) {
                throw new CorbaBindingException(ex);
            }
            exClassName = fault.name();
        else {
            //JCGS: exClassName to be set to the exception name
            Element faultElement = (Element) faultEx.getDetail().getFirstChild();
            exClassName = faultElement.getLocalName();
        }

        // Get information about the operation being invoked from the WSDL
        // definition.
        // We need this to marshal data correctly

        BindingInfo bInfo = destination.getBindingInfo();    
       
        String opName = message.getExchange().get(String.class);
               
        Iterator iter = bInfo.getOperations().iterator();

        BindingOperationInfo bopInfo = null;
        OperationType opType = null;          
        while (iter.hasNext()) {
            bopInfo = (BindingOperationInfo)iter.next();
            if (bopInfo.getName().getLocalPart().equals(opName)) {
                opType = bopInfo.getExtensor(OperationType.class);
                break;
            }
        }
        if (opType == null) {
            throw new CorbaBindingException("Unable to find binding operation for " + opName);
        }

        OperationInfo opInfo = bopInfo.getOperationInfo();
       
        if (faultEx != null) {
            MessagePartInfo partInfo = getFaultMessagePartInfo(opInfo, new QName("", exClassName));
            if (partInfo != null) {
                exClassName = partInfo.getTypeQName().getLocalPart();
            }
           
        }

        RaisesType exType = getRaisesType(opType, exClassName, ex);

        try {
            if (exType != null) {
                if (faultEx != null) {
                    setUserExceptionFromFaultDetail(message,
                            faultEx.getDetail(),
                            exType, opInfo, writer,
                            exchange.get(ServiceInfo.class));
                } else {
                    setUserException(message, ex, exType, opInfo, writer,
                                    exchange.get(ServiceInfo.class));
                }
            } else {
                throw new CorbaBindingException(ex);
            }
        } catch (Exception exp) {
            throw new CorbaBindingException(exp);
        }
    }
View Full Code Here

        throws Exception {
        QName exIdlType = exType.getException();
        QName elName = new QName("", exIdlType.getLocalPart());
        MessagePartInfo faultPart = getFaultMessagePartInfo(opInfo, elName);
        if (faultPart == null) {
            throw new CorbaBindingException("Coulnd't find the message fault part : " + elName);
        }

        Method faultMethod = ex.getClass().getMethod("getFaultInfo");
        if (faultMethod == null) {
            return;
View Full Code Here

        Service serviceModel = ServiceModelUtil.getService(message.getExchange());

        DataWriter<XMLStreamWriter> dataWriter =
            serviceModel.getDataBinding().createWriter(XMLStreamWriter.class);
        if (dataWriter == null) {
            throw new CorbaBindingException("Couldn't create data writer for outgoing fault message");
        }
        return dataWriter;
    }
View Full Code Here

                }
                message.setContent(Exception.class, (Exception) e);
            }
        } catch (java.lang.Exception ex) {
            LOG.log(Level.SEVERE, "CORBA unmarshalFault exception", ex);
            throw new CorbaBindingException("CORBA unmarshalFault exception", ex);
        }

    }
View Full Code Here

    protected DataReader<XMLStreamReader> getDataReader(CorbaMessage message) {
        Service serviceModel = ServiceModelUtil.getService(message.getExchange());
        DataReader<XMLStreamReader> dataReader =
            serviceModel.getDataBinding().createReader(XMLStreamReader.class);
        if (dataReader == null) {
            throw new CorbaBindingException("Couldn't create data reader for incoming fault message");
        }
        return dataReader;
    }
View Full Code Here

            }
            List<String> orbArgs = config.getOrbArgs();
            defaultORB = ORB.init(orbArgs.toArray(new String[orbArgs.size()]), props);
            if (defaultORB == null) {
                LOG.severe("Could not create instance of the ORB");
                throw new CorbaBindingException("Could not create instance of the ORB");
            }
        }
        return defaultORB;
    }
View Full Code Here

       
        URI addressURI = null;
        try {
            addressURI = new URI(address);
        } catch (URISyntaxException ex) {
            throw new CorbaBindingException("Unable to create ORB with address " + address);
        }

        String scheme = addressURI.getScheme();
        // A corbaloc address gives us host and port information to use when setting up the
        // endpoint for the ORB.  Other types of references will just create ORBs on the
        // host and port used when no preference has been specified.
        if ("corbaloc".equals(scheme)) {
            String schemeSpecificPart = addressURI.getSchemeSpecificPart();
            int keyIndex = schemeSpecificPart.indexOf('/');
            String corbaAddr = schemeSpecificPart.substring(0, keyIndex);

            int index = corbaAddr.indexOf(':');
            String protocol = "iiop";
            if (index != 0) {
                protocol = corbaAddr.substring(0, index);
            }
            int oldIndex = index;
            index = corbaAddr.indexOf(':', oldIndex + 1);
            String host = corbaAddr.substring(oldIndex + 1, index);
            String port = corbaAddr.substring(index + 1);
           
            props.put("yoko.orb.oa.endpoint", new String(protocol + " --host " + host + " --port " + port));
            // WHAT to do for non-yoko orb?
        } else if ("corbaname".equals(scheme)) {
            String schemeSpecificPart = addressURI.getSchemeSpecificPart();
            if (schemeSpecificPart.startsWith(":")) {
                schemeSpecificPart = schemeSpecificPart.substring(1);
            }
            int idx = schemeSpecificPart.indexOf(':');
           
            props.put("org.omg.CORBA.ORBInitialHost", schemeSpecificPart.substring(0, idx));
            props.put("org.omg.CORBA.ORBInitialPort", schemeSpecificPart.substring(idx + 1));
        } else if ("file".equals(scheme)
            || "relfile".equals(scheme)
            || "IOR".equals(scheme)
            || "ior".equals(scheme)) {
            //use defaults
        } else {
            throw new CorbaBindingException("Unsupported address scheme type " + scheme);
        }
        orb = ORB.init(orbArgs.toArray(new String[orbArgs.size()]), props);
        orbList.put(getORBNameFromAddress(address), orb);

        return orb;
View Full Code Here

      
        URI addressURI = null;
        try {
            addressURI = new URI(address);
        } catch (URISyntaxException ex) {
            throw new CorbaBindingException("Unable to locate ORB with address " + address);
        }
       
        String scheme = addressURI.getScheme();
        if ("corbaloc".equals(scheme) || "corbaname".equals(scheme)) {
            String schemeSpecificPart = addressURI.getSchemeSpecificPart();
            if (schemeSpecificPart.startsWith(":")) {
                schemeSpecificPart = schemeSpecificPart.substring(1);
            }
            int keyIndex = schemeSpecificPart.indexOf('/');
            if (keyIndex != -1) {
                name = schemeSpecificPart.substring(0, keyIndex);       
            } else {
                name = schemeSpecificPart;
            }
            if (addressURI.getRawQuery() != null) {
                name += addressURI.getRawQuery();
            }
        } else if ("IOR".equals(scheme) || "ior".equals(scheme)) {       
            name = addressURI.toString();
        } else if ("file".equals(scheme) || "relfile".equals(scheme)) {
            name = addressURI.getPath();
            if (name == null) {
                name = addressURI.getSchemeSpecificPart();
            }
        } else {
            throw new CorbaBindingException("Unsupported address scheme type " + scheme);
        }

        return name;
    }
View Full Code Here

            orbUseCount.remove(getORBNameFromAddress(address));
            orbList.remove(getORBNameFromAddress(address));
            try {
                orb.destroy();
            } catch (Exception ex) {
                throw new CorbaBindingException(ex);
            }
        } else {
            orbUseCount.put(getORBNameFromAddress(address), count);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.binding.corba.CorbaBindingException

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.