Examples of MethodSignature


Examples of org.apache.hivemind.service.MethodSignature

    public void testDupeMethodAdd() throws Exception
    {
        ClassFab cf = newClassFab("DupeMethodAdd", Object.class);

        cf.addMethod(Modifier.PUBLIC, new MethodSignature(void.class, "foo", null, null), "{}");

        try
        {
            cf.addMethod(Modifier.PUBLIC, new MethodSignature(void.class, "foo", null, null), "{}");
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals(
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

        cf.addInterface(FailService.class);

        MethodFab mf =
            cf.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(void.class, "fail", null, null),
                "throw new java.lang.RuntimeException(\"Ouch!\");");

        mf.addCatch(RuntimeException.class, "throw new java.io.IOException($e.getMessage());");

        Class targetClass = cf.createClass();
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

        cf.addInterface(Runnable.class);

        MethodFab mf =
            cf.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(void.class, "run", null, null),
                "return;");

        try
        {
            mf.addCatch(RuntimeException.class, "woops!");
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

        MethodIterator mi = new MethodIterator(stack.getServiceInterface());

        while (mi.hasNext())
        {
            MethodSignature sig = mi.next();

            if (includeMethod(matcher, sig))
                methods.add(sig);
        }
        return methods;
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
        {
            try
            {
                // Filter the method
                MethodSignature signature = new MethodSignature(method);
                if (_interceptedMethods.contains(signature))
                {
                    // clock the execution time
                    long startTime = System.currentTimeMillis();
                    Object result = method.invoke(_inner, args);
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

        MethodMatcher matcher = buildMethodMatcher(parameters);

        for (int i = 0; i < methods.length; i++)
        {
            Method m = methods[i];
            MethodSignature sig = new MethodSignature(m);

            if (includeMethod(matcher, sig))
                addServiceMethodImplementation(fab, sig);
            else
                addPassThruMethodImplementation(fab, sig);
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

        MethodIterator mi = new MethodIterator(stack.getServiceInterface());

        while (mi.hasNext())
        {
            MethodSignature sig = mi.next();

            if (includeMethod(matcher, sig))
                addServiceMethodImplementation(fab, sig);
            else
                addPassThruMethodImplementation(fab, sig);
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

    {
        ClassFab cf = newClassFab("TargetBean", Object.class);

        cf.addField("_stringValue", String.class);

        MethodSignature setStringValue = new MethodSignature(void.class, "setStringValue",
                new Class[]
                { String.class }, null);

        cf.addMethod(Modifier.PUBLIC, setStringValue, "_stringValue = $1;");

        MethodSignature getStringValue = new MethodSignature(String.class, "getStringValue", null,
                null);

        cf.addMethod(Modifier.PUBLIC, getStringValue, "return _stringValue;");

        Class targetClass = cf.createClass();
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

        cf.addField("_stringValue", String.class);
        cf.addConstructor(new Class[]
        { String.class }, null, "{ _stringValue = $1; }");

        MethodSignature getStringValue = new MethodSignature(String.class, "getStringValue", null,
                null);

        cf.addMethod(Modifier.PUBLIC, getStringValue, "return _stringValue;");

        Class targetClass = cf.createClass();
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

        cf.addConstructor(new Class[]
        { int.class }, null, "{ _intValue = $1; }");

        cf.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(int.class, "getIntValue", null, null),
                "return _intValue;");

        Class targetClass = cf.createClass();
        Constructor c = targetClass.getConstructors()[0];
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.