[ 
https://issues.apache.org/jira/browse/ISIS-1192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-1192:
------------------------------

notes on how the bootstrapping currently works:

IsisWicketApplication

    @Override
    protected void init() {
        try {
            super.init();
            final IsisInjectModule isisModule = newIsisModule(deploymentType, 
isisConfigurationBuilder);
            ...
            injector.injectMembers(this);

            
            
    protected IsisInjectModule newIsisModule(final DeploymentType 
deploymentType, final IsisConfigurationBuilder isisConfigurationBuilder) {
        return new IsisInjectModule(deploymentType, isisConfigurationBuilder);
    }

    public IsisInjectModule(final DeploymentType deploymentType, final 
IsisConfigurationBuilder isisConfigurationBuilder) {
        this(deploymentType, isisConfigurationBuilder, 
defaultInstallerLookup());
    }

    public IsisInjectModule(final DeploymentType deploymentType, final 
IsisConfigurationBuilder isisConfigurationBuilder, final InstallerLookup 
installerLookup) {
        this.installerLookup = installerLookup;
        this.isisConfigurationBuilder = isisConfigurationBuilder;
        this.deploymentType = deploymentType;
    }

    

    @SuppressWarnings("unused")
    @Provides
    @Inject
    @Singleton
    private IsisSystemFactory provideIsisSystemFactory(final InstallerLookup 
installerLookup) {
        final IsisSystemThatUsesInstallersFactory systemFactory = new 
IsisSystemThatUsesInstallersFactory(installerLookup);
        systemFactory.init();
        return systemFactory;
    }

    @Provides
    @Inject
    @Singleton
    protected IsisSystem provideIsisSystem(
            final DeploymentType deploymentType,
            final IsisSystemFactory systemFactory,
            final AppManifest appManifestIfAny) {
        final IsisSystem system = systemFactory.createSystem(deploymentType, 
appManifestIfAny);
        system.init();
        return system;
    }

    
    IsisSystem

    public void init() {

        if (initialized) {
            throw new IllegalStateException("Already initialized");
        } else {
            initialized = true;
        }

        LOG.info("initialising Isis System");
        LOG.info("working directory: " + new File(".").getAbsolutePath());
        LOG.info("resource stream source: " + 
getConfiguration().getResourceStreamSource());

        localeInitializer.initLocale(getConfiguration());
        timeZoneInitializer.initTimeZone(getConfiguration());

        try {
            sessionFactory = createSessionFactory(deploymentType);

            // temporarily make a configuration available
            // REVIEW: would rather inject this, or perhaps even the
            // ConfigurationBuilder
            IsisContext.setConfiguration(getConfiguration());

            initContext(sessionFactory);                    
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  THIS IS WHERE IsisContextThreadLocal is set 
up...
            sessionFactory.init();

            // validate here after all entities have been registered in the 
persistence session factory
            final SpecificationLoaderSpi specificationLoader = 
sessionFactory.getSpecificationLoader();
            specificationLoader.validateAndAssert();

            serviceInitializer = initializeServices();

            installFixturesIfRequired();

            translateServicesAndEnumConstants();

        } catch (final IsisSystemException ex) {
            LOG.error("failed to initialise", ex);
            throw new RuntimeException(ex);
        }
    }

  

public IsisSystem(IsisComponentProvider isisComponentProvider) {


> Use CDI to wire up Isis components.
> -----------------------------------
>
>                 Key: ISIS-1192
>                 URL: https://issues.apache.org/jira/browse/ISIS-1192
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.9.0
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>             Fix For: 1.12.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to