Store the bundle

@param bundleId
the bundle Id to store
@param store
the bundle
503203
private void storeBundle(String bundleId, JoinableResourceBundleContent store) {

		stopProcessIfNeeded();

		if (bundleMustBeProcessedInLive(store.getContent().toString())) {
			liveProcessBundles.add(bundleId);
		}
		resourceBundleHandler.storeBundle(bundleId, store);
	}
138866
public void start(BundleContext context) throws Exception {
    	Util.getLogger().info("Starting Jdbc bundle");
        
        //xthis.setProperty(BundleActivatorModel.PACKAGE_NAME, Util.getPackageName(JdbcDatabase.class.getName()));
        //x this.setProperty(BundleService.INTERFACE, BaseDatabase.class.getName());
        this.setProperty(BundleConstants.TYPE, DBParams.JDBC);
        
        super.start(context);
    }
379225
@Activate
    public void startUp(BundleContext bundleContext) {
        extendedBundleContext = new ExtendedBundle.ExtendedBundleContext(bundleContext);
        bundleContext.addBundleListener(this);
    }
1089684
public Bundler putIntegerArrayList(String key, ArrayList<Integer> value) {
    bundle.putIntegerArrayList(key, value);
    return this;
  }
982307
private void addToCache(BundleInfo bInfo) {
        List<Resource> info = _cacheBySymbolicName.get(bInfo.symbolicName);
        if (info == null) {
            info = new ArrayList<Resource>();
            info.add(bInfo);
        }

        info = _cacheBySymbolicName.putIfAbsent(bInfo.symbolicName, info);

        if (info != null) {
            synchronized (info) {
                info.add(bInfo);
            }
        }

        _bundleLocations.add(bInfo.file);
    }
925615
public function addBundle(Bundle $bundle)
    {
        foreach ($bundle as $resource) {
            if (is_string($resource)) {
                $this->addFile($resource);
            } else {
                $this->buildFromIterator($resource);
            }
        }
    }
952595
@Override
    public void put(Store store) {
        LOGGER.debug("Setting [{}] as the store in use.", store);
        currentRequestFlashMap().put(this.parameterName, store);
    }
741938
public void loadPropertiesBundle(final String bundleName,
			final Locale locale) {
		LOG.info("Loading properties bundle: " + bundleName);
		ResourceBundle bundle = ResourceBundle.getBundle(bundleName, locale);
		bundles.put(bundleName, bundle);
	}
471624
public static void putExpirationDate(Bundle bundle, Date value) {
        Validate.notNull(bundle, "bundle");
        Validate.notNull(value, "value");
        putDate(bundle, EXPIRATION_DATE_KEY, value);
    }
1019142
private static void addBundle(final Object bundleWiring, final ClassLoader classLoader,
            final ClasspathOrder classpathOrderOut, final Set<Object> bundles, final ScanSpec scanSpec,
            final LogNode log) {
        // Track the bundles we've processed to prevent loops
        bundles.add(bundleWiring);

        // Get the revision for this wiring
        final Object revision = ReflectionUtils.invokeMethod(bundleWiring, "getRevision", false);
        // Get the contents
        final Object content = ReflectionUtils.invokeMethod(revision, "getContent", false);
        final String location = content != null ? getContentLocation(content) : null;
        if (location != null) {
            // Add the bundle object
            classpathOrderOut.addClasspathEntry(location, classLoader, scanSpec, log);

            // And any embedded content
            final List<?> embeddedContent = (List<?>) ReflectionUtils.invokeMethod(revision, "getContentPath",
                    false);
            if (embeddedContent != null) {
                for (final Object embedded : embeddedContent) {
                    if (embedded != content) {
                        final String embeddedLocation = embedded != null ? getContentLocation(embedded) : null;
                        if (embeddedLocation != null) {
                            classpathOrderOut.addClasspathEntry(embeddedLocation, classLoader, scanSpec, log);
                        }
                    }
                }
            }
        }
    }
