All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.graphql.testServer Maven / Gradle / Ivy

There is a newer version: 2.1.38
Show newest version
package templates.graphql;

import java.io.IOException;
import com.fizzed.rocker.ForIterator;
import com.fizzed.rocker.RenderingException;
import com.fizzed.rocker.RockerContent;
import com.fizzed.rocker.RockerOutput;
import com.fizzed.rocker.runtime.DefaultRockerTemplate;
import com.fizzed.rocker.runtime.PlainTextUnloadedClassLoader;

/*
 * Auto generated code to render template templates/graphql/testServer.rocker.raw
 * Do not edit this file. Changes will eventually be overwritten by Rocker parser!
 */
@SuppressWarnings("unused")
public class testServer extends com.fizzed.rocker.runtime.DefaultRockerModel {

    static public com.fizzed.rocker.ContentType getContentType() { return com.fizzed.rocker.ContentType.RAW; }
    static public String getTemplateName() { return "testServer.rocker.raw"; }
    static public String getTemplatePackageName() { return "templates.graphql"; }
    static public String getHeaderHash() { return "-752895709"; }
    static public long getModifiedAt() { return 1645995245871L; }
    static public String[] getArgumentNames() { return new String[] { "handlerPackage" }; }

    // argument @ [1:2]
    private String handlerPackage;

    public testServer handlerPackage(String handlerPackage) {
        this.handlerPackage = handlerPackage;
        return this;
    }

    public String handlerPackage() {
        return this.handlerPackage;
    }

    static public testServer template(String handlerPackage) {
        return new testServer()
            .handlerPackage(handlerPackage);
    }

    @Override
    protected DefaultRockerTemplate buildTemplate() throws RenderingException {
        // optimized for convenience (runtime auto reloading enabled if rocker.reloading=true)
        return com.fizzed.rocker.runtime.RockerRuntime.getInstance().getBootstrap().template(this.getClass(), this);
    }

    static public class Template extends com.fizzed.rocker.runtime.DefaultRockerTemplate {

        // \npackage 
        static private final byte[] PLAIN_TEXT_0_0;
        // ;\n\nimport org.junit.rules.ExternalResource;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nimport com.networknt.server.Server;\nimport com.networknt.server.ServerConfig;\n\npublic class TestServer extends ExternalResource {\n    static final Logger logger = LoggerFactory.getLogger(TestServer.class);\n\n    private static final AtomicInteger refCount = new AtomicInteger(0);\n\n    private static final TestServer instance  = ne...
        static private final byte[] PLAIN_TEXT_1_0;

        static {
            PlainTextUnloadedClassLoader loader = PlainTextUnloadedClassLoader.tryLoad(testServer.class.getClassLoader(), testServer.class.getName() + "$PlainText", "UTF-8");
            PLAIN_TEXT_0_0 = loader.tryGet("PLAIN_TEXT_0_0");
            PLAIN_TEXT_1_0 = loader.tryGet("PLAIN_TEXT_1_0");
        }

        // argument @ [1:2]
        protected final String handlerPackage;

        public Template(testServer model) {
            super(model);
            __internal.setCharset("UTF-8");
            __internal.setContentType(getContentType());
            __internal.setTemplateName(getTemplateName());
            __internal.setTemplatePackageName(getTemplatePackageName());
            this.handlerPackage = model.handlerPackage();
        }

        @Override
        protected void __doRender() throws IOException, RenderingException {
            // PlainText @ [1:30]
            __internal.aboutToExecutePosInTemplate(1, 30);
            __internal.writeValue(PLAIN_TEXT_0_0);
            // ValueExpression @ [2:9]
            __internal.aboutToExecutePosInTemplate(2, 9);
            __internal.renderValue(handlerPackage, false);
            // PlainText @ [2:24]
            __internal.aboutToExecutePosInTemplate(2, 24);
            __internal.writeValue(PLAIN_TEXT_1_0);
        }
    }

    private static class PlainText {

        static private final String PLAIN_TEXT_0_0 = "\npackage ";
        static private final String PLAIN_TEXT_1_0 = ";\n\nimport org.junit.rules.ExternalResource;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nimport com.networknt.server.Server;\nimport com.networknt.server.ServerConfig;\n\npublic class TestServer extends ExternalResource {\n    static final Logger logger = LoggerFactory.getLogger(TestServer.class);\n\n    private static final AtomicInteger refCount = new AtomicInteger(0);\n\n    private static final TestServer instance  = new TestServer();\n\n    private TestServer() {\n        logger.info(\"TestServer is constructed!\");\n    }\n\n    public static TestServer getInstance () {\n        return instance;\n    }\n\n\n    public ServerConfig getServerConfig() {\n        return Server.getServerConfig();\n    }\n\n    @Override\n    protected void before() {\n        try {\n            if (refCount.get() == 0) {\n                Server.init();\n                logger.info(\"TestServer is initialized!\");\n            }\n        }\n        finally {\n            refCount.getAndIncrement();\n        }\n    }\n\n    @Override\n    protected void after() {\n        refCount.getAndDecrement();\n        if (refCount.get() == 0) {\n            Server.stop();\n            logger.info(\"TestServer is stopped!\");\n        }\n    }\n}\n";

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy