Examples of MethodSignature


Examples of org.apache.hivemind.service.MethodSignature

            builder.add(methodName);
            builder.addln("($$);");

            builder.end();

            classFab.addMethod(Modifier.PUBLIC, new MethodSignature(m), builder.toString());

        }

        Class interceptorClass = classFab.createClass();
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

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

        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.addField("_intValue", int.class);
        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

Examples of org.apache.hivemind.service.MethodSignature

        cf.addInterface(SimpleService.class);

        cf.addMethod(
            Modifier.PUBLIC,
            new MethodSignature(int.class, "add", new Class[] { int.class, int.class }, null),
            "return $1 + $2;");

        Class targetClass = cf.createClass();

        SimpleService s = (SimpleService) targetClass.newInstance();
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

        try
        {
            cf.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(void.class, "run", null, null),
                "fail;");
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Unable to add method void run() to class BadMethodBody:");
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

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

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

        assertSame(mf, cf.getMethodFab(s));

        assertNull(cf.getMethodFab(new MethodSignature(void.class, "skip", null, null)));
    }
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

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

        MethodFab mf =
            cf.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(int.class, "getValue", null, null),
                "return 1;");

        mf.extend("return 2 * $_;", false);

        Object bean = cf.createClass().newInstance();
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

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

        MethodFab mf =
            cf.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(int.class, "getValue", null, null),
                "return 2;");

        mf.extend("$_ = 3 * $_;", false);

        Object bean = cf.createClass().newInstance();
View Full Code Here

Examples of org.apache.hivemind.service.MethodSignature

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

        MethodFab mf =
            cf.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(int.class, "getValue", null, null),
                "return 1;");

        try
        {
            mf.extend("$_ =", true);
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.