185867
private ResourceBundleDefinition buildCustomBundleDefinition(String bundleName, boolean isChildBundle) {

		// Id for the bundle
		String bundleId = props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_ID);
		if (null == bundleId && !isChildBundle)
			throw new IllegalArgumentException(
					"No id defined for the bundle with name:" + bundleName + ". Please specify one in configuration. ");

		// Whether it's a composite or not
		boolean isComposite = Boolean
				.parseBoolean(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_COMPOSITE_FLAG, "false"));

		// Create definition and set its id
		ResourceBundleDefinition bundle = new ResourceBundleDefinition();
		bundle.setBundleId(bundleId);
		bundle.setBundleName(bundleName);
		bundle.setBundlePrefix(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_BUNDLE_PREFIX));

		// Whether it's global or not
		boolean isGlobal = Boolean
				.parseBoolean(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_GLOBAL_FLAG, "false"));
		bundle.setGlobal(isGlobal);

		// Set order if its a global bundle
		if (isGlobal) {
			int order = Integer.parseInt(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_ORDER, "0"));
			bundle.setInclusionOrder(order);
		}

		// Override bundle postprocessor
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_POSTPROCESSOR))
			bundle.setBundlePostProcessorKeys(
					props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_POSTPROCESSOR));

		// Override unitary postprocessor
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_FILE_POSTPROCESSOR))
			bundle.setUnitaryPostProcessorKeys(
					props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_FILE_POSTPROCESSOR));

		// Use only with debug mode on
		boolean isDebugOnly = Boolean
				.parseBoolean(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_DEBUGONLY, "false"));
		bundle.setDebugOnly(isDebugOnly);

		// Use only with debug mode off
		boolean isDebugNever = Boolean
				.parseBoolean(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_DEBUGNEVER, "false"));
		bundle.setDebugNever(isDebugNever);

		// Set conditional comment for IE, in case one is specified
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_IE_CONDITIONAL_EXPRESSION))
			bundle.setIeConditionalExpression(
					props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_IE_CONDITIONAL_EXPRESSION));

		// Sets the alternate URL for production mode.
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_PRODUCTION_ALT_URL))
			bundle.setAlternateProductionURL(
					props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_PRODUCTION_ALT_URL));

		boolean hasDebugURL = false;
		// Sets the debug URL for debug mode.
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_DEBUG_URL)) {
			bundle.setDebugURL(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_DEBUG_URL));
			hasDebugURL = true;
			if (StringUtils.isEmpty(bundle.getAlternateProductionURL())) {
				throw new IllegalArgumentException("The bundle '" + bundleName
						+ "', which use a static external resource in debug mode, must use an external resource in Production mode.\n"
						+ "Please check your configuration. ");
			}
			if (isComposite) {
				throw new IllegalArgumentException("The bundle '" + bundleName
						+ "', which use a static external resource in debug mode, can't be part of a composite bundle.\n"
						+ "Please check your configuration. ");
			}
			if (StringUtils.isNotEmpty(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_MAPPINGS))) {
				throw new IllegalArgumentException("The bundle '" + bundleName
						+ "', which use a static external resource in debug mode, can't have a bundle mapping.\n"
						+ "Please check your configuration. ");
			}
		}

		if (isComposite) {
			String childBundlesProperty = props.getCustomBundleProperty(bundleName,
					BUNDLE_FACTORY_CUSTOM_COMPOSITE_NAMES);
			if (null == childBundlesProperty)
				throw new IllegalArgumentException(
						"No child bundle names were defined for the composite bundle with name:" + bundleName
								+ ". Please specify at least one in configuration. ");

			bundle.setComposite(true);

			// add children
			List<ResourceBundleDefinition> children = new ArrayList<>();
			StringTokenizer tk = new StringTokenizer(childBundlesProperty, JawrConstant.COMMA_SEPARATOR);
			while (tk.hasMoreTokens()) {
				ResourceBundleDefinition childDef = buildCustomBundleDefinition(tk.nextToken().trim(), true);
				childDef.setBundleId(props.getCustomBundleProperty(childDef.getBundleName(), BUNDLE_FACTORY_CUSTOM_ID));
				if (StringUtils.isEmpty(childDef.getDebugURL())) {
					children.add(childDef);
				} else {
					throw new IllegalArgumentException("The external bundle '" + childDef.getBundleName()
							+ "' can't be a child of the composite bundle '" + bundleName
							+ "'. Please check your configuration. ");

				}
			}
			bundle.setChildren(children);
		} else {
			String mappingsProperty = props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_MAPPINGS);
			if (!hasDebugURL) {
				if (null == mappingsProperty) {
					throw new IllegalArgumentException("No mappings were defined for the bundle with name:" + bundleName
							+ ". Please specify at least one in configuration. ");
				} else {
					// Add the mappings
					List<String> mappings = new ArrayList<>();

					StringTokenizer tk = new StringTokenizer(mappingsProperty, JawrConstant.COMMA_SEPARATOR);
					while (tk.hasMoreTokens()) {
						String mapping = tk.nextToken().trim();
						mappings.add(mapping);
					}
					bundle.setMappings(mappings);
				}
			}
		}

		// dependencies
		List<String> dependencies = props.getCustomBundlePropertyAsList(bundleName, BUNDLE_FACTORY_CUSTOM_DEPENDENCIES);
		bundle.setDependencies(dependencies);

		return bundle;
	}
