Examples of addConstructor()


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

        body.addln("_serviceModel = $2;");
        body.addln("_deferredProxy._setInner(this);");

        body.end();

        classFab.addConstructor(new Class[]
        { deferredProxyClass, getClass() }, null, body.toString());

        // Method _service() will look up the service implementation,
        // then update the deferred proxy to go directly to the
        // service implementation, bypassing itself!
View Full Code Here

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

        Class serviceType = service.getClass();

        cf.addField("_service", serviceType);

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

        builder.addServiceMethods("_service");

        return cf.createClass();
View Full Code Here

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

                stack.getServiceModule());

        classFab.addInterface(serviceInterfaceClass);
        classFab.addField("_inner", serviceInterfaceClass);

        classFab.addConstructor(
            new Class[] { Log.class, serviceInterfaceClass },
            null,
            "{ super($1); _inner = $2; }");

        Method[] methods = serviceInterfaceClass.getMethods();
View Full Code Here

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

    public void testConstructorFromBaseClass() throws Exception
    {
        ClassFab cf = newClassFab("MyIntHolder", AbstractIntWrapper.class);

        cf.addField("_intValue", int.class);
        cf.addConstructor(new Class[] { int.class }, null, "{ _intValue = $1; }");

        cf.addMethod(
            Modifier.PUBLIC,
            new MethodSignature(int.class, "getIntValue", null, null),
            "return _intValue;");
View Full Code Here

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

    {
        ClassFab cf = newClassFab("BadConstructor", Object.class);

        try
        {
            cf.addConstructor(null, null, " woops!");
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Unable to add constructor to class BadConstructor");
        }
View Full Code Here

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

    {
        ClassFab cf = newClassFab("BadConstructor", Object.class);

        try
        {
            cf.addConstructor(null, null, " woops!");
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Unable to add constructor to class BadConstructor");
        }
View Full Code Here

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

        cf.addInterface(Runnable.class);
        cf.addInterface(Serializable.class);

        cf.addField("_map", Map.class);

        cf.addConstructor(new Class[]
        { Map.class, Runnable.class }, new Class[]
        { IllegalArgumentException.class, DataFormatException.class }, "{ _map = $1; }");

        MethodSignature sig = new MethodSignature(Map.class, "doTheNasty", new Class[]
        { int.class, String.class }, new Class[]
View Full Code Here

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

        body.addln("_serviceModel = $3;");
        body.addln("_deferredProxy._setInner(this);");

        body.end();

        classFab.addConstructor(new Class[]
        { String.class, deferredProxyClass, getClass() }, null, body.toString());

        // Method _service() will look up the service implementation,
        // then update the deferred proxy to go directly to the
        // service implementation, bypassing itself!
View Full Code Here

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

        Class serviceType = service.getClass();

        cf.addField("_service", serviceType);

        cf.addConstructor(new Class[]
        { String.class, serviceType }, null, "{ this($1); _service = $2; }");

        builder.addServiceMethods("_service");

        return cf.createClass();
View Full Code Here

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

        cf.addInterface(serviceInterface);

        cf.addField("_registry", StrategyRegistry.class);

        cf.addConstructor(new Class[]
        { StrategyRegistry.class }, null, "_registry = $1;");

        // TODO: Should we add a check for $1 == null?

        cf.addMethod(Modifier.PRIVATE, new MethodSignature(serviceInterface, "_getStrategy",
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.