Search in sources :

Example 1 with ServerPresentationModelBuilderFactory

use of com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory in project dolphin-platform by canoo.

the class ServerPresentationModelBuilderFactoryTest method testSimpleCreation.

@Test
public void testSimpleCreation() {
    ServerModelStore serverModelStore = createServerModelStore();
    ServerPresentationModelBuilderFactory factory = new ServerPresentationModelBuilderFactory(serverModelStore);
    PresentationModelBuilder<ServerPresentationModel> builder = factory.createBuilder();
    assertNotNull(builder);
}
Also used : ServerPresentationModel(com.canoo.dp.impl.server.legacy.ServerPresentationModel) ServerPresentationModelBuilderFactory(com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory) ServerModelStore(com.canoo.dp.impl.server.legacy.ServerModelStore) Test(org.testng.annotations.Test) AbstractDolphinBasedTest(com.canoo.impl.server.util.AbstractDolphinBasedTest)

Example 2 with ServerPresentationModelBuilderFactory

use of com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory in project dolphin-platform by canoo.

the class AbstractDolphinBasedTest method createBeanManager.

protected BeanManager createBeanManager(ServerModelStore serverModelStore, BeanRepository beanRepository, EventDispatcher dispatcher) {
    final Converters converters = new Converters(beanRepository);
    final PresentationModelBuilderFactory builderFactory = new ServerPresentationModelBuilderFactory(serverModelStore);
    final ClassRepository classRepository = new ClassRepositoryImpl(serverModelStore, converters, builderFactory);
    final ListMapper listMapper = new ListMapperImpl(serverModelStore, classRepository, beanRepository, builderFactory, dispatcher);
    final RemotingConfiguration configurationForGc = new RemotingConfiguration();
    final GarbageCollector garbageCollector = new GarbageCollector(configurationForGc, new GarbageCollectionCallback() {

        @Override
        public void onReject(Set<Instance> instances) {
        }
    });
    final BeanBuilder beanBuilder = new ServerBeanBuilderImpl(classRepository, beanRepository, listMapper, builderFactory, dispatcher, garbageCollector);
    return new BeanManagerImpl(beanRepository, beanBuilder);
}
Also used : Instance(com.canoo.dp.impl.server.gc.Instance) ClassRepository(com.canoo.dp.impl.remoting.ClassRepository) Converters(com.canoo.dp.impl.remoting.Converters) BeanBuilder(com.canoo.dp.impl.remoting.BeanBuilder) ServerPresentationModelBuilderFactory(com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory) PresentationModelBuilderFactory(com.canoo.dp.impl.remoting.PresentationModelBuilderFactory) RemotingConfiguration(com.canoo.dp.impl.server.config.RemotingConfiguration) ServerPresentationModelBuilderFactory(com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory) GarbageCollectionCallback(com.canoo.dp.impl.server.gc.GarbageCollectionCallback) ServerBeanBuilderImpl(com.canoo.dp.impl.server.model.ServerBeanBuilderImpl) BeanManagerImpl(com.canoo.dp.impl.remoting.BeanManagerImpl) ListMapper(com.canoo.dp.impl.remoting.ListMapper) ListMapperImpl(com.canoo.dp.impl.remoting.collections.ListMapperImpl) ClassRepositoryImpl(com.canoo.dp.impl.remoting.ClassRepositoryImpl) GarbageCollector(com.canoo.dp.impl.server.gc.GarbageCollector)

Example 3 with ServerPresentationModelBuilderFactory

use of com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory in project dolphin-platform by canoo.

the class AbstractDolphinBasedTest method createBeanManager.

