Package org.codehaus.aspectwerkz.exception

Examples of org.codehaus.aspectwerkz.exception.DefinitionException


                        method = methodCurrent;
                        break;
                    }
                }
                if (method == null) {
                    throw new DefinitionException(
                            "Could not find advice method " + name + " in " + aspectClass.getName()
                    );
                }
                createAndAddAdviceDefsToAspectDef(type, bindTo, adviceName, method, methodIndex, aspectDef);
                for (Iterator it1 = adviceElement.elementIterator("bind-to"); it1.hasNext();) {
View Full Code Here


                // load the mixin to determine if it is a pure interface introduction
                Class mixin;
                try {
                    mixin = aspectClass.getClassLoader().loadClass(packageName + klass);
                } catch (ClassNotFoundException e) {
                    throw new DefinitionException(
                            "could not find mixin implementation: "
                            + packageName
                            + klass
                            + " "
                            + e.getMessage()
View Full Code Here

                    specialArgumentType = type.substring(start + 1, end).trim();
                } else if (type.startsWith("after finally")) {
                    adviceType = AdviceType.AFTER_FINALLY;
                }
                if (specialArgumentType != null && specialArgumentType.indexOf(' ') > 0) {
                    throw new DefinitionException(
                            "argument to after (returning/throwing) can only be a type (parameter name binding should be done using args(..))"
                    );
                }
                final String aspectName = aspectDef.getName();
                AdviceDefinition adviceDef = DefinitionParserHelper.createAdviceDefinition(
View Full Code Here

        ArgsIndexVisitor expression = namespace.getExpressionInfo(node.getName()).getArgsIndexMapper();

        if (expression == null) {

            throw new DefinitionException("Could not find pointcut reference " + node.getName() +

                    " in namespace " + m_namespace);

        }
View Full Code Here

        ExpressionInfo expressionInfo = namespace.getExpressionInfo(node.getName());

        if (expressionInfo == null) {

            throw new DefinitionException("Could not find pointcut reference " + node.getName() +

                    " in namespace " + m_namespace);

        }
View Full Code Here

        // do the sub expression visit
        ExpressionContext context = (ExpressionContext) data;
        ExpressionNamespace namespace = ExpressionNamespace.getNamespace(m_namespace);
        ArgsIndexVisitor expression = namespace.getExpressionInfo(node.getName()).getArgsIndexMapper();
        if (expression == null) {
            throw new DefinitionException("Could not find pointcut reference " + node.getName() +
                    " in namespace " + m_namespace);
        }
        Boolean match = new Boolean(expression.match(context));

        // update the context mapping from this last visit
View Full Code Here

            m_advisedCflowClassFilterExpression = new AdvisedCflowClassFilterExpressionVisitor(
                expression,
                namespace,
                root);
        } catch (Throwable e) {
            throw new DefinitionException("expression is not well-formed [" + expression + "]: " + e.getMessage(), e);
        }
    }
View Full Code Here

                expression = getExpressionAsString();
                m_hasCflowPointcut = new CflowPointcutFinderVisitor(expression, m_expression.m_namespace, s_parser.parse(expression)).hasCflowPointcut();
                m_hasCflowPointcutKnown = true;
            } catch (Throwable e) {
                // should not happen since the m_expression had been accepted
                throw new DefinitionException("expression is not well-formed [" + expression + "]: " + e.getMessage(), e);
            }
        }
        return m_hasCflowPointcut;
    }
View Full Code Here

    // ============ Pointcut types =============
    public Object visit(ASTPointcutReference node, Object data) {
        ExpressionNamespace namespace = ExpressionNamespace.getNamespace(m_namespace);
        ExpressionInfo expressionInfo = namespace.getExpressionInfo(node.getName());
        if (expressionInfo == null) {
            throw new DefinitionException("Could not find pointcut reference " + node.getName() +
                    " in namespace " + m_namespace);
        }
        if (expressionInfo.hasCflowPointcut()) {
            return Boolean.TRUE;
        } else {
View Full Code Here

            });
            return (AspectContainer) constructor.newInstance(new Object[] {
                crossCuttingInfo
            });
        } catch (InvocationTargetException e) {
            throw new DefinitionException(e.getTargetException().toString());
        } catch (NoSuchMethodException e) {
            throw new DefinitionException("aspect container does not have a valid constructor ["
                + containerClassName
                + "] (one that takes a CrossCuttingInfo instance as its only parameter): "
                + e.toString());
        } catch (Throwable e) {
            StringBuffer cause = new StringBuffer();
            cause.append("could not create aspect container using the implementation specified [");
            cause.append(containerClassName);
            cause.append("] due to: ");
            cause.append(e.toString());
            e.printStackTrace();
            throw new DefinitionException(cause.toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.exception.DefinitionException

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.