Package org.apache.axis2.corba.exceptions

Examples of org.apache.axis2.corba.exceptions.CorbaInvocationException


                            break;
                        }
                    }
                }
                if (exceptionType==null) {
                    throw new CorbaInvocationException(exception);
                } else {
                    ExceptionValue exceptionValue = (ExceptionValue) CorbaUtil.extractValue(exceptionType, userException.except);
                    if (exceptionValue!=null)
                        throw exceptionValue.getException();
                }
            } else {
                throw new CorbaInvocationException(exception);
            }
        }

        return returnValue;
    }
View Full Code Here


                obj = orb.string_to_object((new String(buf)).trim());
                fileReader.close();
            } else if (iorString!=null) {
                obj = orb.string_to_object(((String) iorString.getValue()).trim());
            } else {
                throw new CorbaInvocationException("cannot resolve object");
            }

        } catch (NotFound notFound) {
            throw new CorbaInvocationException("cannot resolve object", notFound);
        } catch (CannotProceed cannotProceed) {
            throw new CorbaInvocationException("cannot resolve object", cannotProceed);
        } catch (InvalidName invalidName) {
            throw new CorbaInvocationException("cannot resolve object", invalidName);
        } catch (IOException e) {
            throw new CorbaInvocationException("cannot resolve object", e);
        }
        return obj;
    }
