Examples of ClassFactory


Examples of org.apache.hivemind.service.ClassFactory

        verifyControls();
    }

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

        dib.setClassFactory(cf);

        ErrorLog log = newErrorLog();
View Full Code Here

Examples of org.apache.hivemind.service.ClassFactory

        verifyControls();
    }

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

        dib.setClassFactory(cf);

        ErrorLog log = newErrorLog();
View Full Code Here

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

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

Examples of org.apache.hivemind.service.ClassFactory

    }

    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

Examples of org.apache.hivemind.service.ClassFactory

    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

Examples of org.apache.hivemind.service.ClassFactory

    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

Examples of org.apache.hivemind.service.ClassFactory

        ServicePoint sp1 = (ServicePoint) spc1.getMock();

        MockControl spc2 = newControl(ServicePoint.class);
        ServicePoint sp2 = (ServicePoint) spc2.getMock();

        ClassFactory service = (ClassFactory) newMock(ClassFactory.class);

        // Training

        sp1.getExtensionPointId();
        spc1.setReturnValue("foo.Private");
View Full Code Here

Examples of org.apache.hivemind.service.ClassFactory

    public void testConstructDefaultRegistry() throws Exception
    {
        Registry r = RegistryBuilder.constructDefaultRegistry();

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

        assertNotNull(factory);
    }
View Full Code Here

Examples of org.apache.hivemind.service.ClassFactory

        _serviceInterface = point.getServiceInterface();

        Class declaredInterface = point.getDeclaredInterface();

        Module module = point.getModule();
        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);

        if (!extendBeanClass)
            _classFab.addInterface(_serviceInterface);

        // Not exactly certain this will work with non-interface beans that already
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.