Examples of AcrossModule


Examples of com.foreach.across.core.AcrossModule

  }

  private void applyEnabledInfrastructureModules() {
    for ( Map.Entry<AcrossModule, AcrossModuleRole> moduleRole : moduleRoles.entrySet() ) {
      if ( moduleRole.getValue() == AcrossModuleRole.INFRASTRUCTURE ) {
        AcrossModule infrastructure = moduleRole.getKey();

        if ( infrastructure.isEnabled() ) {
          // Infrastructure modules are added as required dependencies to all non-infrastructure modules
          // Indirect dependencies
          for ( Map.Entry<AcrossModule, AcrossModuleRole> targetModuleRole : moduleRoles.entrySet() ) {
            AcrossModule target = targetModuleRole.getKey();

            if ( targetModuleRole
                .getValue() != AcrossModuleRole.INFRASTRUCTURE && !appliedRequiredDependencies.get(
                infrastructure ).contains( target ) ) {
              appliedRequiredDependencies.get( targetModuleRole.getKey() ).add( moduleRole.getKey() );
View Full Code Here

Examples of com.foreach.across.core.AcrossModule

  private void applyEnabledPostProcessorModules() {
    // Post processor modules have all non post-processor enabled modules as required dependencies
    for ( Map.Entry<AcrossModule, AcrossModuleRole> moduleRole : moduleRoles.entrySet() ) {
      if ( moduleRole.getValue() == AcrossModuleRole.POSTPROCESSOR ) {
        AcrossModule postProcessor = moduleRole.getKey();

        if ( postProcessor.isEnabled() ) {
          for ( Map.Entry<AcrossModule, AcrossModuleRole> targetModuleRole : moduleRoles.entrySet() ) {
            AcrossModule target = targetModuleRole.getKey();

            if ( targetModuleRole.getValue() != AcrossModuleRole.POSTPROCESSOR ) {
              if ( appliedRequiredDependencies.get( target ).contains( postProcessor ) ) {
                LOG.debug(
                    "Ignoring {} as required dependency for {} since the former is a postprocessor module",
                    postProcessor.getName(), target.getName() );
                appliedRequiredDependencies.get( target ).remove( postProcessor );
              }
              if ( appliedOptionalDependencies.get( target ).contains( postProcessor ) ) {
                LOG.debug(
                    "Ignoring {} as optional dependency for {} since the former is a postprocessor module",
                    postProcessor.getName(), target.getName() );
                appliedOptionalDependencies.get( target ).remove( postProcessor );
              }

              // Add the target as a required dependency for the post-processor
              appliedRequiredDependencies.get( postProcessor ).add( target );
View Full Code Here

Examples of com.foreach.across.core.AcrossModule

    Set<AcrossModule> handled = new HashSet<AcrossModule>();

    Iterator<AcrossModule> iterator = ordered.iterator();

    while ( iterator.hasNext() ) {
      AcrossModule module = iterator.next();

      // Remove module if already handled
      if ( handled.contains( module ) ) {
        iterator.remove();
      }
      else {
        handled.add( module );

        LOG.trace( "Verifying module: {}", module.getName() );

        // Required dependencies should have already been handled
        for ( AcrossModule dependency : appliedRequiredDependencies.get( module ) ) {
          if ( !handled.contains( dependency ) ) {
            throw new CyclicModuleDependencyException( dependency.getName() );
View Full Code Here

Examples of com.foreach.across.core.AcrossModule

  public void destroyAcrossContextDirectly() {
    AcrossContext across = new AcrossContext();
    across.setInstallerAction( InstallerAction.DISABLED );
    across.setDataSource( mock( DataSource.class ) );

    AcrossModule moduleOne = new EmptyAcrossModule( "moduleOne" );
    moduleOne.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    AcrossModule moduleTwo = new EmptyAcrossModule( "moduleTwo" );
    moduleTwo.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    across.addModule( moduleOne );
    across.addModule( moduleTwo );

    across.bootstrap();
View Full Code Here

Examples of com.foreach.across.core.AcrossModule

    AcrossContext across = new AcrossContext( parent );
    across.setInstallerAction( InstallerAction.DISABLED );
    across.setDataSource( mock( DataSource.class ) );

    AcrossModule moduleOne = new EmptyAcrossModule( "moduleOne" );
    moduleOne.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    AcrossModule moduleTwo = new EmptyAcrossModule( "moduleTwo" );
    moduleTwo.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    across.addModule( moduleOne );
    across.addModule( moduleTwo );

    across.bootstrap();
View Full Code Here

Examples of com.foreach.across.core.AcrossModule

    across.setDataSource( mock( DataSource.class ) );

    // AcrossContext configuration is bean in the parent and should be destroyed
    ( (DefaultListableBeanFactory) parent.getBeanFactory() ).registerDisposableBean( "acrossContext", across );

    AcrossModule moduleOne = new EmptyAcrossModule( "moduleOne" );
    moduleOne.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    AcrossModule moduleTwo = new EmptyAcrossModule( "moduleTwo" );
    moduleTwo.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    across.addModule( moduleOne );
    across.addModule( moduleTwo );

    across.bootstrap();
View Full Code Here

Examples of com.foreach.across.core.AcrossModule

   */
  private void createBootstrapConfiguration( ConfigurableAcrossContextInfo contextInfo ) {
    List<ModuleBootstrapConfig> configs = new LinkedList<>();

    for ( AcrossModuleInfo moduleInfo : contextInfo.getModules() ) {
      AcrossModule module = moduleInfo.getModule();
      ModuleBootstrapConfig config = new ModuleBootstrapConfig( module, moduleInfo.getIndex() );
      config.setExposeFilter( module.getExposeFilter() );
      config.setExposeTransformer( module.getExposeTransformer() );
      config.setInstallerSettings( module.getInstallerSettings() );
      config.getInstallers().addAll( Arrays.asList( module.getInstallers() ) );

      // Provide the current module beans
      Map<String, Object> providedSingletons = new HashMap<>();
      providedSingletons.put( AcrossModule.CURRENT_MODULE + "Info",
                              new PrimarySingletonBean(
View Full Code Here

Examples of com.foreach.across.core.AcrossModule

      context.addModule( new AcrossWebModule() );
      context.addModule( testModule() );
    }

    private AcrossModule testModule() {
      AcrossModule module = new EmptyAcrossModule( "TestModule" );
      module.addApplicationContextConfigurer( ComponentConfig.class );

      return module;
    }
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.