View Full Code Here

    public static IDL getIDL(AxisService service, ORB orb, String dirName) throws CorbaException {
        Parameter idlFile = service.getParameter(IDL_FILE);

        if (idlFile == null) {
            throw new CorbaInvocationException("Please specify the IDL file");   
        }

        String idlFileName = ((String) idlFile.getValue()).trim();
        String cacheKey = dirName + File.separator + idlFileName;
        IDL idl = (IDL) IDL_CACHE.get(cacheKey);
        if (idl==null) {
            try {
                /*File file = new File(dirName);
                InputStream stream;
                if (file.isDirectory()) {
                    stream = new FileInputStream(cacheKey);
                } else {
                    ZipInputStream zin = new ZipInputStream(new FileInputStream(file));

                    ZipEntry entry;
                    boolean found = false;
                    while ((entry = zin.getNextEntry()) != null) {
                        if (entry.getName().equalsIgnoreCase(idlFileName)) {
                            found = true;
                            break;
                        }
                    }

                    if (!found)
                        new CorbaInvocationException("cannot find " + idlFileName + " in " + file.getPath());

                    stream = zin;
                }*/
                InputStream stream = new PreProcessorInputStream(dirName, idlFileName);
                //TODO: Set pre-processor system and user input paths
                IDLProcessor idlProcessor = new IDLProcessor(stream);
                idl = idlProcessor.process();
                stream.close();
                IDL_CACHE.put(cacheKey, idl);
            } catch (IOException e) {
                throw new CorbaInvocationException("cannot process idl file", e);
            }
        }

        Map types = idl.getCompositeDataTypes();
        if (types!=null) {
View Full Code Here

    public static Invoker getInvoker(AxisService service, org.omg.CORBA.Object obj, IDL idl, String methodName) throws CorbaInvocationException {
        InvokerFactory invokerFactory = new CorbaInvokerFactory(idl);
        Parameter interfaceName = service.getParameter(INTERFACE_NAME);
        if (interfaceName==null)
            throw new CorbaInvocationException("interfaceName cannot be null");
        return invokerFactory.newInvoker(((String) interfaceName.getValue()).trim(), methodName, obj);
    }
View Full Code Here

            if (compositeType instanceof ValueType)
                value = new ObjectByValue((ValueType) compositeType);
            else if (compositeType instanceof Struct)
                value = new StructValue((Struct) compositeType);
            else
                throw new CorbaInvocationException("Parameter type not supported");

            value.setMemberValues(compositeValues);
            return value;
        } else if (dataType instanceof AnyType) {
            OMElement anyElement = (OMElement) param;
            DefaultNamespaceGenerator namespaceGenerator = new DefaultNamespaceGenerator();
            String defaultNamespace = namespaceGenerator.schemaNamespaceFromPackageName("").toString();

            OMElement typeElement = anyElement.getFirstChildWithName(new QName(defaultNamespace, "type"));

            if (typeElement != null) {

                OMElement definitionElement = typeElement.getFirstChildWithName(new QName(defaultNamespace, "definition"));
                OMElement typenameElement = typeElement.getFirstChildWithName(new QName(defaultNamespace, "typename"));
                OMElement anyValueElement = anyElement.getFirstChildWithName(new QName(defaultNamespace, "value"));

                if (typenameElement != null && anyValueElement != null) {

                    String typeName = typenameElement.getText();
                    String definition = definitionElement != null ? definitionElement.getText() : Constants.URI_DEFAULT_SCHEMA_XSD;
                    Object anyContent;
                    DataType anyValueType;
                    if (definition.equals(Constants.URI_DEFAULT_SCHEMA_XSD)) {
                        String anyValueString = anyValueElement.getText();
                        if (typeName.equals("boolean")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("boolean");
                            anyContent = Boolean.parseBoolean(anyValueString);
                        } else if (typeName.equals("double")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("double");
                            anyContent = Double.parseDouble(anyValueString);
                        } else if (typeName.equals("float")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("float");
                            anyContent = Float.parseFloat(anyValueString);
                        } else if (typeName.equals("unsignedByte")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("octet");
                            anyContent = Byte.parseByte(anyValueString);
                        } else if (typeName.equals("int")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("long");
                            anyContent = Integer.parseInt(anyValueString);
                        } else if (typeName.equals("long")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("longlong");
                            anyContent = Long.parseLong(anyValueString);
                        } else if (typeName.equals("short")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("short");
                            anyContent = Short.parseShort(anyValueString);
                        } else if (typeName.equals("string")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("string");
                            anyContent = anyValueString;
                        } else if (typeName.equals("unsignedShort")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("ushort");
                            anyContent = Short.parseShort(anyValueString);
                        } else if (typeName.equals("unsignedInt")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("ulong");
                            anyContent = Integer.parseInt(anyValueString);
                        } else if (typeName.equals("unsignedLong")) {
                            anyValueType = PrimitiveDataType.getPrimitiveDataType("ulonglong");
                            anyContent = Long.parseLong(anyValueString);
                        } else {
                            throw new CorbaInvocationException("Unsupported data type: " + typeName);
                        }
                    } else {
                        anyValueType = mapping.getDataType(new QName(definition, typeName));
                        if (anyValueType != null) {
                            anyContent = CorbaUtil.extractValue(anyValueType, anyValueElement.getFirstElement(), mapping);
                        } else {
                            throw new CorbaInvocationException("Unsupported data schema: " + definition + " type:" + typeName);
                        }
                    }
                    AnyValue anyValue = new AnyValue();
                    anyValue.setContent(anyContent);
                    anyValue.setContentType(anyValueType);
View Full Code Here

                    orb = orbParam != null ? (ORB) orbParam.getValue() : CorbaUtil.getORB(service);
                }
                org.omg.CORBA.Object obj = CorbaUtil.resolveObject(service, orb);
                Parameter idlParameter = service.getParameter(IDL_LITERAL);
                if (idlParameter==null)
                    throw new CorbaInvocationException("No IDL found");
                IDL idl = (IDL) idlParameter.getValue();
                invoker = CorbaUtil.getInvoker(service, obj, idl, methodName);
                invokerCache.put(methodName, invoker);
            }
View Full Code Here

            deploymentFileData.setClassLoader(isDirectory, getClass().getClassLoader(),
                    (File) cfgCtx.getAxisConfiguration().getParameterValue(
                            Constants.Configuration.ARTIFACTS_TEMP_DIR),
                    cfgCtx.getAxisConfiguration().isChildFirstClassLoading());

            DeploymentClassLoader urlCl
                = (DeploymentClassLoader)deploymentFileData.getClassLoader();
            Thread.currentThread().setContextClassLoader(urlCl);

            // StartupFactory registration
            for (StartupFactory factory : getProviders(StartupFactory.class, urlCl)) {
View Full Code Here

    private void handleException(String message, Exception e) throws DeploymentException {
        if (log.isDebugEnabled()) {
            log.debug(message, e);
        }
        throw new DeploymentException(message, e);
    }
View Full Code Here

    private void handleException(String message, Throwable t) throws DeploymentException {
        if (log.isDebugEnabled()) {
            log.debug(message, t);
        }
        throw new DeploymentException(message, t);
    }
View Full Code Here

            }
        } else {
            String msg = "Artifact representing the filename "
                    + fileName + " is not deployed on Synapse";
            log.error(msg);
            throw new DeploymentException(msg);
        }

        if (log.isDebugEnabled()) {
            log.debug("UnDeployment of the synapse artifact from file : "
                    + fileName + " : COMPLETED");
View Full Code Here

TOP

Related Classes of org.apache.axis2.corba.exceptions.CorbaInvocationException

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.