Package org.apache.hivemind.service

Examples of org.apache.hivemind.service.MethodSignature


    public void testAddVoidMethod()
    {
        MockControl cfc = newControl(ClassFab.class);
        ClassFab cf = (ClassFab) cfc.getMock();

        MethodSignature sig = new MethodSignature(void.class, "run", null, null);

        BodyBuilder builder = new BodyBuilder();
        builder.begin();
        builder.addln("for (int i = 0; i < _commands.length; i++)");
        builder.addln("_commands[i].run($$);");
View Full Code Here


    public void testAddNonVoidMethod()
    {
        MockControl cfc = newControl(ClassFab.class);
        ClassFab cf = (ClassFab) cfc.getMock();

        MethodSignature sig = new MethodSignature(boolean.class, "execute", new Class[]
        { String.class }, null);

        BodyBuilder builder = new BodyBuilder();
        builder.begin();
        builder.addln("boolean result = false;");
View Full Code Here

        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

        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

        cfc.setMatcher(new AggregateArgumentsMatcher(new ArrayMatcher()));

        cf
                .addMethod(
                        Modifier.PRIVATE,
                        new MethodSignature(ToStringStrategy.class, "_getStrategy", new Class[]
                        { Object.class }, null),
                        "return (org.apache.hivemind.lib.strategy.ToStringStrategy) _registry.getStrategy($1.getClass());");
        cfc.setReturnValue(mf);

        cf.addMethod(Modifier.PUBLIC, new MethodSignature(String.class, "toString", new Class[]
        { Object.class }, null), "return ($r) _getStrategy($1).toString($$);");
        cfc.setReturnValue(mf);

        fp.getServiceId();
        fpc.setReturnValue("foo.Bar");
View Full Code Here

        { StrategyRegistry.class }, null, "_registry = $1;");
        cfc.setMatcher(new AggregateArgumentsMatcher(new ArrayMatcher()));

        cf.addMethod(
                Modifier.PRIVATE,
                new MethodSignature(Runnable.class, "_getStrategy", new Class[]
                { Object.class }, null),
                "return (java.lang.Runnable) _registry.getStrategy($1.getClass());");
        cfc.setReturnValue(mf);

        MethodSignature sig = new MethodSignature(void.class, "run", null, null);

        cf.addMethod(Modifier.PUBLIC, sig, "{  }");
        cfc.setReturnValue(mf);

        fp.getErrorLog();
View Full Code Here

        cfc.setMatcher(new AggregateArgumentsMatcher(new ArrayMatcher()));

        cf
                .addMethod(
                        Modifier.PRIVATE,
                        new MethodSignature(ToStringStrategy.class, "_getStrategy", new Class[]
                        { Object.class }, null),
                        "return (org.apache.hivemind.lib.strategy.ToStringStrategy) _registry.getStrategy($1.getClass());");
        cfc.setReturnValue(mf);

        cf.addMethod(Modifier.PUBLIC, new MethodSignature(String.class, "toString", new Class[]
        { Object.class }, null), "return ($r) _getStrategy($1).toString($$);");
        cfc.setReturnValue(mf);

        fp.getServiceId();
        fpc.setReturnValue("foo.Bar");
View Full Code Here

        { StrategyRegistry.class }, null, "_registry = $1;");
        cfc.setMatcher(new AggregateArgumentsMatcher(new ArrayMatcher()));

        cf.addMethod(
                Modifier.PRIVATE,
                new MethodSignature(Runnable.class, "_getStrategy", new Class[]
                { Object.class }, null),
                "return (java.lang.Runnable) _registry.getStrategy($1.getClass());");
        cfc.setReturnValue(mf);

        MethodSignature sig = new MethodSignature(void.class, "run", null, null);

        cf.addMethod(Modifier.PUBLIC, sig, "{  }");
        cfc.setReturnValue(mf);

        fp.getErrorLog();
View Full Code Here

    public void testAddVoidMethod()
    {
        MockControl cfc = newControl(ClassFab.class);
        ClassFab cf = (ClassFab) cfc.getMock();

        MethodSignature sig = new MethodSignature(void.class, "run", null, null);

        BodyBuilder builder = new BodyBuilder();
        builder.begin();
        builder.addln("for (int i = 0; i < _commands.length; i++)");
        builder.addln("_commands[i].run($$);");
View Full Code Here

    public void testAddNonVoidMethod()
    {
        MockControl cfc = newControl(ClassFab.class);
        ClassFab cf = (ClassFab) cfc.getMock();

        MethodSignature sig = new MethodSignature(boolean.class, "execute", new Class[]
        { String.class }, null);

        BodyBuilder builder = new BodyBuilder();
        builder.begin();
        builder.addln("boolean result = false;");
View Full Code Here

TOP

Related Classes of org.apache.hivemind.service.MethodSignature

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.