org.hotswap.agent.plugin.owb.beans.ContextualReloadHelper Maven / Gradle / Ivy
/*
* Copyright 2013-2024 the HotswapAgent authors.
*
* This file is part of HotswapAgent.
*
* HotswapAgent is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 2 of the License, or (at your
* option) any later version.
*
* HotswapAgent is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with HotswapAgent. If not, see http://www.gnu.org/licenses/.
*/
package org.hotswap.agent.plugin.owb.beans;
import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import org.apache.webbeans.component.ManagedBean;
import org.apache.webbeans.context.creational.CreationalContextImpl;
import org.hotswap.agent.logging.AgentLogger;
/**
* The Class ContextualReloadHelper.
*
* @author [email protected]
*/
public class ContextualReloadHelper {
private static AgentLogger LOGGER = AgentLogger.getLogger(ContextualReloadHelper.class);
public static void reload(OwbHotswapContext ctx) {
Set> beans = ctx.$$ha$getBeansToReloadOwb();
if (beans != null && !beans.isEmpty()) {
LOGGER.debug("Starting re-loading {} beans in context '{}'", beans.size(), ctx);
Iterator> it = beans.iterator();
while (it.hasNext()) {
Contextual
© 2015 - 2025 Weber Informatics LLC | Privacy Policy