Called by BeanContextSupport superclass during construction and deserialization to
initialize subclass transient state
10326
public void initialize()
    {
        super.initialize();

        //
        // Register the ServletService classes associated with the ServletServiceProvider
        //
        ServletServiceProvider ssp = ServletServiceProvider.getProvider();
        addService(ServletContext.class, ssp);
        addService(ServletRequest.class, ssp);
        addService(ServletResponse.class, ssp);
        addService(HttpServletRequest.class, ssp);
        addService(HttpServletResponse.class, ssp);

        //
        // Register an *internal* service that is used to create ControlBeanContext objects for
        // children of this control container
        //
        _bcsp = WebContextFactoryProvider.getProvider();
        addService(ControlBeanContextFactory.class, _bcsp);
    }
500347
@Override
    public void contextInitialized(ServletContextEvent event) {
        // Uncomment the next line to enable the default hotspot events.
        // DefaultExports.initialize();

        metrics = new Metrics();
        ServletContext context = event.getServletContext();
        context.addServlet("Metrics", new MetricsServlet()).addMapping("");
    }
48249
private synchronized void initialize() {

    if (this.runtimes != null) {
      return;
    }

    this.runtimes = new HashMap<>();

    for (final AvroRuntimeDefinition rd : runtimeDefinition.getRuntimes()) {
      try {

        // We need to create different injector for each runtime as they define conflicting bindings. Also we cannot
        // fork the original injector because of the same reason.
        // We create new injectors and copy form the original injector what we need.
        // rootInjector is an emptyInjector that we copy bindings from the original injector into. Then we fork
        // it to instantiate the actual runtime.
        final Injector rootInjector = Tang.Factory.getTang().newInjector();
        initializeInjector(rootInjector);

        final Configuration runtimeConfig =
            Tang.Factory.getTang().newConfigurationBuilder()
                .bindNamedParameter(RuntimeName.class, rd.getRuntimeName().toString())
                .bindImplementation(Runtime.class, RuntimeImpl.class)
                .build();

        final Configuration config =
            new AvroConfigurationSerializer().fromString(rd.getSerializedConfiguration().toString());

        final Injector runtimeInjector = rootInjector.forkInjector(config, runtimeConfig);

        this.runtimes.put(rd.getRuntimeName().toString(), runtimeInjector.getInstance(Runtime.class));

      } catch (final IOException | InjectionException e) {
        throw new RuntimeException("Unable to initialize runtimes.", e);
      }
    }
  }
663794
@SuppressWarnings("unchecked")
	private final void instantiateDeserializationUtils() {
		if (this.serializers == null) {
			this.serializers = new TypeSerializer[this.serializerFactories.length];
			for (int i = 0; i < this.serializers.length; i++) {
				this.serializers[i] = this.serializerFactories[i].getSerializer();
			}
		}
		
		this.deserializedFields1 = new Object[this.serializers.length];
		this.deserializedFields2 = new Object[this.serializers.length];
		
		for (int i = 0; i < this.serializers.length; i++) {
			this.deserializedFields1[i] = this.serializers[i].createInstance();
			this.deserializedFields2[i] = this.serializers[i].createInstance();
		}
	}
980738
@Override
	public void contextInitialized(ServletContextEvent sce) {
		Gig.bootstrap(sce.getServletContext());
		Jaguar.assemble(this);
	}
725508
@PostConstruct
  public void initialize() {

    if (this.pojoDescriptorBuilderFactory == null) {
      this.pojoDescriptorBuilderFactory = PojoDescriptorBuilderFactoryImpl.getInstance();
    }
    if (this.pojoDescriptorBuilder == null) {
      this.pojoDescriptorBuilder = this.pojoDescriptorBuilderFactory.createPrivateFieldDescriptorBuilder();
    }
    this.descriptor = this.pojoDescriptorBuilder.getDescriptor(EntityTo.class);
  }
