/** * @param exceptionClass * @param message * @return */ public RaiseException newRaiseException(RubyClass exceptionClass, String message) { return RaiseException.from(this, exceptionClass, message); }
/** * @param exceptionClass * @param message * @return */ public RaiseException newRaiseException(RubyClass exceptionClass, String message) { return RaiseException.from(this, exceptionClass, message); }
public static RuntimeException sockerr_with_trace(Ruby runtime, String msg, StackTraceElement[] trace) { String eol = System.getProperty("line.separator"); StringBuilder sb = new StringBuilder(); sb.append(msg); for (int i = 0, il = trace.length; i < il; i++) { sb.append(eol).append(trace[i].toString()); } return RaiseException.from(runtime, runtime.getClass("SocketError"), sb.toString()); }
public synchronized void checkShutdown() { if (queue == null) { throw RaiseException.from(runtime, runtime.getThreadError(), "queue shut down"); } }
public static RuntimeException sockerr_with_trace(Ruby runtime, String msg, StackTraceElement[] trace) { String eol = System.getProperty("line.separator"); StringBuilder sb = new StringBuilder(); sb.append(msg); for (int i = 0, il = trace.length; i < il; i++) { sb.append(eol).append(trace[i].toString()); } return RaiseException.from(runtime, runtime.getClass("SocketError"), sb.toString()); }
public synchronized void checkShutdown() { if (queue == null) { throw RaiseException.from(runtime, runtime.getThreadError(), "queue shut down"); } }
public static RuntimeException sockerr(Ruby runtime, String msg) { return RaiseException.from(runtime, runtime.getClass("SocketError"), msg); }
private static RuntimeException sockerr(Ruby runtime, String msg) { return RaiseException.from(runtime, runtime.getClass("SocketError"), msg); }
protected RaiseException ex() { return RaiseException.from(runtime, getErrorClass(runtime), message); }
public static RuntimeException sockerr(Ruby runtime, String msg) { return RaiseException.from(runtime, runtime.getClass("SocketError"), msg); }
static RaiseException newZlibError(Ruby runtime, String klass, String message) { RubyClass errorClass = runtime.getModule("Zlib").getClass(klass); return RaiseException.from(runtime, errorClass, message); }
static RaiseException newZlibError(Ruby runtime, String klass, String message) { RubyClass errorClass = runtime.getModule("Zlib").getClass(klass); return RaiseException.from(runtime, errorClass, message); }
public synchronized void checkShutdown() { if (isShutdown()) { Ruby runtime = getRuntime(); throw RaiseException.from(runtime, runtime.getThreadError(), "queue shut down"); } }
public synchronized void checkShutdown() { if (isShutdown()) { Ruby runtime = getRuntime(); throw RaiseException.from(runtime, runtime.getThreadError(), "queue shut down"); } }
static MemoryPointer allocate(Ruby runtime, int typeSize, int count, boolean clear) { final int total = typeSize * count; MemoryIO io = Factory.getInstance().allocateDirectMemory(runtime, total > 0 ? total : 1, clear); if (io == null) { throw RaiseException.from(runtime, runtime.getNoMemoryError(), String.format("Failed to allocate %d objects of %d bytes", count, typeSize)); } return new MemoryPointer(runtime, runtime.getFFI().memptrClass, io, total, typeSize); }
private IRubyObject pop(ThreadContext context, boolean should_block) { final BlockingQueue<IRubyObject> queue = getQueueSafe(); if (!should_block && queue.size() == 0) { throw RaiseException.from(context.runtime, context.runtime.getThreadError(), "queue empty"); } try { return context.getThread().executeTask(context, this, takeTask); } catch (InterruptedException ie) { throw context.runtime.newThreadError("interrupted in FiberQueue.pop"); } }
private IRubyObject pop(ThreadContext context, boolean should_block) { final BlockingQueue<IRubyObject> queue = getQueueSafe(); if (!should_block && queue.size() == 0) { throw RaiseException.from(context.runtime, context.runtime.getThreadError(), "queue empty"); } try { return context.getThread().executeTask(context, this, takeTask); } catch (InterruptedException ie) { throw context.runtime.newThreadError("interrupted in FiberQueue.pop"); } }
static MemoryPointer allocate(Ruby runtime, int typeSize, int count, boolean clear) { final int total = typeSize * count; MemoryIO io = Factory.getInstance().allocateDirectMemory(runtime, total > 0 ? total : 1, clear); if (io == null) { throw RaiseException.from(runtime, runtime.getNoMemoryError(), String.format("Failed to allocate %d objects of %d bytes", count, typeSize)); } return new MemoryPointer(runtime, runtime.getFFI().memptrClass, io, total, typeSize); }
@JRubyMethod(name = "unscan") public IRubyObject unscan() { check(); Ruby runtime = getRuntime(); if (!isMatched()) { RubyClass errorClass = runtime.getClass("StringScanner").getClass("Error"); throw RaiseException.from(runtime, errorClass, "unscan failed: previous match had failed"); } pos = lastPos; clearMatched(); return this; }
@JRubyMethod(name = "unscan") public IRubyObject unscan() { check(); Ruby runtime = getRuntime(); if (!isMatched()) { RubyClass errorClass = runtime.getClass("StringScanner").getClass("Error"); throw RaiseException.from(runtime, errorClass, "unscan failed: previous match had failed"); } pos = lastPos; clearMatched(); return this; }