107257
@Override
	public void storeBundle(String bundleName, JoinableResourceBundleContent bundleResourcesContent) {

		// Text version
		String bundleContent = bundleResourcesContent.getContent().toString();
		storeBundle(bundleName, bundleContent, false, textDirPath);

		// binary version
		storeBundle(bundleName, bundleContent, true, gzipDirPath);
	}
178490
protected void register(Class<? extends NlsBundle> bundleInterface, NlsBundle bundle) {

    NlsBundle old = this.bundleMap.put(bundleInterface, bundle);
    if (old != null) {
      throw new IllegalStateException("Duplicate bundle for " + bundleInterface);
    }
  }
1045292
def _autorestart_store_components(self, bundle):
        # type: (Bundle) -> None
        
        with self.__instances_lock:
            # Prepare the list of components
            store = self.__auto_restart.setdefault(bundle, [])
            for stored_instance in self.__instances.values():
                # Get the factory name
                factory = stored_instance.factory_name
                if self.get_factory_bundle(factory) is bundle:
                    # Factory from this bundle
                    # Test component properties
                    properties = stored_instance.context.properties
                    if properties.get(constants.IPOPO_AUTO_RESTART):
                        # Auto-restart property found
                        store.append(
                            (factory, stored_instance.name, properties)
                        )
1349728
def store_container(self, container):
    
    with self._store_lock:
      self.store.setdefault(container.CONTAINER_TYPE, []).append(container)
1305815
private void joinAndStoreBundle(JoinableResourceBundle bundle) {

		BundleProcessingStatus status = new BundleProcessingStatus(BundleProcessingStatus.FILE_PROCESSING_TYPE, bundle,
				resourceHandler, config);
		JoinableResourceBundleContent store = null;

		// Process the bundle for searching variant
		if (needToSearchForVariantInPostProcess || hasVariantPostProcessor(bundle)) {
			status.setSearchingPostProcessorVariants(true);
			joinAndPostProcessBundle(bundle, status);

			// Process the bundles
			status.setSearchingPostProcessorVariants(false);
			Map<String, VariantSet> postProcessVariants = status.getPostProcessVariants();
			if (!postProcessVariants.isEmpty()) {
				if (LOGGER.isDebugEnabled()) {
					LOGGER.debug(
							"Post process variants found for bundle " + bundle.getId() + ":" + postProcessVariants);
				}
				Map<String, VariantSet> newVariants = VariantUtils.concatVariants(bundle.getVariants(),
						postProcessVariants);
				bundle.setVariants(newVariants);
				joinAndPostProcessBundle(bundle, status);
			}
		} else {
			status.setSearchingPostProcessorVariants(false);
			joinAndPostProcessBundle(bundle, status);
		}

		// Store the collected resources as a single file, both in text and
		// gzip formats.
		store = joinAndPostprocessBundle(bundle, null, status);
		storeBundle(bundle.getId(), store);

		// Set the data hascode in the bundle, in case the prefix needs to
		// be generated
		initBundleDataHashcode(bundle, store, null);

	}
698630
public synchronized void storeConfiguration(Configuration configuration) {
    log.trace("Store configuration {}", configuration);
    byte[] bytes = serializer.encode(configuration);
    configurationBuffer.position(0)
        .writeByte(1)
        .writeInt(bytes.length)
        .write(bytes);
    configurationBuffer.flush();
  }