Examples of InjectResourceFactory


Examples of com.linkedin.restli.server.resources.InjectResourceFactory

    final PhotoDatabase photoDb = new PhotoDatabaseImpl(10);
    beanProvider.add("photoDb", photoDb);
    beanProvider.add("albumDb", new AlbumDatabaseImpl(10));
    beanProvider.add("albumEntryDb", new AlbumEntryDatabaseImpl(photoDb, 3));

    final InjectResourceFactory factory = new InjectResourceFactory(beanProvider);
    final Map<String, ResourceModel> pathRootResourceMap =
        buildResourceModels(PhotoResource.class, AlbumResource.class, AlbumEntryResource.class);
    factory.setRootResources(pathRootResourceMap);

    _photoRes = factory.create(PhotoResource.class);
    Assert.assertNotNull(_photoRes);
    Assert.assertNotNull(_photoRes.getDb());

    _albumRes = factory.create(AlbumResource.class);
    Assert.assertNotNull(_albumRes);
    Assert.assertNotNull(_albumRes.getDb());

    _entryRes = factory.create(AlbumEntryResource.class);
    Assert.assertNotNull(_entryRes);

    makeData();
  }
View Full Code Here

Examples of com.linkedin.restli.server.resources.InjectResourceFactory

    final PhotoDatabase photoDb = new PhotoDatabaseImpl(10);
    beanProvider.add("photoDb", photoDb);
    beanProvider.add("albumDb", new AlbumDatabaseImpl(10));
    beanProvider.add("albumEntryDb", new AlbumEntryDatabaseImpl(photoDb, 3));

    final InjectResourceFactory factory = new InjectResourceFactory(beanProvider);

    final Map<String, ResourceModel> pathRootResourceMap = buildResourceModels(PhotoResource.class);
    factory.setRootResources(pathRootResourceMap);

    _res = factory.create(PhotoResource.class);
    Assert.assertNotNull(_res);
    Assert.assertNotNull(_res.getDb());
  }
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.