Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.Heartbeat.begin()


            boolean isVoid = sig.getReturnType().equals("void");

            BodyBuilder builder = new BodyBuilder();

            builder.begin();

            if (!isVoid)
                builder.add("return ");

            builder.add("$1.%s(", sig.getMethodName());
View Full Code Here


            // this does nothing. but for primitive types, it will unwrap
            // the wrapper type back to a primitive.

            BodyBuilder builder = new BodyBuilder();

            builder.begin();

            builder.addln("%s result = ($r) ((%s) %s.get());", type, cast, conduitFieldName);

            if (developmentMode)
            {
View Full Code Here

        builder.begin();

        builder.addln("if ($1.isAborted()) return $_;");

        builder.addln("try");
        builder.begin();

        for (TransformMethodSignature method : methods)
            addCodeForMethod(builder, method, transformation, model);

        builder.end(); // try
View Full Code Here

        if (cache)
        {
            builder.clear();

            builder.addln("if (! %s.isInvariant())", accessFieldName);
            builder.begin();
            builder.addln("%s = %s;", fieldName, defaultFieldName);
            builder.addln("%s = false;", cachedFieldName);
            builder.end();

            // Clean up after the component renders.
View Full Code Here

                                 String parameterName,
                                 String fieldType, String resourcesFieldName,
                                 ClassTransformation transformation)
    {
        BodyBuilder builder = new BodyBuilder();
        builder.begin();

        // Before the component is loaded, updating the property sets the default value
        // for the parameter. The value is stored in the field, but will be
        // rolled into default field inside containingPageDidLoad().
View Full Code Here

        // Before the component is loaded, updating the property sets the default value
        // for the parameter. The value is stored in the field, but will be
        // rolled into default field inside containingPageDidLoad().

        builder.addln("if (! %s.isLoaded())", resourcesFieldName);
        builder.begin();
        builder.addln("%s = $1;", fieldName);
        builder.addln("return;");
        builder.end();

        // Always start by updating the parameter; this will implicitly check for
View Full Code Here

    private void addReaderMethod(String fieldName, String cachedFieldName, String accessFieldName, boolean cache,
                                 String parameterName, String fieldType, String resourcesFieldName,
                                 ClassTransformation transformation)
    {
        BodyBuilder builder = new BodyBuilder();
        builder.begin();

        // While the component is still loading, or when the value for the component is cached,
        // or if the value is not bound, then return the current value of the field.

        builder.addln("if (%s || ! %s.isLoaded() || ! %s.isBound()) return %s;", cachedFieldName,
View Full Code Here

        builder.add("if (%s.isInvariant()", accessFieldName);

        if (cache) builder.add(" || %s.isRendering()", resourcesFieldName);

        builder.addln(")");
        builder.begin();
        builder.addln("%s = result;", fieldName);
        builder.addln("%s = true;", cachedFieldName);
        builder.end();

        builder.addln("return result;");
View Full Code Here

        if (methods.isEmpty()) return;

        model.addRenderPhase(methodAnnotation);

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

        // If in a subclass, and in normal order mode, invoke the super class version first.

        if (!(reverse || model.isRootClass()))
        {
View Full Code Here

        Iterator<TransformMethodSignature> i = reverse ? InternalUtils.reverseIterator(methods) : methods
                .iterator();

        builder.addln("try");
        builder.begin();

        while (i.hasNext())
            addMethodCallToBody(builder, i.next(), transformation);

        // In reverse order in a a subclass, invoke the super method last.
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.