Package org.apache.hivemind.service

Examples of org.apache.hivemind.service.BodyBuilder.begin()


            null,
            "{ super(); _targetService = $1; }");

        BodyBuilder b = new BodyBuilder();

        b.begin();
        b.addln(
            "{0} property = _targetService.{1}();",
            serviceInterface.getName(),
            readPropertyMethodName);
View Full Code Here


        cf.addConstructor(new Class[]
        { targetServiceClass }, null, "{ super(); _targetService = $1; }");

        BodyBuilder b = new BodyBuilder();

        b.begin();
        b.addln(
                "{0} property = _targetService.{1}();",
                serviceInterface.getName(),
                readPropertyMethodName);
View Full Code Here

        cf.addField("_commands", array);
        cf.addField("_toString", String.class);

        BodyBuilder builder = new BodyBuilder();

        builder.begin();
        builder.addln("_commands = ({0}[]) $1.toArray(new {0}[0]);", commandInterface.getName());
        builder.addln("_toString = $2;");
        builder.end();

        cf.addConstructor(new Class[]
View Full Code Here

        }

        String defaultValue = defaultForReturnType(returnType);

        BodyBuilder builder = new BodyBuilder();
        builder.begin();

        builder
                .addln(
                        "{0} result = {1};",
                        ClassFabUtils.getJavaClassName(returnType),
View Full Code Here

                        "{0} result = {1};",
                        ClassFabUtils.getJavaClassName(returnType),
                        defaultValue);
        builder.addln("for (int i = 0; i < _commands.length; i++)");

        builder.begin();
        builder.addln("result = _commands[i].{0}($$);", sig.getName());

        builder.addln("if (result != {0}) break;", defaultValue);

        builder.end();
View Full Code Here

    private void addVoidMethod(ClassFab cf, Class commandInterface, MethodSignature sig)
    {
        BodyBuilder builder = new BodyBuilder();

        builder.begin();

        builder.addln("for (int i = 0; i < _commands.length; i++)");
        builder.addln("_commands[i].{0}($$);", sig.getName());

        builder.end();
View Full Code Here

    {
        String homeInterfaceName = homeInterface.getName();

        BodyBuilder builder = new BodyBuilder();

        builder.begin();

        builder.addln("if (_remote != null)");
        builder.addln("  return _remote;");

        builder.add(homeInterfaceName);
View Full Code Here

        builder.add(") _lookup(");
        builder.addQuoted(jndiName);
        builder.addln(");");

        builder.add("try");
        builder.begin();
        builder.add("_remote = home.create();");
        builder.end();
        builder.add("catch (javax.ejb.CreateException ex)");
        builder.begin();
        builder.add("throw new java.rmi.RemoteException(ex.getMessage(), ex);");
View Full Code Here

        builder.add("try");
        builder.begin();
        builder.add("_remote = home.create();");
        builder.end();
        builder.add("catch (javax.ejb.CreateException ex)");
        builder.begin();
        builder.add("throw new java.rmi.RemoteException(ex.getMessage(), ex);");
        builder.end();

        builder.add("return _remote;");
View Full Code Here

        boolean isVoid = sig.getReturnType().equals(Void.TYPE);

        BodyBuilder builder = new BodyBuilder();

        builder.begin();

        builder.addln("boolean first = true;");
        builder.add("while (true)");
        builder.begin();
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.