protected BeanManager createBeanManager(ServerModelStore serverModelStore) {
    final EventDispatcher dispatcher = new ServerEventDispatcher(serverModelStore);
    final BeanRepositoryImpl beanRepository = new BeanRepositoryImpl(serverModelStore, dispatcher);
    final Converters converters = new Converters(beanRepository);
    final PresentationModelBuilderFactory builderFactory = new ServerPresentationModelBuilderFactory(serverModelStore);
    final ClassRepository classRepository = new ClassRepositoryImpl(serverModelStore, converters, builderFactory);
    final ListMapper listMapper = new ListMapperImpl(serverModelStore, classRepository, beanRepository, builderFactory, dispatcher);
    final RemotingConfiguration configurationForGc = new RemotingConfiguration();
    final GarbageCollector garbageCollector = new GarbageCollector(configurationForGc, new GarbageCollectionCallback() {

        @Override
        public void onReject(Set<Instance> instances) {
        }
    });
    final BeanBuilder beanBuilder = new ServerBeanBuilderImpl(classRepository, beanRepository, listMapper, builderFactory, dispatcher, garbageCollector);
    return new BeanManagerImpl(beanRepository, beanBuilder);
}
Also used : ServerEventDispatcher(com.canoo.dp.impl.server.model.ServerEventDispatcher) Instance(com.canoo.dp.impl.server.gc.Instance) ClassRepository(com.canoo.dp.impl.remoting.ClassRepository) Converters(com.canoo.dp.impl.remoting.Converters) BeanBuilder(com.canoo.dp.impl.remoting.BeanBuilder) BeanRepositoryImpl(com.canoo.dp.impl.remoting.BeanRepositoryImpl) ServerPresentationModelBuilderFactory(com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory) PresentationModelBuilderFactory(com.canoo.dp.impl.remoting.PresentationModelBuilderFactory) ServerEventDispatcher(com.canoo.dp.impl.server.model.ServerEventDispatcher) EventDispatcher(com.canoo.dp.impl.remoting.EventDispatcher) RemotingConfiguration(com.canoo.dp.impl.server.config.RemotingConfiguration) ServerPresentationModelBuilderFactory(com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory) GarbageCollectionCallback(com.canoo.dp.impl.server.gc.GarbageCollectionCallback) ServerBeanBuilderImpl(com.canoo.dp.impl.server.model.ServerBeanBuilderImpl) BeanManagerImpl(com.canoo.dp.impl.remoting.BeanManagerImpl) ListMapper(com.canoo.dp.impl.remoting.ListMapper) ListMapperImpl(com.canoo.dp.impl.remoting.collections.ListMapperImpl) ClassRepositoryImpl(com.canoo.dp.impl.remoting.ClassRepositoryImpl) GarbageCollector(com.canoo.dp.impl.server.gc.GarbageCollector)

Aggregations

ServerPresentationModelBuilderFactory (com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory)3 BeanBuilder (com.canoo.dp.impl.remoting.BeanBuilder)2 BeanManagerImpl (com.canoo.dp.impl.remoting.BeanManagerImpl)2 ClassRepository (com.canoo.dp.impl.remoting.ClassRepository)2 ClassRepositoryImpl (com.canoo.dp.impl.remoting.ClassRepositoryImpl)2 Converters (com.canoo.dp.impl.remoting.Converters)2 ListMapper (com.canoo.dp.impl.remoting.ListMapper)2 PresentationModelBuilderFactory (com.canoo.dp.impl.remoting.PresentationModelBuilderFactory)2 ListMapperImpl (com.canoo.dp.impl.remoting.collections.ListMapperImpl)2 RemotingConfiguration (com.canoo.dp.impl.server.config.RemotingConfiguration)2 GarbageCollectionCallback (com.canoo.dp.impl.server.gc.GarbageCollectionCallback)2 GarbageCollector (com.canoo.dp.impl.server.gc.GarbageCollector)2 Instance (com.canoo.dp.impl.server.gc.Instance)2 ServerBeanBuilderImpl (com.canoo.dp.impl.server.model.ServerBeanBuilderImpl)2 BeanRepositoryImpl (com.canoo.dp.impl.remoting.BeanRepositoryImpl)1 EventDispatcher (com.canoo.dp.impl.remoting.EventDispatcher)1 ServerModelStore (com.canoo.dp.impl.server.legacy.ServerModelStore)1 ServerPresentationModel (com.canoo.dp.impl.server.legacy.ServerPresentationModel)1 ServerEventDispatcher (com.canoo.dp.impl.server.model.ServerEventDispatcher)1 AbstractDolphinBasedTest (com.canoo.impl.server.util.AbstractDolphinBasedTest)1