Package xbird.xquery

Examples of xbird.xquery.XQueryException


            for(int i = 0; i < _decodeUnit; i++) {
                final Item item;
                try {
                    item = _decoder.decodeItem(treeBuilder);
                } catch (IOException e) {
                    throw new XQueryException("failed decoding an Item", e);
                } finally {
                    treeBuilder.reset();
                }
                if(item != null) {
                    decodedItems.add(item);
View Full Code Here


        private static final byte[] retrieveLabel(final BIndexFile labelBFile, final long rowId)
                throws XQueryException {
            try {
                return labelBFile.getValueBytes(rowId);
            } catch (DbException e) {
                throw new XQueryException("failed to lookup RowID value: " + rowId, e);
            }
        }
View Full Code Here

            }
            BIndexFile labelBFile = new BIndexFile(labelFile);
            try {
                labelBFile.open();
            } catch (DbException e) {
                throw new XQueryException("failed to open BFile: " + labelFile.getAbsolutePath(), e);
            }
            return labelBFile;
        }
View Full Code Here

        if(_functionManager == null) {
            this._functionManager = statEnv.getFunctionManager();
        }
        final Function func = _functionManager.lookupFunction(_funcName, _params);
        if(func == null) {
            throw new XQueryException("err:XPST0017", "function not found: " + _funcName);
        }
        if(!(func instanceof UserFunction)) {
            throw new IllegalStateException("function must be UserFunction, but was '"
                    + func.getName() + '\'');
        }
View Full Code Here

        }
        final IDocumentTable doc;
        try {
            doc = ImportDocument.loadDocument(col, docFile);
        } catch (FileNotFoundException fnf) {
            throw new XQueryException("File not found: " + docPath, fnf);
        } catch (DbException e) {
            throw new XQueryException("Database error", e);
        }
        DocumentTableModel dtm = new DocumentTableModel(doc);
        DTMDocument root = dtm.documentNode();
        return root;
    }
View Full Code Here

            } else {
                try {
                    DbCollection rootColl = DbCollection.getRootCollection();
                    catalog = rootColl.listDocuments(dynEnv);
                } catch (DbException e) {
                    throw new XQueryException("failed loading default collection", e);
                }
            }
        } else {
            Item arg = argv.getItem(0);
            String argStr = arg.stringValue();
            final String unescapedArg = XMLUtils.unescapeXML(argStr);
            if(unescapedArg.endsWith(".catalog")) {
                URI baseUri = dynEnv.getStaticContext().getBaseURI();
                if(baseUri == null) { // TODO REVIEWME workaround
                    baseUri = dynEnv.getStaticContext().getSystemBaseURI();
                }
                URI resolved = baseUri.resolve(unescapedArg);
                final URL colurl;
                try {
                    colurl = resolved.toURL();
                } catch (MalformedURLException e) {
                    throw new DynamicError("Invalid uri: " + argStr);
                }
                DocumentManager docmgr = dynEnv.getDocumentManager();
                DTMDocument doc = docmgr.loadDocument(colurl, dynEnv);
                catalog = resolveCatalog(doc, dynEnv);
            } else if(unescapedArg.startsWith("/")) {
                DbCollection coll = DbCollection.getCollection(unescapedArg);
                if(coll == null) {
                    catalog = Collections.emptyMap();
                } else {
                    final String filter = DbCollection.getDocumentFilterExp(unescapedArg);
                    try {
                        catalog = coll.listDocuments(filter, true, dynEnv);
                    } catch (DbException e) {
                        throw new XQueryException("failed loading collection: " + unescapedArg, e);
                    }
                }
            } else {
                throw new XQueryException("Illeagl collection name: " + unescapedArg);
            }
        }
        Profiler profiler = dynEnv.getProfiler();
        final Collection<DTMDocument> docs = catalog.values();
        final NodeSequence<DTMDocument> ret = new NodeSequence<DTMDocument>(dynEnv);
View Full Code Here

                // invokes remote compilation
                final Object result;
                try {
                    result = client.execute(request);
                } catch (RemoteException e) {
                    throw new XQueryException(e.getMessage(), e.getCause());
                } finally {
                    try {
                        client.close();
                    } catch (RemoteException e) {
                        LOG.warn("shutdown failed for `" + endpoint + '\'', e);
View Full Code Here

        final XQEngineClient client = new XQEngineClient(endpoint);
        final Object result;
        try {
            result = client.execute(request);
        } catch (RemoteException e) {
            throw new XQueryException(e.getMessage(), e.getCause());
        } finally {
            try {
                client.close();
            } catch (RemoteException e) {
                LOG.warn("shutdown failed for `" + endpoint + '\'', e);
View Full Code Here

        } else {
            final RemoteSequenceProxy proxy = new RemoteSequenceProxy(result, request);
            try {
                UnicastRemoteObject.exportObject(proxy, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
            } catch (RemoteException e) {
                throw new XQueryException("failed exporting variable: " + shippedVar.getName(), e);
            }
            final RemoteSequence remote = new RemoteSequence(proxy, result.getType());
            shippedVar.setResult(remote);
        }
    }
View Full Code Here

        prepareVariablesToShip(request, argv, dynEnv);
        final Object result;
        try {
            result = client.execute(request);
        } catch (RemoteException e) {
            throw new XQueryException(e.getMessage(), e.getCause());
        } finally {
            try {
                client.close();
            } catch (RemoteException e) {
                LOG.warn("shutdown failed for `" + endpoint + '\'', e);
View Full Code Here

TOP

Related Classes of xbird.xquery.XQueryException

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.