Examples of failure()


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

                    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

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

                    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

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

                    // 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

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

                } 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

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

                } 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

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

                } 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

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

                } 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
                // and prevent
                // garbage colleciton.
View Full Code Here

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

    public File tempfile(Option... options) {
        try {
            return File.createTempFile("jcores.", ".tmp");
        } catch (IOException e) {
            final Options options$ = Options.$(this.commonCore, options);
            options$.failure(null, e, "tempfile:create", "Unable to create temp file.");
        }

        return new File("/tmp/jcores.failedtmp." + System.nanoTime() + ".tmp");
    }
View Full Code Here

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

        final File ffile = new File(tempfile(options).getAbsoluteFile() + ".dir/");
       
        // Report if we failed
        if (!ffile.mkdirs()) {
            final Options options$ = Options.$(this.commonCore, options);
            options$.failure(null, null, "tempdir:create", "Unable to create temp dir.");
        }
       
        return ffile;
    }
View Full Code Here

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

                while (true) {
                    try {
                        f0.f();
                        sleep(delay, options);
                    } catch (Exception e) {
                        options$.failure(f0, e, "manytimes:run", "Exception while executing f().");
                    }

                    // Check if we should terminate
                    if (killswitch != null && killswitch.terminated()) return;
                }
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.