Package org.apache.hivemind.service

Examples of org.apache.hivemind.service.ClassFactory


    {
        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

        ClassFactory cf = new ClassFactoryImpl();
        DefaultImplementationBuilderImpl dib = new DefaultImplementationBuilderImpl();

        dib.setClassFactory(cf);

        PipelineFactory factory = new PipelineFactory();
View Full Code Here


    }

    public void testBuildImplementationClass()
    {
        MockControl factoryControl = newControl(ClassFactory.class);
        ClassFactory factory = (ClassFactory) factoryControl.getMock();

        MockControl cfc = newControl(ClassFab.class);
        ClassFab cf = (ClassFab) cfc.getMock();

        MethodFab mf = (MethodFab) newMock(MethodFab.class);

        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

        fp.getServiceInterface();
        fpc.setReturnValue(ToStringStrategy.class);

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

        cf.addInterface(ToStringStrategy.class);
        cf.addField("_registry", StrategyRegistry.class);
View Full Code Here

    public void testBuildImplementationClassImproperMethod()
    {
        Location l = newLocation();

        MockControl factoryControl = newControl(ClassFactory.class);
        ClassFactory factory = (ClassFactory) factoryControl.getMock();

        MockControl cfc = newControl(ClassFab.class);
        ClassFab cf = (ClassFab) cfc.getMock();

        MethodFab mf = (MethodFab) newMock(MethodFab.class);

        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

        ErrorLog log = (ErrorLog) newMock(ErrorLog.class);

        fp.getServiceInterface();
        fpc.setReturnValue(Runnable.class);

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

        cf.addInterface(Runnable.class);
        cf.addField("_registry", StrategyRegistry.class);
View Full Code Here

        verifyControls();
    }

    public void testPassThruToPlaceholder()
    {
        ClassFactory cf = new ClassFactoryImpl();
        DefaultImplementationBuilderImpl dib = new DefaultImplementationBuilderImpl();

        dib.setClassFactory(cf);

        ErrorLog log = newErrorLog();
View Full Code Here

        verifyControls();
    }

    public void testFilterChain()
    {
        ClassFactory cf = new ClassFactoryImpl();
        DefaultImplementationBuilderImpl dib = new DefaultImplementationBuilderImpl();

        dib.setClassFactory(cf);

        ErrorLog log = newErrorLog();
View Full Code Here

    {
        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

        ClassFactory cf = new ClassFactoryImpl();
        DefaultImplementationBuilderImpl dib = new DefaultImplementationBuilderImpl();

        dib.setClassFactory(cf);

        PipelineFactory factory = new PipelineFactory();
View Full Code Here

    {
        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

        ClassFactory cf = new ClassFactoryImpl();
        DefaultImplementationBuilderImpl dib = new DefaultImplementationBuilderImpl();

        dib.setClassFactory(cf);

        PipelineFactory factory = new PipelineFactory();
View Full Code Here

    }

    public void testBuildImplementationClass()
    {
        MockControl factoryControl = newControl(ClassFactory.class);
        ClassFactory factory = (ClassFactory) factoryControl.getMock();

        MockControl cfc = newControl(ClassFab.class);
        ClassFab cf = (ClassFab) cfc.getMock();

        MethodFab mf = (MethodFab) newMock(MethodFab.class);

        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

        fp.getServiceInterface();
        fpc.setReturnValue(ToStringStrategy.class);

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

        cf.addInterface(ToStringStrategy.class);
        cf.addField("_registry", StrategyRegistry.class);
View Full Code Here

    public void testBuildImplementationClassImproperMethod()
    {
        Location l = newLocation();

        MockControl factoryControl = newControl(ClassFactory.class);
        ClassFactory factory = (ClassFactory) factoryControl.getMock();

        MockControl cfc = newControl(ClassFab.class);
        ClassFab cf = (ClassFab) cfc.getMock();

        MethodFab mf = (MethodFab) newMock(MethodFab.class);

        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

        ErrorLog log = (ErrorLog) newMock(ErrorLog.class);

        fp.getServiceInterface();
        fpc.setReturnValue(Runnable.class);

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

        cf.addInterface(Runnable.class);
        cf.addField("_registry", StrategyRegistry.class);
View Full Code Here

    public ProxyBuilder(String type, Module module, Class serviceInterface, Class declaredInterface, boolean outerProxy)
    {
        _type = type;
        _serviceInterface = serviceInterface;

        ClassFactory factory = (ClassFactory) module.getService(
                "hivemind.ClassFactory",
                ClassFactory.class);

        boolean extendBeanClass = outerProxy && !declaredInterface.isInterface();
        Class baseClass = extendBeanClass ? declaredInterface : Object.class;

        _classFab = factory.newClass(ClassFabUtils.generateClassName(_serviceInterface), baseClass);

        _classFab.addField("_extensionPointId", String.class);
       
        _classFab.addConstructor(new Class[] { String.class }, null, "{ _extensionPointId = $1; }");
       
View Full Code Here

TOP

Related Classes of org.apache.hivemind.service.ClassFactory

Copyright © 2018 www.massapicom. 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.