Package net.jcores.jre.utils.internal

Examples of net.jcores.jre.utils.internal.Options.failure()


                try {
                    queue.add(Async.QEntry(f.f()));
                    queue.close();
                } catch (Exception e) {
                    final Options options$ = Options.$(CommonCore.this, options);
                    options$.failure(f, e, "async:exception", "General exception invoking async function.");
                    queue.close();
                }
            }
        }, 0, options);
View Full Code Here


                        // Otherwise process next element.
                        try {
                            queue.add(Async.QEntry(f.f(t)));
                        } catch (Exception e) {
                            CoreObject.this.commonCore.report(MessageType.EXCEPTION, "Exception when processing " + t + " ... " + e.getMessage());
                            options$.failure(t, e, "for/f", "Unknown exception when processing element");
                        }
                    }
                } finally {
                    // When we're done, close the queue.
                    queue.close();
View Full Code Here

                final ClassLoader classloader = x.getClassLoader();

                // For internal object this usually does not work
                if (classloader == null) {
                    final Options options$ = Options.$(cc, options);
                    options$.failure(x, null, "bytecode:none", "Unable to find bytecode.");
                    return null;
                }

                return Streams.getByteData(classloader.getResourceAsStream(classname));
            }
View Full Code Here

                // Quick pass for most common option
                if (args == null || args.length == 0) {
                    try {
                        toSpawn.newInstance();
                    } catch (InstantiationException e) {
                        options$.failure(x, e, "spawn:instanceexception", "Unable to create a new instance.");
                    } catch (IllegalAccessException e) {
                        options$.failure(x, e, "spawn:illegalaccess", "Unable to access type.");
                    }
                }
View Full Code Here

                    try {
                        toSpawn.newInstance();
                    } catch (InstantiationException e) {
                        options$.failure(x, e, "spawn:instanceexception", "Unable to create a new instance.");
                    } catch (IllegalAccessException e) {
                        options$.failure(x, e, "spawn:illegalaccess", "Unable to access type.");
                    }
                }

                // Get constructor types ...
                Class<?>[] types = new CoreObject<Object>(cc, args).map(new F1<Object, Class<?>>() {
View Full Code Here

                    return constructor.newInstance(args);

                    // NOTE: We do not swallow all execptions silently, becasue spawn() is a bit
                    // special and we cannot return anything that would still be usable.
                } catch (SecurityException e) {
                    options$.failure(x, e, "spawn:security", "Security exception when trying to spawn.");
                } catch (NoSuchMethodException e) {
                    options$.failure(x, e, "spawn:nomethod", "Method not found.");
                } catch (IllegalArgumentException e) {
                    options$.failure(x, e, "spawn:illegalargs", "Illegal passed arguments.");
                } catch (InstantiationException e) {
View Full Code Here

                    // NOTE: We do not swallow all execptions silently, becasue spawn() is a bit
                    // special and we cannot return anything that would still be usable.
                } catch (SecurityException e) {
                    options$.failure(x, e, "spawn:security", "Security exception when trying to spawn.");
                } catch (NoSuchMethodException e) {
                    options$.failure(x, e, "spawn:nomethod", "Method not found.");
                } catch (IllegalArgumentException e) {
                    options$.failure(x, e, "spawn:illegalargs", "Illegal passed arguments.");
                } catch (InstantiationException e) {
                    options$.failure(x, e, "spawn:instanceexception:2", "Cannot instantiate.");
                } catch (IllegalAccessException e) {
View Full Code Here

                } catch (SecurityException e) {
                    options$.failure(x, e, "spawn:security", "Security exception when trying to spawn.");
                } catch (NoSuchMethodException e) {
                    options$.failure(x, e, "spawn:nomethod", "Method not found.");
                } catch (IllegalArgumentException e) {
                    options$.failure(x, e, "spawn:illegalargs", "Illegal passed arguments.");
                } catch (InstantiationException e) {
                    options$.failure(x, e, "spawn:instanceexception:2", "Cannot instantiate.");
                } catch (IllegalAccessException e) {
                    options$.failure(x, e, "spawn:illegalaccess:2", "Unable to access type (2).");
                } catch (InvocationTargetException e) {
View Full Code Here

                } catch (NoSuchMethodException e) {
                    options$.failure(x, e, "spawn:nomethod", "Method not found.");
                } catch (IllegalArgumentException e) {
                    options$.failure(x, e, "spawn:illegalargs", "Illegal passed arguments.");
                } catch (InstantiationException e) {
                    options$.failure(x, e, "spawn:instanceexception:2", "Cannot instantiate.");
                } catch (IllegalAccessException e) {
                    options$.failure(x, e, "spawn:illegalaccess:2", "Unable to access type (2).");
                } catch (InvocationTargetException e) {
                    options$.failure(x, e, "spawn:invocation", "Unable to invoke target.");
                }
View Full Code Here

                } catch (IllegalArgumentException e) {
                    options$.failure(x, e, "spawn:illegalargs", "Illegal passed arguments.");
                } catch (InstantiationException e) {
                    options$.failure(x, e, "spawn:instanceexception:2", "Cannot instantiate.");
                } catch (IllegalAccessException e) {
                    options$.failure(x, e, "spawn:illegalaccess:2", "Unable to access type (2).");
                } catch (InvocationTargetException e) {
                    options$.failure(x, e, "spawn:invocation", "Unable to invoke target.");
                }

                // TODO Make sure to only use weak references, so that we don't run out of memory
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.