Package net.fortytwo.ripple

Examples of net.fortytwo.ripple.RippleException


            if (!getFinished()) {
                t.interrupt();
            }
        } catch (InterruptedException e) {
            throw new RippleException(e);
        }

        if (!getFinished()) {
            throw new RippleException("operation timed out");
        } else if (null != getError()) {
            throw getError();
        }
    }
View Full Code Here


        synchronized (completedTaskSink) {
            if (count > 0) {
                try {
                    completedTaskSink.wait();
                } catch (java.lang.InterruptedException e) {
                    throw new RippleException("interrupted while waiting to complete tasks");
                }
            }
        }
//System.out.println( "    done." );
    }
View Full Code Here

        synchronized (this) {
            if (!finished) {
                try {
                    wait();
                } catch (InterruptedException e) {
                    throw new RippleException("interrupted while waiting for task to finish");
                }
            }
        }
//System.out.println( "    done -- " + this );
    }
View Full Code Here

                }
            }
        }

        private void logThrowable(final Throwable t) {
            RippleException e;

            if (t instanceof RippleException) {
                e = (RippleException) t;
            } else {
                if (t instanceof InterruptedException) {
                    logger.warning("task interrupted: " + currentTaskItem.task);
                    return;
                }

                e = new RippleException(t);
            }

            try {
                e.logError();
            } catch (Throwable secondary) {
                System.out.println("failed to log error: " + t);
            }
        }
View Full Code Here

        try {
            writeIn = new PipedInputStream();
            readOut = new PipedOutputStream(writeIn);
        } catch (java.io.IOException e) {
            throw new RippleException(e);
        }
    }
View Full Code Here

                while (active) {
                    try {
                        requestByte(false);
                    } catch (java.io.IOException e) {
                        throw new RippleException(e);
                    }
                }
            }

            protected void stopProtected() {
View Full Code Here

                    sc.commit();
                } finally {
                    sc.close();
                }
            } catch (SailException e) {
                throw new RippleException(e);
            }
        }

        return sail;
    }
View Full Code Here

            RippleList l = mc.list();
            for (int i = a.length() - 1; i >= 0; i--) {
                try {
                    l = l.push(toRippleValue(a.get(i), mc));
                } catch (JSONException e) {
                    throw new RippleException(e);
                }
            }
            return l;
        } else if (o instanceof JSONObject) {
            return new JSONValue((JSONObject) o);
        } else if (o instanceof Long) {
            return mc.valueOf((Long) o);
        } else if (o instanceof String) {
            return mc.valueOf((String) o);
        } else {
            throw new RippleException("tried to convert object of unfamiliar type: " + o);
        }
    }
View Full Code Here

        if (x instanceof KeyValueValue) {
            RippleValue result = ((KeyValueValue) x).getValue(key, mc);
            solutions.put(
                    stack.push(result));
        } else {
            throw new RippleException("argument is not a JSON value: " + x);
        }
    }
View Full Code Here

                        logger.fine("received quit event");
                        abortCommands();
                        // Note: exception handling used for control
                        throw new ParserQuitException();
                    default:
                        throw new RippleException(
                                "event not yet supported: " + event);
                }
            }

            protected void handleAssignment(KeywordAST name) throws RippleException {
                Source<RippleList> source = queryResultHistory.get(0);
                if (null == source) {
                    source = new Collector<RippleList>();
                }

                addCommand(new DefineKeywordCmd(name, new ListGenerator(source)));
            }
        };

        Sink<Exception> parserExceptionSink = new ParserExceptionSink(
                qe.getErrorPrintStream());

        // Pass input through a filter to watch for special byte sequences, and
        // another draw input through it even when the interface is busy.
        InputStream filter = new InputStreamEventFilter(is, ra);
        consoleReaderInput = new ThreadedInputStream(filter);

        // Create reader.
        try {
            reader = new ConsoleReader(consoleReaderInput,
                    qe.getPrintStream());
        } catch (Throwable t) {
            throw new RippleException(t);
        }
        jline.Terminal term = reader.getTerminal();
//System.out.println( "reader.getTerminal() = " + term );

        writeIn = new PipedIOStream();
View Full Code Here

TOP

Related Classes of net.fortytwo.ripple.RippleException

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.