Exemplo n.º 1
0
  private void assembleBootstrapLayer(LayerAssembly bootstrapLayer) throws AssemblyException {
    ModuleAssembly bootstrapModule = bootstrapLayer.module("BOOTSTRAP-Bootstrap");

    // Load base data on startup
    bootstrapModule
        .addServices(BaseDataService.class)
        .visibleIn(application)
        .instantiateOnStartup();
  }
Exemplo n.º 2
0
  // END SNIPPET: domainLayer
  // START SNIPPET: accountModule
  private static void createAccountModule(LayerAssembly layer) {
    ModuleAssembly module = layer.module("account-module");

    module.entities(AccountEntity.class, EntryEntity.class);

    module
        .addServices(
            AccountRepositoryService.class,
            AccountFactoryService.class,
            EntryFactoryService.class,
            EntryRepositoryService.class)
        .visibleIn(Visibility.layer);
  }
Exemplo n.º 3
0
  private void assembleContextLayer(LayerAssembly contextLayer) throws AssemblyException {
    ModuleAssembly roleMapModule = contextLayer.module("CONTEXT-RoleMap");

    // Role-playing entities
    roleMapModule
        .entities(CargoRoleMap.class, CargosRoleMap.class, HandlingEventsRoleMap.class)
        .visibleIn(application);

    // Non-role-playing entities
    roleMapModule
        .entities(HandlingEventEntity.class, LocationEntity.class, VoyageEntity.class)
        .visibleIn(application);

    ModuleAssembly interactionModule = contextLayer.module("CONTEXT-Interaction");
    interactionModule.transients(ProcessHandlingEvent.class).visibleIn(application);

    ModuleAssembly contextServiceModule = contextLayer.module("CONTEXT-Service");
    contextServiceModule
        .addServices(
            ParseHandlingEventData.class,
            RoutingService.class,
            RouteSpecificationFactoryService.class)
        .visibleIn(application);

    contextServiceModule.values(ParsedHandlingEventData.class).visibleIn(application);
  }
Exemplo n.º 4
0
 private void assembleDomainLayer(LayerAssembly dataLayer) throws AssemblyException {
   // Non-role-playing values
   ModuleAssembly structureModule = dataLayer.module("DATA-Structure");
   structureModule
       .values(
           TrackingId.class,
           RouteSpecification.class,
           Delivery.class,
           NextHandlingEvent.class,
           UnLocode.class,
           Itinerary.class,
           Leg.class,
           CarrierMovement.class,
           Schedule.class,
           VoyageNumber.class)
       .visibleIn(application);
 }
Exemplo n.º 5
0
  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);
  }