585518
protected ApplicationContext initializeContext() {
        Function<Class<Object>, List<Object>> getBeans = this::getBeans;

        BeanFactory beanFactory = new BeanFactory(getBeans);
        InitContext context = new InitContext();

        AutoConfigurer.configureInitializers()
            .forEach(initializer -> initializer.init(context, beanFactory));

        List<AbstractReaderWriter> readersWriters = AutoConfigurer.configureReadersWriters();

        ExceptionHandlerInterceptor exceptionHandlerInterceptor = new ExceptionHandlerInterceptor();
        COMMON_INTERCEPTORS.add(exceptionHandlerInterceptor);
        Map<Boolean, List<Reader>> readers = createTransformers(
            concat(beanFactory.getAll(Reader.class), context.getReaders(), readersWriters));
        Map<Boolean, List<Writer>> writers = createTransformers(
            concat(beanFactory.getAll(Writer.class), context.getWriters(), readersWriters));
        List<Interceptor> interceptors = sort(
            concat(beanFactory.getAll(Interceptor.class), context.getInterceptors(), COMMON_INTERCEPTORS));
        List<ExceptionConfiguration> handlers =
            concat(beanFactory.getAll(ExceptionConfiguration.class), context.getExceptionConfigurations(), COMMON_HANDLERS);
        List<ControllerConfiguration> controllers =
            concat(beanFactory.getAll(ControllerConfiguration.class), context.getControllerConfigurations());

        orderDuplicationCheck(interceptors);

        Map<Class<? extends Exception>, InternalExceptionHandler> handlerMap =
            handlers.stream()
                .peek(ExceptionConfiguration::initialize)
                .flatMap(config -> config.getExceptionHandlers().stream())
                .peek(handler -> {
                    populateHandlerWriters(writers, handler, nonNull(handler.getResponseType()));
                    logExceptionHandler(handler);
                })
                .collect(toMap(InternalExceptionHandler::getExceptionClass, identity()));
        context.setExceptionHandlers(handlerMap);

        controllers.stream()
            .peek(ControllerConfiguration::initialize)
            .flatMap(config -> config.getRoutes().stream())
            .peek(route -> {
                route.interceptor(interceptors.toArray(new Interceptor[interceptors.size()]));
                populateRouteReaders(readers, route);
                populateRouteWriters(writers, route);
                logRoute(route);
            }).forEach(context::addRoute);

        ApplicationContextImpl applicationContext = new ApplicationContextImpl();
        applicationContext.setRoutes(context.getRoutes());
        applicationContext.setExceptionHandlers(context.getExceptionHandlers());

        exceptionHandlerInterceptor.setApplicationContext(applicationContext);
        return applicationContext;
    }
380119
private void instantiateSingletons() {
        if (log.isDebugEnabled()) {
            log.debug("Initializing singletons in " + this);
        }

        Activity activity = context.getDefaultActivity();
        for (BeanRule beanRule : beanRuleRegistry.getIdBasedBeanRules()) {
            instantiateSingleton(beanRule, activity);
        }
        for (Set<BeanRule> beanRuleSet : beanRuleRegistry.getTypeBasedBeanRules()) {
            for (BeanRule beanRule : beanRuleSet) {
                instantiateSingleton(beanRule, activity);
            }
        }
        for (BeanRule beanRule : beanRuleRegistry.getConfigurableBeanRules()) {
            instantiateSingleton(beanRule, activity);
        }
    }
889535
public void init(final SerializedDataTypeRegistry typeRegistry, final DeserializerRegistry deserRegistry,
            final SerializerRegistry serRegistry) {
        if (initialized) {
            throw new IllegalStateException("Instance already initialized - Don't call the init methods more than once");
        }
        this.typeRegistry = typeRegistry;
        for (final JsonbDeserializer<?> deserializer : deserializers) {
            if (deserializer instanceof DeserializerRegistryRequired) {
                if (deserRegistry == null) {
                    throw new IllegalStateException(
                            "There is at least one deserializer that requires a 'DeserializerRegistry', but you didn't provide one (deserializer="
                                    + deserializer.getClass().getName() + ")");
                }
                final DeserializerRegistryRequired des = (DeserializerRegistryRequired) deserializer;
                des.setRegistry(deserRegistry);
            }
            if (deserializer instanceof SerializedDataTypeRegistryRequired) {
                if (typeRegistry == null) {
                    throw new IllegalStateException(
                            "There is at least one deserializer that requires a 'SerializedDataTypeRegistry', but you didn't provide one (deserializer="
                                    + deserializer.getClass().getName() + ")");
                }
                final SerializedDataTypeRegistryRequired des = (SerializedDataTypeRegistryRequired) deserializer;
                des.setRegistry(typeRegistry);
            }
        }
        for (final JsonbSerializer<?> serializer : serializers) {
            if (serializer instanceof SerializerRegistryRequired) {
                if (serRegistry == null) {
                    throw new IllegalStateException(
                            "There is at least one serializer that requires a 'SerializerRegistry', but you didn't provide one (serializer="
                                    + serializer.getClass().getName() + ")");
                }
                final SerializerRegistryRequired ser = (SerializerRegistryRequired) serializer;
                ser.setRegistry(serRegistry);
            }
            if (serializer instanceof SerializedDataTypeRegistryRequired) {
                if (typeRegistry == null) {
                    throw new IllegalStateException(
                            "There is at least one serializer that requires a 'SerializedDataTypeRegistry', but you didn't provide one (serializer="
                                    + serializer.getClass().getName() + ")");
                }
                final SerializedDataTypeRegistryRequired ser = (SerializedDataTypeRegistryRequired) serializer;
                ser.setRegistry(typeRegistry);
            }
        }
        initialized = true;
    }
