@Override public void assemble( ModuleAssembly module ) { module.layer().application().setName( name ); } }
@Override public void assemble( ModuleAssembly module ) { module.layer().application().setName( name ); } }
protected void assembleApplication() { assembly.setName( name ); assembly.setVersion( version ); assembly.setMode( mode ); assembleLayers( assembly ); }
protected void assembleApplication() { assembly.setName( name ); assembly.setVersion( version ); assembly.setMode( mode ); assembleLayers( assembly ); }
public void assemble( ModuleAssembly module ) throws AssemblyException { LayerAssembly layerAssembly = module.layer(); layerAssembly.application().setName( "testapp" ); module.transients( TestComposite.class ); }
@Override public void assemble( ModuleAssembly module ) throws AssemblyException { module.layer().application().setName( "PreferencesTest" ); super.assemble( module ); ClassLoader cl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader( null ); Preferences node = Preferences.userNodeForPackage( getClass() ) .node( "integtest" ) .node( tmpDir.getRoot().getName() ) .node( "PreferencesEntityStoreTest" ); PreferencesEntityStoreInfo metaInfo = new PreferencesEntityStoreInfo( node ); Thread.currentThread().setContextClassLoader( cl ); module.services( PreferencesEntityStoreService.class ).setMetaInfo( metaInfo ).instantiateOnStartup(); module.defaultServices(); } }
ApplicationDescriptor model = polygene.newApplicationModel( factory -> { ApplicationAssembly assembly = factory.newApplicationAssembly(); assembly.setName( applicationName ); if( applicationVersion != null )
ApplicationDescriptor model = polygene.newApplicationModel( factory -> { ApplicationAssembly assembly = factory.newApplicationAssembly(); assembly.setName( applicationName ); if( applicationVersion != null )
@Override public void assemble( ModuleAssembly module ) { module.layer().application().setName( "SomeApplication" ); module.transients( Country1.class ); module.transients( Country2.class ).withConcerns( TimingCaptureAllConcern.class ); module.transients( Country3.class ).withConcerns( TimingCaptureConcern.class ); metricsAssembler().assemble( module ); }
@Override public void assemble( ModuleAssembly module ) { module.layer().application().setName( "SomeApplication" ); module.transients( Country1.class ); module.transients( Country2.class ).withConcerns( TimingCaptureAllConcern.class ); module.transients( Country3.class ).withConcerns( TimingCaptureConcern.class ); metricsAssembler().assemble( module ); }
public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory ) throws AssemblyException { ApplicationAssembly appass = applicationFactory.newApplicationAssembly(); // END SNIPPET: bootstrap // Assemble your application here appass.setName( APP_NAME ); ModuleAssembly module = appass.layer( "Layer 1" ).module( "Module 1" ); module.transients( UselessComposite.class ); // START SNIPPET: bootstrap return appass; }
@Test public void testModel2XML() throws AssemblyException, TransformerException { Energy4Java polygene = new Energy4Java( ); ApplicationDescriptor model = polygene.newApplicationModel( factory -> { ApplicationAssembly assembly = factory.newApplicationAssembly(); assembly.setName( "Test application" ); LayerAssembly webLayer = assembly.layer( "Web" ); LayerAssembly domainLayer = assembly.layer( "Domain" ); LayerAssembly infrastructureLayer = assembly.layer( "Infrastructure" ); webLayer.uses( domainLayer, infrastructureLayer ); domainLayer.uses( infrastructureLayer ); ModuleAssembly rest = webLayer.module( "REST" ); rest.transients( TestTransient.class ).visibleIn( Visibility.layer ); domainLayer.module( "Domain" ); infrastructureLayer.module( "Database" ); return assembly; } ); Document document = new Model2XML().apply( model ); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty( "indent", "yes" ); transformer.setOutputProperty( "{http://xml.apache.org/xslt}indent-amount", "2" ); transformer.transform( new DOMSource( document ), new StreamResult( System.out ) ); }
private static ApplicationAssembly createAssembly( ApplicationAssemblyFactory factory ) throws AssemblyException { String applicationName = "Example Application"; ApplicationAssembly app = factory.newApplicationAssembly(); app.setName( applicationName ); LayerAssembly webLayer = createWebLayer( app ); LayerAssembly domainLayer = createDomainLayer( app ); LayerAssembly infraLayer = createInfrastructureLayer( app ); webLayer.uses( domainLayer ); webLayer.uses( infraLayer ); // Accesses the WebService domainLayer.uses( infraLayer ); // For persistence return app; }
assembly.setName( "Forum" );
public void assemble( ModuleAssembly module ) throws AssemblyException { LayerAssembly layer = module.layer(); layer.application().setName( "Script Test" ); module.transients( DomainType.class ).setMetaInfo( Scripting.JAVASCRIPT ).withMixins( ScriptMixin.class ); module.transients( HelloSpeaker.class ).setMetaInfo( Scripting.GROOVY ).withMixins( ScriptMixin.class ); module.values( HelloSpeaker.class ).setMetaInfo( Scripting.JAVASCRIPT ).withMixins( ScriptMixin.class ); }
@Override protected final void defineApplication( ApplicationAssembly app ) { app.setName( "app" ); LayerAssembly domain = app.layer( "domain" ); ModuleAssembly model = domain.module( "model" ); model.entities( Person.class, PersonList.class ) .visibleIn( Visibility.layer ); ModuleAssembly services = domain.module( "services" ); services.services( Commands.class, Queries.class ) .instantiateOnStartup() .visibleIn( Visibility.application ); LayerAssembly config = app.layer( "config" ); ModuleAssembly configModule = config.module( "config" ); new EntityTestAssembler() .visibleIn( Visibility.module ) .assemble( configModule ); LayerAssembly infra = app.layer( "infra" ); ModuleAssembly storage = infra.module( "storage" ); entityStoreAssembler( configModule, Visibility.application ) .visibleIn( Visibility.application ) .assemble( storage ); metricsAssembler() .visibleIn( Visibility.application ) .assemble( infra.module( "metrics" ) ); domain.uses( infra ); infra.uses( config ); }
@Override protected final void defineApplication( ApplicationAssembly app ) { app.setName( "app" ); LayerAssembly domain = app.layer( "domain" ); ModuleAssembly model = domain.module( "model" ); model.entities( Person.class, PersonList.class ) .visibleIn( Visibility.layer ); ModuleAssembly services = domain.module( "services" ); services.services( Commands.class, Queries.class ) .instantiateOnStartup() .visibleIn( Visibility.application ); LayerAssembly config = app.layer( "config" ); ModuleAssembly configModule = config.module( "config" ); new EntityTestAssembler() .visibleIn( Visibility.module ) .assemble( configModule ); LayerAssembly infra = app.layer( "infra" ); ModuleAssembly storage = infra.module( "storage" ); entityStoreAssembler( configModule, Visibility.application ) .visibleIn( Visibility.application ) .assemble( storage ); metricsAssembler() .visibleIn( Visibility.application ) .assemble( infra.module( "metrics" ) ); domain.uses( infra ); infra.uses( config ); }
private SingletonAssembler activateEmbeddedElasticsearch( final String name ) { try { return new SingletonAssembler( module -> { module.layer().application().setName( name ); ModuleAssembly config = module.layer().module( "config" ); new EntityTestAssembler().assemble( config ); new EntityTestAssembler().assemble( module ); new FileConfigurationAssembler() .withOverride( new FileConfigurationOverride().withConventionalRoot( tmpDir.getRoot() ) ) .assemble( module ); new ESFilesystemIndexQueryAssembler() .identifiedBy( name ) .withConfig( config, Visibility.layer ) .assemble( module ); } ); } catch( ActivationException | AssemblyException ex ) { throw new RuntimeException( "Embedded Elasticsearch Rule - Failed to activate", ex ); } }