Package org.apache.hivemind.service

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


        builder.addServiceMethods("_service()");

        // Build the implementation of interface SingletonInnerProxy

        body.clear();
        body.begin();

        body.add("_service();");

        body.end();
View Full Code Here


            classFab.addMethod(Modifier.PUBLIC | Modifier.FINAL, new MethodSignature(void.class,
                    "registryDidShutdown", null, null), "{ _delegate = null; _shutdown = true; }");
        }
        BodyBuilder builder = new BodyBuilder();

        builder.begin();

        builder.addln("if (_shutdown)");
        builder.addln("  throw org.apache.hivemind.HiveMind#createRegistryShutdownException();");

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

        Class serviceInterface = servicePoint.getServiceInterface();

        classFab.addField(SERVICE_ACCESSOR_METHOD_NAME, serviceInterface);

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

        builder.add("return (");
        builder.add(serviceInterface.getName());
        builder.add(") _serviceModel.");
        builder.add(serviceModelMethodName);
View Full Code Here

     * methods that are not logged.
     */
    private void addPassThruMethodImplementation(ClassFab classFab, MethodSignature sig)
    {
        BodyBuilder builder = new BodyBuilder();
        builder.begin();

        builder.add("return ($r) _delegate.");
        builder.add(sig.getName());
        builder.addln("($$);");

View Full Code Here

        boolean isVoid = (returnType == void.class);

        BodyBuilder builder = new BodyBuilder();

        builder.begin();
        builder.addln("boolean debug = _log.isDebugEnabled();");

        builder.addln("if (debug)");
        builder.add("  org.apache.hivemind.service.impl.LoggingUtils.entry(_log, ");
        builder.addQuoted(methodName);
View Full Code Here

        MethodFab methodFab = classFab.addMethod(Modifier.PUBLIC, sig, builder.toString());

        builder.clear();

        builder.begin();
        builder.add("org.apache.hivemind.service.impl.LoggingUtils.exception(_log, ");
        builder.addQuoted(methodName);
        builder.addln(", $e);");
        builder.addln("throw $e;");
        builder.end();
View Full Code Here

        String functionName = support.getUniqueString("popup_window");

        BodyBuilder builder = new BodyBuilder();

        builder.addln("function {0}()", functionName);
        builder.begin();
        builder.addln(
                "var newWindow = window.open({0}, {1}, {2});",
                TapestryUtils.enquote(url),
                TapestryUtils.enquote(getWindowName()),
                TapestryUtils.enquote(getFeatures()));
View Full Code Here

        boolean isVoid = (returnType == void.class);

        BodyBuilder builder = new BodyBuilder();

        builder.begin();
        builder.addln("boolean debug = _isDebugEnabled();");

        builder.addln("if (debug)");
        builder.add("  _logEntry(");
        builder.addQuoted(methodName);
View Full Code Here

        MethodFab methodFab = classFab.addMethod(Modifier.PUBLIC, sig, builder.toString());

        builder.clear();

        builder.begin();
        builder.add("_logException(");
        builder.addQuoted(methodName);
        builder.addln(", $e);");
        builder.addln("throw $e;");
        builder.end();
View Full Code Here

    }

    private void addPassThruMethodImplementation(ClassFab classFab, MethodSignature sig)
    {
        BodyBuilder builder = new BodyBuilder();
        builder.begin();

        if (sig.getReturnType() != void.class)
            builder.add("return ");

        builder.add("_inner.");
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.