コード例 #1
0
 @Override
 public void assemble(ModuleAssembly module) throws AssemblyException {
   super.assemble(module);
   module
       .services(MemoryRepositoryService.class, RdfQueryParserFactory.class)
       .instantiateOnStartup();
   module.objects(EntityStateSerializer.class, EntityTypeSerializer.class);
   module.services(RdfIndexingEngineService.class);
 }
コード例 #2
0
  public void assemble(ModuleAssembly module) throws AssemblyException {
    Properties props = new Properties();
    try {
      props.load(getClass().getResourceAsStream("/velocity.properties"));

      VelocityEngine velocity = new VelocityEngine(props);

      module.importedServices(VelocityEngine.class).importedBy(INSTANCE).setMetaInfo(velocity);

    } catch (Exception e) {
      throw new AssemblyException("Could not load velocity properties", e);
    }
    module.objects(DefaultCommandQueryResource.class);

    module.importedServices(MetadataService.class);

    module
        .importedServices(ResponseWriterDelegator.class)
        .identifiedBy("responsewriterdelegator")
        .importedBy(NEW_OBJECT)
        .visibleIn(Visibility.layer);
    module.objects(ResponseWriterDelegator.class);

    module
        .importedServices(RequestReaderDelegator.class)
        .identifiedBy("requestreaderdelegator")
        .importedBy(NEW_OBJECT)
        .visibleIn(Visibility.layer);
    module.objects(RequestReaderDelegator.class);

    // Standard result writers
    module.objects(
        ResourceTemplateResponseWriter.class,
        DefaultResponseWriter.class,
        LinksResponseWriter.class,
        TableResponseWriter.class,
        ResourceResponseWriter.class,
        ValueCompositeResponseWriter.class,
        JSONResponseWriter.class,
        FormResponseWriter.class);

    // Standard request readers
    module.objects(DefaultRequestReader.class);
  }
コード例 #3
0
  public final void assemble(ModuleAssembly module) throws AssemblyException {
    module.objects(EntityStateSerializer.class, EntityTypeSerializer.class);

    module
        .services(
            UuidIdentityGeneratorService.class,
            MemoryEntityStoreService.class,

            // Query
            RdfQueryParserFactory.class,
            RdfIndexingEngineService.class,
            MemoryRepositoryService.class)
        .visibleIn(application)
        .instantiateOnStartup();
  }
コード例 #4
0
ファイル: TestAssembler.java プロジェクト: niclash/dci-sample
  private void assembleInfrastructureLayer(LayerAssembly infrastructureLayer)
      throws AssemblyException {
    ModuleAssembly indexingModule = infrastructureLayer.module("INFRASTRUCTURE-Indexing");
    indexingModule.objects(EntityStateSerializer.class, EntityTypeSerializer.class);

    indexingModule
        .addServices(MemoryRepositoryService.class, RdfIndexingEngineService.class)
        .visibleIn(application);

    ModuleAssembly entityStoreModule = infrastructureLayer.module("INFRASTRUCTURE-EntityStore");
    entityStoreModule
        .addServices(MemoryEntityStoreService.class, UuidIdentityGeneratorService.class)
        .visibleIn(application);

    ModuleAssembly externalServiceModule =
        infrastructureLayer.module("INFRASTRUCTURE-ExternalService");
    externalServiceModule
        .importedServices(GraphTraversalService.class)
        .setMetaInfo(new GraphTraversalServiceImpl(new GraphDAO()))
        .visibleIn(application);
  }
コード例 #5
0
  public void assemble(ModuleAssembly module) throws AssemblyException {
    new EntityTestAssembler().assemble(module);

    module.objects(MigrationEventLogger.class);
    module.importedServices(MigrationEventLogger.class).importedBy(NewObjectImporter.class);

    module.entities(
        TestEntity1_0.class,
        TestEntity1_1.class,
        TestEntity2_0.class,
        org.qi4j.migration.moved.TestEntity2_0.class);

    MigrationBuilder migration = new MigrationBuilder("1.0");
    migration
        .toVersion("1.1")
        .renameEntity(TestEntity1_0.class.getName(), TestEntity1_1.class.getName())
        .atStartup(new CustomFixOperation("Fix for 1.1"))
        .forEntities(TestEntity1_1.class.getName())
        .renameProperty("foo", "newFoo")
        .renameManyAssociation("fooManyAssoc", "newFooManyAssoc")
        .renameAssociation("fooAssoc", "newFooAssoc")
        .end()
        .toVersion("2.0")
        .renameEntity(TestEntity1_1.class.getName(), TestEntity2_0.class.getName())
        .atStartup(new CustomFixOperation("Fix for 2.0, 1"))
        .atStartup(new CustomFixOperation("Fix for 2.0, 2"))
        .forEntities(TestEntity2_0.class.getName())
        .addProperty("bar", "Some value")
        .removeProperty("newFoo", "Some value")
        .custom(new CustomBarOperation())
        .end()
        .toVersion("3.0")
        .renamePackage("org.qi4j.migration", "org.qi4j.migration.moved")
        .withEntities("TestEntity2_0")
        .end();

    module.services(MigrationService.class).setMetaInfo(migration);
    module.entities(MigrationConfiguration.class);
    module.forMixin(MigrationConfiguration.class).declareDefaults().lastStartupVersion().set("1.0");
  }
コード例 #6
0
 public void assemble(ModuleAssembly module) throws AssemblyException {
   module.layer().application().setName("StreamFlowServer");
   module.services(FileConfiguration.class);
   module.objects(getClass());
 }