@Override public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory ) { return applicationFactory.newApplicationAssembly( assemblers ); } }
@Override public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory ) { return applicationFactory.newApplicationAssembly( assemblers ); } }
private Application createApplicationInstance() { return polygene.newApplication( applicationFactory -> applicationFactory.newApplicationAssembly( SingletonAssembler.this ) ); }
private Application createApplicationInstance() { return polygene.newApplication( applicationFactory -> applicationFactory.newApplicationAssembly( SingletonAssembler.this ) ); }
@Override public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory ) { assembly = applicationFactory.newApplicationAssembly(); assembleApplication(); return assembly; }
@Override public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory ) { assembly = applicationFactory.newApplicationAssembly(); assembleApplication(); return assembly; }
static protected ApplicationDescriptor newApplication() throws AssemblyException { final Assembler asm = assembler; ApplicationAssembler assembler = applicationFactory -> applicationFactory.newApplicationAssembly( asm ); try { return polygene.newApplicationModel( assembler ); } catch( AssemblyException e ) { assemblyException( e ); return null; } }
static protected ApplicationDescriptor newApplication() throws AssemblyException { final Assembler asm = assembler; ApplicationAssembler assembler = applicationFactory -> applicationFactory.newApplicationAssembly( asm ); try { return polygene.newApplicationModel( assembler ); } catch( AssemblyException e ) { assemblyException( e ); return null; } }
private static ApplicationDescriptor newApplication( final Assembler[][][] assemblers ) throws AssemblyException { return polygene.newApplicationModel( factory -> factory.newApplicationAssembly( assemblers ) ); } // END SNIPPET: pancake
public static void main(String[] args) throws Exception { Energy4Java polygene = new Energy4Java(); // Instantiate the Application Model. Application application = polygene.newApplication( factory -> factory.newApplicationAssembly( new MyAssembler()) ); application.activate(); } }
private Application createApplication() { Energy4Java polygene = new Energy4Java(); try { return polygene.newApplication( factory -> { ApplicationAssembly applicationAssembly = factory.newApplicationAssembly(); applicationBootstrap.assemble( applicationAssembly ); return applicationAssembly; } ); } catch ( AssemblyException e ) { throw new BeanInitializationException( "Fail to bootstrap Polygene application.", e ); } }
protected ApplicationDescriptor newApplicationModel() throws AssemblyException { ApplicationAssembler assembler = applicationFactory -> { ApplicationAssembly applicationAssembly = applicationFactory.newApplicationAssembly(); applicationAssembly.setMode( Application.Mode.test ); defineApplication( applicationAssembly ); return applicationAssembly; }; try { return polygene.newApplicationModel( assembler ); } catch( AssemblyException e ) { assemblyException( e ); return null; } }
protected ApplicationDescriptor newApplicationModel() throws AssemblyException { ApplicationAssembler assembler = applicationFactory -> { ApplicationAssembly applicationAssembly = applicationFactory.newApplicationAssembly(); applicationAssembly.setMode( Application.Mode.test ); defineApplication( applicationAssembly ); return applicationAssembly; }; try { return polygene.newApplicationModel( assembler ); } catch( AssemblyException e ) { assemblyException( e ); return null; } }
ApplicationAssembly assembly = factory.newApplicationAssembly(); assembly.setName( applicationName ); if( applicationVersion != null )
ApplicationAssembly assembly = factory.newApplicationAssembly(); assembly.setName( applicationName ); if( applicationVersion != null )
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; }
public static void main( String[] args ) throws Exception { // Create a Polygene Runtime polygene = new Energy4Java(); // Create the application application = polygene.newApplication( factory -> buildAssembly( factory.newApplicationAssembly() ) ); // Activate the application application.activate(); }
public static void main( String[] args ) throws Exception { // Create a Polygene Runtime polygene = new Energy4Java(); // Create the application application = polygene.newApplication( factory -> { ApplicationAssembly assembly = factory.newApplicationAssembly(); assembly.setMetaInfo( new DalvikAssemblyHelper() ); // END SNIPPET: customAssemblyHelper // START SNIPPET: customAssemblyHelper return assembly; } ); // Activate the application application.activate(); }
@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 ) ); }
public Application givenFixture1() throws AssemblyException { Energy4Java polygene = new Energy4Java(); return polygene.newApplication( factory -> factory.newApplicationAssembly( new Assembler[][][] { { { module -> module.transients( TestComposite1.class ) }, { module -> module.transients( TestComposite2.class ).visibleIn( Visibility.layer ) } } } ) ); }