Examples of ApplicationDescriptor


Examples of org.qi4j.api.structure.ApplicationDescriptor

    public static void main( String[] args )
        throws Exception
    {
        Energy4Java qi4j = new Energy4Java();
        Assembler assembler = new Assembler();
        ApplicationDescriptor applicationModel = qi4j.newApplicationModel( assembler );
        applicationModel.newInstance( qi4j.spi() );

        /*
       * The Envisage Swing app visualizes the application assemblage structure.
       *
       * Tree view:
View Full Code Here

Examples of org.qi4j.api.structure.ApplicationDescriptor

    }

    public Application newApplication( ApplicationAssembler assembler, Object... importedServiceInstances )
        throws AssemblyException
    {
        ApplicationDescriptor model = newApplicationModel( assembler );
        return model.newInstance( runtime.spi(), importedServiceInstances );
    }
View Full Code Here

Examples of org.qi4j.api.structure.ApplicationDescriptor

    public void testApplicationAssembler()
        throws AssemblyException
    {
        Energy4Java is = new Energy4Java();

        ApplicationDescriptor model = is.newApplicationModel( new ApplicationAssembler()
        {
            @Override
            public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory )
                throws AssemblyException
            {
                ApplicationAssembly assembly = applicationFactory.newApplicationAssembly();

                LayerAssembly layer1 = assembly.layer( "Layer1" );

                ModuleAssembly module = layer1.module( "Module1" );

                module.services( TestService.class );

                module.entities( TestEntity.class );

                layer1.services( AssemblySpecifications.types( TestService.class ) ).instantiateOnStartup();

                layer1.services( Specifications.<Object>TRUE() ).visibleIn( Visibility.layer );

                layer1.entities( Specifications.<Object>TRUE() ).visibleIn( Visibility.application );

                return assembly;
            }
        } );

        model.accept( new HierarchicalVisitorAdapter<Object, Object, RuntimeException>()
        {
            @Override
            public boolean visitEnter( Object visited )
                throws RuntimeException
            {
                if( visited instanceof ServiceDescriptor )
                {
                    ServiceDescriptor serviceDescriptor = (ServiceDescriptor) visited;
                    Assert.assertTrue( serviceDescriptor.isInstantiateOnStartup() );
                    Assert.assertTrue( serviceDescriptor.visibility() == Visibility.layer );
                    return false;
                }
                else if( visited instanceof EntityDescriptor )
                {
                    EntityDescriptor entityDescriptor = (EntityDescriptor) visited;
                    Assert.assertTrue( entityDescriptor.visibility() == Visibility.application );
                    return false;
                }

                return true;
            }
        } );
        model.newInstance( is.spi() );
    }
View Full Code Here

Examples of org.qi4j.api.structure.ApplicationDescriptor

     */
    public Application newApplication()
        throws AssemblyException, ActivationException
    {
        Energy4Java qi4j = new Energy4Java();
        ApplicationDescriptor model = qi4j.newApplicationModel( new ApplicationAssembler()
        {
            @Override
            public ApplicationAssembly assemble( ApplicationAssemblyFactory factory )
                throws AssemblyException
            {
                ApplicationAssembly assembly = factory.newApplicationAssembly();
                assembly.setName( applicationName );
                HashMap<String, LayerAssembly> createdLayers = new HashMap<>();
                for( Map.Entry<String, LayerDeclaration> entry : layers.entrySet() )
                {
                    LayerAssembly layer = entry.getValue().createLayer( assembly );
                    createdLayers.put( entry.getKey(), layer );
                }
                for( LayerDeclaration layer : layers.values() )
                {
                    layer.initialize( createdLayers );
                }
                return assembly;
            }
        } );
        Application application = model.newInstance( qi4j.api() );
        for( ActivationEventListener activationListener : activationListeners )
        {
            application.registerActivationEventListener( activationListener );
        }
        beforeActivation();
View Full Code Here

Examples of org.qi4j.api.structure.ApplicationDescriptor

    public static void main( String[] args )
        throws Exception
    {
        Energy4Java qi4j = new Energy4Java();
        Assembler assembler = new Assembler();
        ApplicationDescriptor applicationModel = qi4j.newApplicationModel( assembler );
        applicationModel.newInstance( qi4j.spi() );

        /*
       * The Envisage Swing app visualizes the application assemblage structure.
       *
       * Tree view:
View Full Code Here

Examples of org.qi4j.api.structure.ApplicationDescriptor

    public static void main( String[] args )
        throws Exception
    {
        Energy4Java energy4Java = new Energy4Java();

        ApplicationDescriptor applicationModel
                              = energy4Java.newApplicationModel( new SchoolAssembler() );

        new Envisage().run( applicationModel );
    }
View Full Code Here

Examples of org.qi4j.api.structure.ApplicationDescriptor

        Class applicationAssemblerClass = Class.forName( applicationAssemblerName );
        ApplicationAssembler assembler = (ApplicationAssembler) applicationAssemblerClass.newInstance();

        Energy4Java energy4Java = new Energy4Java();

        ApplicationDescriptor application = energy4Java.newApplicationModel( assembler );

        new Envisage().run( application );
    }
View Full Code Here

Examples of org.qi4j.api.structure.ApplicationDescriptor

    public static void main( String[] args )
        throws Exception
    {
        qi4j = new Energy4Java();
        ApplicationDescriptor model = qi4j.newApplicationModel( new ApplicationAssembler()
        {
            @Override
            public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory )
                throws AssemblyException
            {
                return createAssembly( applicationFactory );
            }
        } );
        Application application = model.newInstance( qi4j.spi() );
    }
View Full Code Here

Examples of org.qi4j.api.structure.ApplicationDescriptor

                        Node node = document.createElement( "mapping" );
                        current.push( node );
                    }
                    else if( visited instanceof ApplicationDescriptor )
                    {
                        ApplicationDescriptor applicationDescriptor = (ApplicationDescriptor) visited;
                        Node application = document.createElement( "application" );

                        addAttribute( "name", applicationDescriptor.name(), application );

                        current.push( application );
                    }
                    else if( visited instanceof LayerDescriptor )
                    {
View Full Code Here

Examples of org.springframework.richclient.application.ApplicationDescriptor

         */
        protected JComponent createApplicationDescriptorComponent() {
            // Build the application descriptor data, if available
            JTextArea txtDescriptor = getComponentFactory().createTextAreaAsLabel();
            txtDescriptor.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 0));
            ApplicationDescriptor appDesc = Application.instance().getDescriptor();
            if( appDesc != null ) {
                String displayName = appDesc.getDisplayName();
                String caption = appDesc.getCaption();
                String description = appDesc.getDescription();
                String version = appDesc.getVersion();
                String buildId = appDesc.getBuildId();
                StringBuffer sb = new StringBuffer();

                if( StringUtils.hasText(displayName) ) {
                    sb.append(displayName).append("\n");
                }
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.