/*
(non-Javadoc)

@see org.springframework.scheduling.config.ContextLifecycleScheduledTaskRegistrar#
afterPropertiesSet()
495484
@Override
	public void afterPropertiesSet() {

		for (final RemoteResource resource : this.discoveredResources) {
			addFixedDelayTask(new IntervalTask(new Runnable() {

				@Override
				public void run() {
					resource.verifyOrDiscover();
				}
			}, this.fixedDelay, this.initialDelay));
		}

		super.afterPropertiesSet();
	}
57341
public void afterPropertiesSet() throws Exception {
        if (loginService == null) {
            loginService = new SimpleLoginService();
            ((SimpleLoginService) loginService).setName(realm);
        }
    }
299124
@Override
    public void afterInitialized(BaseComponent comp) {
        super.afterInitialized(comp);
        propertyGrid = PropertyGrid.create(null, comp, true);
        getPlugin().registerProperties(this, "provider", "group");
    }
443787
private static void setProperties(GenericApplicationContext newContext, Properties properties) {
        PropertiesPropertySource pps = new PropertiesPropertySource("external-props", properties);
        newContext.getEnvironment().getPropertySources().addFirst(pps);
    }
1063015
@Override
	public void afterPropertiesSet() {

		if (this.config.isUseGeneratorCache()) {

			CachedGenerator annotation = getClass().getAnnotation(CachedGenerator.class);
			if (annotation != null) {
				useCache = true;
				name = annotation.name();
				cacheMappingFileName = annotation.mappingFileName();
				cacheDirectory = annotation.cacheDirectory();
				if (!cacheDirectory.endsWith(URL_SEPARATOR)) {
					cacheDirectory = cacheDirectory + URL_SEPARATOR;
				}
				cacheMode = annotation.mode();

				loadCacheMapping();

				// reset cache if invalid
				if (!isCacheValid()) {

					if (LOGGER.isDebugEnabled()) {
						LOGGER.debug("Cache of " + getName() + " generator is invalid. Reset cache...");
					}
					resetCache();
				}
			}
		}
	}
849724
@Override
    public void afterProjectsRead(final MavenSession session) throws MavenExecutionException {
        boolean anyProject = false;
        for (MavenProject project : session.getProjects()) {
            if (project.getPlugin("ceylon") != null
            	|| project.getPlugin("ceylon-maven-plugin") != null
            	|| "ceylon".equals(project.getArtifact().getArtifactHandler().getPackaging())
                || "car".equals(project.getArtifact().getArtifactHandler().getPackaging())
                || "ceylon-jar".equals(project.getArtifact().getArtifactHandler().getPackaging())
                || usesCeylonRepo(project)) {
            	anyProject = true;
            }
        }
        if (anyProject) {
        	logger.info("At least one project is using the Ceylon plugin. Preparing.");
        	findCeylonRepo(session);
        }
        logger.info("Adding Ceylon repositories to build");
        session.getRequest().setWorkspaceReader(
        		new CeylonWorkspaceReader(
        				session.getRequest().getWorkspaceReader(),
        				logger));
    }
253666
public final ConfigChanges updated(Collection<Bean> after) {
        ConfigChanges changes = new ConfigChanges();
        for (Bean bean : after) {
            Optional<Bean> optional = beanManager.getEager(bean.getId());
            if (!optional.isPresent()) {
                throw Events.CFG304_BEAN_DOESNT_EXIST(bean.getId());
            }
            Bean before = optional.get();
            schemaManager.setSchema(Arrays.asList(before));
            changes.add(ConfigChange.updated(before, bean));
        }
        return changes;
    }
766712
@Override
    public void addProperties(Map<Object, Object> properties) {
        if (properties == null) return;
        lazyProperties().putAll(properties);
        notifyChanged();
    }
36782
@Override
    public void afterCompletion(int status) {
        if (status == Status.STATUS_COMMITTED) {
            Boolean previous = persistentExecutor.inMemoryTaskIds.put(taskId, Boolean.TRUE);
            if (previous == null) {
                long delay = expectedExecTime - new Date().getTime();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "Schedule " + taskId + " for " + delay + "ms from now");
                persistentExecutor.scheduledExecutor.schedule(this, delay, TimeUnit.MILLISECONDS);
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "Found task " + taskId + " already scheduled");
            }
        }
    }
1204844
protected void activate(ComponentContext context, Map<String, Object> props) {
        configurationProperties = new HashMap<String, Object>(props);

        Object scheduleInvalidationFirstHour = configurationProperties.get("scheduleInvalidationFirstHour");
        Object scheduleInvalidationSecondHour = configurationProperties.get("scheduleInvalidationSecondHour");
        Object writeContents = configurationProperties.get("writeContents");
        Object writeFrequency = configurationProperties.get("writeFrequency");

        // httpSessionCache writeContents accepts ONLY_SET_ATTRIBUTES in place of ONLY_UPDATED_ATTRIBUTES to better reflect the behavior provided
        if (writeContents == null || "ONLY_SET_ATTRIBUTES".equals(writeContents))
            configurationProperties.put("writeContents", "ONLY_UPDATED_ATTRIBUTES");

        // default/disallow advanced properties from httpSessionDatabase
        configurationProperties.put("noAffinitySwitchBack", "TIME_BASED_WRITE".equals(writeFrequency));
        configurationProperties.put("onlyCheckInCacheDuringPreInvoke", false);
        configurationProperties.put("optimizeCacheIdIncrements", true);
        configurationProperties.put("scheduleInvalidation", scheduleInvalidationFirstHour != null || scheduleInvalidationSecondHour != null);
        configurationProperties.put("sessionPersistenceMode", "JCACHE");
        configurationProperties.put("useInvalidatedId", false);
        configurationProperties.put("useMultiRowSchema", true);
    }
727730
@Override
    public void onXml(ClientProperties cp)
    {
        hsmd.onInitialize();
        if (cp != null)
        {
            hsmd.setClientProperties(cp);
        }
    }
898325
public static <V> Predicate<TaskContext<V>> afterDelay(long time, TimeUnit timeUnit) {
        return ctx -> (System.currentTimeMillis() - ctx.getStartTime()) >= timeUnit.toMillis(time);
    }
239305
@Override
	public void afterPropertiesSet() {

		super.afterPropertiesSet();

		boolean fallbackToSystemLocale = config.getBooleanProperty(
				JawrConstant.JAWR_LOCALE_GENERATOR_FALLBACK_TO_SYSTEM_LOCALE, DEFAULT_FALLBACK_TO_SYSTEM_LOCALE);

		String charsetName = config.getProperty(JawrConstant.JAWR_LOCALE_GENERATOR_RESOURCE_BUNDLE_CHARSET,
				DEFAULT_RESOURCE_BUNDLE_CHARSET);

		Charset charset = Charset.forName(charsetName);

		control = new MessageBundleControl(fallbackToSystemLocale, charset);
	}
641678
public void executeAfterMethods(final Object obj) {

        // Invoke element only if not parameterized
        if (this.element.getDataProvider() == null) {
            int runs = RUNS.get(element);
            runs--;
            RUNS.put(element, runs);

            // invoking once the beforeFirstRun-method
            if (RUNS.get(element) == 0) {
                Method[] afterLast = null;
                try {
                    afterLast = element.findAfterLastRun();
                    if (afterLast.length != 0) {
                        checkAndExecuteBeforeAfters(obj, AfterLastRun.class, afterLast);
                    }
                } catch (final PerfidixMethodCheckException e) {
                    BENCHRES.addException(e);
                }
            }

            // invoking the beforeEachRun-method
            Method[] afterEach = null;
            try {
                afterEach = element.findAfterEachRun();
            } catch (final PerfidixMethodCheckException e) {
                BENCHRES.addException(e);
            }
            if (afterEach != null) {
                checkAndExecuteBeforeAfters(obj, AfterEachRun.class, afterEach);
            }
        }
    }
746206
public static void after(String path, String acceptType, Filter... filters) {
        for (Filter filter : filters) {
            getInstance().after(path, acceptType, filter);
        }
    }
779913
public void setProperties(Map<String, Value> properties) {
        if (properties != null) {
            this.properties = new HashMap<>(properties);
        } else {
            this.properties = null;
        }
    }
787916
public void afterPropertiesSet() throws Exception {
		initParams = new HashMap<String, Object>(3);
		initParams.put("type", type);
		initParams.put("configPropertiesSourceClass",
				configPropertiesSourceClass);
		initParams.put("configLocation", configLocation);

		if (null == configuration && null == configLocation
				&& null == configPropertiesSourceClass)
			throw new ServletException(
					"Neither configuration nor configLocation nor configPropertiesSourceClass init params were set."
							+ " You must set at least the configuration or the configLocation param or the configPropertiesSourceClass. Please check your web.xml file");

		String fullMapping = "";
		if (StringUtils.isNotEmpty(mapping))
			fullMapping = mapping;

		if (StringUtils.isNotEmpty(controllerMapping))
			fullMapping = PathNormalizer.joinPaths(fullMapping,
					controllerMapping);

		initParams.put(JawrConstant.SERVLET_MAPPING_PROPERTY_NAME, fullMapping);
		if (mapping != null) {
			initParams.put(JawrConstant.SPRING_SERVLET_MAPPING_PROPERTY_NAME,
					PathNormalizer.asDirPath(mapping));
		}

		if (LOGGER.isDebugEnabled())
			LOGGER.debug("Initializing Jawr Controller's JawrRequestHandler");

		if (JawrConstant.BINARY_TYPE.equals(type)) {
			requestHandler = new JawrBinaryResourceRequestHandler(context, initParams,
					configuration);
		} else {
			requestHandler = new JawrRequestHandler(context, initParams,
					configuration);
		}
	}