Package org.apache.hivemind

Examples of org.apache.hivemind.ApplicationRuntimeException


            }

            return ConstructorUtils.invoke(candidate, parameters);
        }

        throw new ApplicationRuntimeException(ServiceMessages.unableToFindExplicitConstructor(),
                _parameter.getLocation(), null);
    }
View Full Code Here


            }

            return ConstructorUtils.invoke(candidate, parameters);
        }

        throw new ApplicationRuntimeException(ServiceMessages.unableToFindAutowireConstructor(),
                _parameter.getLocation(), null);
    }
View Full Code Here

            injectRegistry(_instance, _registry);
        }
        catch (Exception ex)
        {
            // TODO: more expressive error message
            throw new ApplicationRuntimeException(ex.getMessage(), ex);
        }
    }
View Full Code Here

     * begin outermost element, expect "module".
     */
    private void beginStart(String elementName)
    {
        if (!elementName.equals("module"))
            throw new ApplicationRuntimeException(ParseMessages.notModule(
                    elementName,
                    getLocation()), getLocation(), null);

        ModuleDescriptor md = new ModuleDescriptor(_resolver, _errorHandler);

View Full Code Here

        while (i.hasNext())
        {
            String name = (String) i.next();

            if (!_attributes.containsKey(name))
                throw new ApplicationRuntimeException(ParseMessages.requiredAttribute(
                        name,
                        getElementPath(),
                        getLocation()));
        }
View Full Code Here

            {
                compiled = _compiler.compile(pattern);
            }
            catch (MalformedPatternException ex)
            {
                throw new ApplicationRuntimeException(ex);
            }

            _compiledPatterns.put(pattern, compiled);
        }
View Full Code Here

            return (Rule) ruleClass.newInstance();
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ParseMessages.badRuleClass(
                    ruleClassName,
                    getLocation(),
                    ex), getLocation(), ex);
        }
    }
View Full Code Here

                try
                {
                    interceptor = c.newInstance(new Object[] { interceptorStack.getServiceLog(), interceptorStack.peek() });
                }
                catch (Exception e) {
                    throw new ApplicationRuntimeException(e);
                }
                interceptorStack.push(interceptor);
            }};
        InterceptorDefinition interceptor = new InterceptorDefinitionImpl(helper.getModule(), "hivemind.LoggingInterceptor", getLocation(), constructor);
        sp.addInterceptor(interceptor);
View Full Code Here

        PropertyAdaptor pa = PropertyUtils.getPropertyAdaptor(targetService, propertyName);

        String readMethodName = pa.getReadMethodName();

        if (readMethodName == null)
            throw new ApplicationRuntimeException(
                ImplMessages.servicePropertyNotReadable(propertyName, targetService),
                null,
                p.getLocation(),
                null);

        if (!(serviceInterface.isAssignableFrom(pa.getPropertyType())))
            throw new ApplicationRuntimeException(
                ImplMessages.servicePropertyWrongType(
                    propertyName,
                    targetService,
                    pa.getPropertyType(),
                    serviceInterface),
                p.getLocation(),
                null);

        // Now we're good to go.

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

        ClassFab cf = _classFactory.newClass(name, Object.class, invokingModule);

        addInfrastructure(cf, targetService, serviceInterface, propertyName, readMethodName);

        addMethods(cf, serviceId, serviceInterface, propertyName, targetService);

        Class proxyClass = cf.createClass();

        try
        {
            return ConstructorUtils.invokeConstructor(proxyClass, new Object[] { targetService });
        }
        catch (ApplicationRuntimeException ex)
        {
            throw new ApplicationRuntimeException(ex.getMessage(), p.getLocation(), ex);
        }
    }
View Full Code Here

            stack.push(proxy);
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ManagementMessages
                    .errorInstantiatingPerformanceInterceptor(_serviceId, stack, ex), 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.