Package org.apache.hivemind.service

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


       
        String name = ClassFabUtils.generateClassName(serviceInterfaceClass);

        ClassFab classFab = _factory.newClass(name, Object.class);

        classFab.addInterface(serviceInterfaceClass);

        createInfrastructure(stack, classFab);

        addServiceMethods(stack, classFab, parameters);
View Full Code Here


        fpc.setReturnValue(ToStringStrategy.class);

        factory.newClass("NewClass", Object.class);
        factoryControl.setReturnValue(cf);

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

        cf.addConstructor(new Class[]
        { StrategyRegistry.class }, null, "_registry = $1;");
        cfc.setMatcher(new AggregateArgumentsMatcher(new ArrayMatcher()));
View Full Code Here

        fpc.setReturnValue(Runnable.class);

        factory.newClass("NewClass", Object.class);
        factoryControl.setReturnValue(cf);

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

        cf.addConstructor(new Class[]
        { StrategyRegistry.class }, null, "_registry = $1;");
        cfc.setMatcher(new AggregateArgumentsMatcher(new ArrayMatcher()));
View Full Code Here

        fpc.setReturnValue(ToStringStrategy.class);

        factory.newClass("NewClass", Object.class);
        factoryControl.setReturnValue(cf);

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

        cf.addConstructor(new Class[]
        { StrategyRegistry.class }, null, "_registry = $1;");
        cfc.setMatcher(new AggregateArgumentsMatcher(new ArrayMatcher()));
View Full Code Here

        fpc.setReturnValue(Runnable.class);

        factory.newClass("NewClass", Object.class);
        factoryControl.setReturnValue(cf);

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

        cf.addConstructor(new Class[]
        { StrategyRegistry.class }, null, "_registry = $1;");
        cfc.setMatcher(new AggregateArgumentsMatcher(new ArrayMatcher()));
View Full Code Here

    public void testAddInterface() throws Exception
    {
        ClassFab cf = newClassFab("SimpleService", Object.class);

        cf.addInterface(SimpleService.class);

        cf.addMethod(Modifier.PUBLIC, new MethodSignature(int.class, "add", new Class[]
        { int.class, int.class }, null), "return $1 + $2;");

        Class targetClass = cf.createClass();
View Full Code Here

    public void testBadMethodBody() throws Exception
    {
        ClassFab cf = newClassFab("BadMethodBody", Object.class);

        cf.addInterface(Runnable.class);

        try
        {
            cf.addMethod(
                    Modifier.PUBLIC,
View Full Code Here

        classFab.addField("_inner", serviceInterface);
        classFab.addField("_shutdown", boolean.class);
        if (!RegistryShutdownListener.class.isAssignableFrom(serviceInterface))
        {
            classFab.addInterface(RegistryShutdownListener.class);

            classFab.addMethod(Modifier.PUBLIC | Modifier.FINAL, new MethodSignature(void.class,
                    "registryDidShutdown", null, null), "{ _shutdown = true; }");
        }
        classFab.addMethod(
View Full Code Here

        ClassFab classFab =
            _classFactory.newClass(
                proxyClassName,
                AbstractEJBProxy.class);

        classFab.addInterface(serviceInterface);

        classFab.addField("_remote", serviceInterface);

        addClearCachedMethod(classFab);
View Full Code Here

        classFab.addField("_inner", serviceInterface);
        classFab.addField("_shutdown", boolean.class);
        if( !RegistryShutdownListener.class.isAssignableFrom( serviceInterface ) )
        {
            classFab.addInterface(RegistryShutdownListener.class);

            classFab.addMethod(Modifier.PUBLIC | Modifier.FINAL, new MethodSignature(void.class,
                "registryDidShutdown", null, null), "{ _shutdown = true; }");
        }
        classFab.addMethod(
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.