Package org.apache.hivemind.service

Examples of org.apache.hivemind.service.ClassFab.addMethod()


        // This will initally be the inner proxy, then switch over to the
        // service implementation.

        classFab.addField("_inner", getConfigurationType());
        classFab.addMethod(
                Modifier.PUBLIC | Modifier.SYNCHRONIZED | Modifier.FINAL,
                new MethodSignature(void.class, "_setInner", new Class[]
                { getConfigurationType() }, null),
                "{ _inner = $1; }");
View Full Code Here


        builder.begin();

        builder.addln("return _inner;");
        builder.end();

        classFab.addMethod(Modifier.PRIVATE, new MethodSignature(getConfigurationType(), "_getInner",
                null, null), builder.toString());

        proxyBuilder.addServiceMethods("_getInner()", false);

        // The toString calls the toString method of the configuration if it is
View Full Code Here

        builder.end();

        MethodSignature toStringSignature = new MethodSignature(String.class, "toString", null,
                null);
        if (!classFab.containsMethod(toStringSignature)) {
            classFab.addMethod(Modifier.PUBLIC, toStringSignature, builder.toString());
        }

        return classFab.createClass();
    }
View Full Code Here

        body.add("return _configuration;");

        body.end();

        classFab.addMethod(
                Modifier.PRIVATE | Modifier.FINAL | Modifier.SYNCHRONIZED,
                new MethodSignature(getConfigurationType(), "_configuration", null, null),
                body.toString());

        builder.addServiceMethods("_configuration()");
View Full Code Here

        body.add("_configuration();");

        body.end();

        classFab.addMethod(Modifier.PUBLIC | Modifier.FINAL, new MethodSignature(void.class,
                "_instantiateServiceImplementation", null, null), body.toString());

        classFab.addInterface(SingletonInnerProxy.class);

        return classFab.createClass();
View Full Code Here

        builder.begin();
        builder.addln("for (int i = 0; i < _commands.length; i++)");
        builder.addln("_commands[i].run($$);");
        builder.end();

        cf.addMethod(Modifier.PUBLIC, sig, builder.toString());
        cfc.setReturnValue(newMethodFab());

        replayControls();

        ChainBuilderImpl cb = new ChainBuilderImpl();
View Full Code Here

        builder.addln("if (result != false) break;");
        builder.end();
        builder.addln("return result;");
        builder.end();

        cf.addMethod(Modifier.PUBLIC, sig, builder.toString());
        cfc.setReturnValue(newMethodFab());

        replayControls();

        ChainBuilderImpl cb = new ChainBuilderImpl();
View Full Code Here

        cf.addConstructor(new Class[]
        { StrategyRegistry.class }, null, "_registry = $1;");
        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());");
View Full Code Here

                        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

        cf.addConstructor(new Class[]
        { 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);
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.