Package org.apache.hivemind

Examples of org.apache.hivemind.ApplicationRuntimeException


            return c.newInstance(new Object[] { nameLookup, _coordinator });
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ex);
        }
    }
View Full Code Here


            catch (NamingException ex)
            {
                if (i++ == 0)
                    _coordinator.fireRemoteExceptionDidOccur(this, ex);
                else
                    throw new ApplicationRuntimeException(
                        ImplMessages.unableToLookup(name, context),
                        ex);
                continue;
            }

            if (raw == null)
                throw new ApplicationRuntimeException(ImplMessages.noObject(name, expected));

            if (!expected.isAssignableFrom(raw.getClass()))
                throw new ApplicationRuntimeException(ImplMessages.wrongType(name, raw, expected));

            return raw;
        }
    }
View Full Code Here

        {
            return defaultClass.newInstance();
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(
                ImplMessages.unableToCreateDefaultImplementation(interfaceType, ex),
                ex);
        }
    }
View Full Code Here

    }

    private Class createClass(Class interfaceType, Module module)
    {
        if (!interfaceType.isInterface())
            throw new ApplicationRuntimeException(ImplMessages.notAnInterface(interfaceType));

        String name = ClassFabUtils.generateClassName("DefaultImpl");

        ClassFab cf = _classFactory.newClass(name, Object.class, module);
View Full Code Here

        {
            return _constructor.newInstance(new Object[] { nextBridge, filter });
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ex);
        }
    }
View Full Code Here

            interceptor = c.newInstance(new Object[] { log, stack.peek()});
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ex);
        }

        stack.push(interceptor);
    }
View Full Code Here

    {
        Executable f = new Executable()
        {
            public void execute() throws Exception
            {
                throw new ApplicationRuntimeException("Failure!");
            }
        };

        Task t = new Task();

        t.setExecutable(f);
        t.setId("failure");
        t.setTitle("Failure");

        List tasks = Collections.singletonList(t);

        MockControl logControl = newControl(Log.class);
        Log log = (Log) logControl.getMock();

        MockControl errorLogControl = newControl(ErrorLog.class);
        ErrorLog errorLog = (ErrorLog) errorLogControl.getMock();

        log.info("Executing task Failure.");

        errorLog.error(
                "Exception while executing task Failure: Failure!",
                null,
                new ApplicationRuntimeException(""));
        errorLogControl.setMatcher(new AggregateArgumentsMatcher(new ArgumentMatcher[]
        { null, null, new TypeMatcher() }));

        log.info("Executed one task with one failure \\(in \\d+ milliseconds\\)\\.");
        logControl.setMatcher(new AggregateArgumentsMatcher(new RegexpMatcher()));
View Full Code Here

        {
            return factory.newDocumentBuilder();
        }
        catch (ParserConfigurationException e)
        {
            throw new ApplicationRuntimeException(e);
        }
    }
View Full Code Here

    }

    private static synchronized ClassAdaptor getAdaptor(Object target)
    {
        if (target == null)
            throw new ApplicationRuntimeException(UtilMessages.nullObject());

        Class targetClass = target.getClass();

        ClassAdaptor result = (ClassAdaptor) _classAdaptors.get(targetClass);
View Full Code Here

            return new ClassAdaptor(info.getPropertyDescriptors());
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(
                UtilMessages.unableToIntrospect(targetClass, ex),
                target,
                null,
                ex);
        }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.ApplicationRuntimeException

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.