440551
@Override
  public void contextInitialized(ServletContextEvent servletContextEvent) {
    otherListeners.addAll(getDefaultOtherListeners());

    contextInitialized(servletContextEvent.getServletContext());

    for(ServletContextListener listener : otherListeners) {
      try {
        listener.contextInitialized(servletContextEvent);
      }
      catch(Exception e){
        classLoaderLeakPreventor.error(e);
      }
    }
  }
26233
@Override
  public List<ConfigIssue> init(Service.Context context) {
    this.context = context;
    return init();
  }
601914
@Override
	public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {
		if (bean instanceof Properties && bean != getPrefixedProperties() && getProcessOtherProperties()) {
			final Properties props = (Properties) bean;
			final PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper(placeholderPrefix, placeholderSuffix,
					valueSeparator, ignoreUnresolvablePlaceholders);
			final PrefixedProperties clone = getPrefixedProperties().clone();
			clone.putAll(props);
			final Properties beanProperty = (Properties) bean;
			for (final Object key : beanProperty.keySet()) {
				if (key instanceof String) {
					final String stringKey = (String) key;
					props.setProperty(stringKey,
							helper.replacePlaceholders(beanProperty.getProperty(stringKey), clone));
				}
			}
		}
		return bean;
	}
893813
public static void initialize(Object androidContext) throws AndroidException {
		assert androidContext != null;
		try {
			final Class<?> contextType = androidContext.getClass();
			final Class<?> contextClass = getContextClass();
			if (!contextClass.isAssignableFrom(contextType)) {
				throw new AndroidException(Locale.getString("E1", androidContext)); //$NON-NLS-1$
			}
			synchronized (Android.class) {
				contextResolver = null;
				context = new SoftReference<>(androidContext);
			}
		} catch (AssertionError e) {
			throw e;
		} catch (Throwable e) {
			throw new AndroidException(e);
		}
		ClassLoaderFinder.setPreferredClassLoader(getContextClassLoader());
	}
1328904
private void init(){
	
		if(!Annotation.isInheritedMapped(configuredClass))
			Error.classNotMapped(configuredClass);
		
		for (Class<?> classe :getClasses()){
			relationalManyToOneMapper.put(classe.getName(), new JMapper(configuredClass, classe,ChooseConfig.DESTINATION));
			relationalOneToManyMapper.put(classe.getName(), new JMapper(classe, configuredClass,ChooseConfig.SOURCE));
		}
	}
1173920
@Override
    public void initialize(BeanContext context) {
        Resource resource = ConsoleUtil.getConsoleResource(context);
        initialize(context, ResourceHandle.use(resource));
    }
276565
@Override
    protected void init() throws Exception {
        BootstrapContextImpl bootstrapContext = bootstrapContextRef.getServiceWithException();

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "loading", mcfImplClassName);
        if (mcfImplClassName == null) // TODO: get the real config element name of the nested properties
            throw new IllegalArgumentException(Utils.getMessage("J2CA8504.incorrect.props.list", "properties", configElementName, id));
        mcf = (ManagedConnectionFactory) bootstrapContext.loadClass(mcfImplClassName).newInstance();
        bootstrapContext.configure(mcf, jndiName, properties, null, null, null);

        if (connectionManagerRef == null)
            conMgrSvc = ConnectionManagerService.createDefaultService(jndiName);
        else
            conMgrSvc = (ConnectionManagerService) priv.locateService(componentContext, CONNECTION_MANAGER);
        conMgrSvc.addObserver(this);
        isInitialized.set(true);

        conMgrSvc.addRaClassLoader(bootstrapContext.getRaClassLoader());
    }
589607
public void initialized(AppContextWrapper context) {
		ContainerRegistryBuilder cb = (ContainerRegistryBuilder) context.getAttribute(ContainerRegistryBuilder.APPLICATION_CONTEXT_ATTRIBUTE_NAME);
		if (cb != null)
			return;
		try {
			synchronized (context) {
				cb = containerBuilderContext.createContainerBuilder(context);
				context.setAttribute(ContainerRegistryBuilder.APPLICATION_CONTEXT_ATTRIBUTE_NAME, cb);
				Debug.logVerbose("[JdonFramework] Initialize the container OK ..");
			}
		} catch (Exception e) {
			Debug.logError("[JdonFramework] initialized error: " + e, module);
		}
	}