/*
(non-Javadoc)

@see
net.jawr.web.resource.bundle.factory.processor.PostProcessorChainFactory#
buildDefaultProcessorChain()
339893
@Override
	public ResourceBundlePostProcessor buildDefaultProcessorChain() {
		ChainedResourceBundlePostProcessor processor = new CSSMinPostProcessor();
		processor.addNextProcessor(buildLicensesProcessor());
		return processor;
	}
1267867
private void buildForward(List<List<Vertex>> adjacencyList,
                              LinkedList<X509Certificate> certPathList,
                              boolean searchAllCertStores)
        throws GeneralSecurityException, IOException
    {
        if (debug != null) {
            debug.println("SunCertPathBuilder.buildForward()...");
        }

        /* Initialize current state */
        ForwardState currentState = new ForwardState();
        currentState.initState(buildParams.certPathCheckers());

        /* Initialize adjacency list */
        adjacencyList.clear();
        adjacencyList.add(new LinkedList<Vertex>());

        currentState.untrustedChecker = new UntrustedChecker();

        depthFirstSearchForward(buildParams.targetSubject(), currentState,
                                new ForwardBuilder(buildParams,
                                                   searchAllCertStores),
                                adjacencyList, certPathList);
    }
657501
public void writeDefaultConfiguration(ManifestFileProcessor mfp) {
        try {
            try {
                // Build the list of configurations
                buildDefaultConfigurationList(mfp);

                // Write <defaultConfiguration>
                startDefaultConfigurationSection();

                // We now have a map of bundles to the features that enable them. Loop through it and write out the default configuration for each one.
                for (Entry<FeatureResource, Set<String>> entry : bundleNameToFeaturesMap.entrySet()) {
                    FeatureResource bundle = entry.getKey();

                    BundleWrapper bw = new BundleWrapper(mfp, bundle);

                    for (DefaultElement element : bw.getDefaultElements()) {

                        indenter.indent(1);
                        writer.writeStartElement(DEFAULT_INSTANCE);
                        writer.writeAttribute(PROVIDING_FEATURES, getFeatureString(entry.getValue()));
                        if (element.requiresExisting())
                            writer.writeAttribute(XMLConfigParser.REQUIRE_EXISTING, "true");
                        if (element.addIfMissing())
                            writer.writeAttribute(XMLConfigParser.REQUIRE_DOES_NOT_EXIST, "true");
                        element.writeElement(2);
                        indenter.indent(1);
                        writer.writeEndElement();
                    }
                }

                // </defaultConfiguration>
                endDefaultConfigurationSection();
            } catch (XMLStreamException e) {
                throw new IOException("Error generating feature list", e);
            } catch (BundleException e) {
                throw new IOException("Error generating feature list", e);
            }
        } catch (IOException ex) {
            options.setReturnCode(ReturnCode.RUNTIME_EXCEPTION);
            throw new RuntimeException(ex);
        }
    }
457851
public void registerDefaultValueProcessor( Class target, DefaultValueProcessor defaultValueProcessor ) {
      if( target != null && defaultValueProcessor != null ) {
         defaultValueMap.put( target, defaultValueProcessor );
      }
   }
1255241
public DefaultSwidProcessor setSoftwareCreator(final String softwareCreatorName, final String softwareCreatorRegId) {
        swidTag.setSoftwareCreator(
                new EntityComplexType(
                        new Token(softwareCreatorName, idGenerator.nextId()),
                        new RegistrationId(softwareCreatorRegId, idGenerator.nextId()),
                        idGenerator.nextId()));
        return this;
    }
159835
@Override
    public List<String> getDefaultProviderChain() {
        List<String> result = new ArrayList<>(Monetary.getRoundingProviderNames());
        Collections.sort(result);
        return result;
    }
1307004
@Override
	protected AbstractChainedResourceBundlePostProcessor buildProcessorByKey(String procesorKey) {
		if (PostProcessFactoryConstant.JSMIN.equals(procesorKey))
			return buildJSMinPostProcessor();
		else if (PostProcessFactoryConstant.LICENSE_INCLUDER.equals(procesorKey))
			return buildLicensesProcessor();
		else if (PostProcessFactoryConstant.UGLIFY_JS.equals(procesorKey))
			return buildUglifyJSProcessor();
		else if (PostProcessFactoryConstant.YUI_COMPRESSOR.equals(procesorKey))
			return new YUIJSCompressor(false);
		else if (PostProcessFactoryConstant.YUI_COMPRESSOR_OBFUSCATOR.equals(procesorKey))
			return new YUIJSCompressor(true);
		else
			throw new IllegalArgumentException("The supplied key [" + procesorKey
					+ "] is not bound to any ResourceBundlePostProcessor. Please check the documentation for valid keys. ");
	}
80626
public alluxio.grpc.ChunkOrBuilder getChunkOrBuilder() {
    return chunk_ == null ? alluxio.grpc.Chunk.getDefaultInstance() : chunk_;
  }
735310
@Override
    public synchronized ChainData addChain(String chainName, FlowType chainType, String[] channelNameList) throws ChannelException, ChainException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "addChain: " + chainName);
        }
        if (null == chainName) {
            throw new InvalidChainNameException("Input chain name is null");
        }
        if (null == channelNameList || 0 == channelNameList.length) {
            throw new InvalidChannelNameException("Invalid channel list");
        }

        ChainDataImpl chainData = chainDataMap.get(chainName);
        // Ensure the chain name doesn't already exist in the framework.
        if (null != chainData) {
            InvalidChainNameException e = new InvalidChainNameException("Chain config already exists, " + chainName);
            FFDCFilter.processException(e, getClass().getName() + ".addChain", "1411", this, new Object[] { chainData });
            throw e;
        }

        int zRegion = RegionType.NOT_ON_Z;
        boolean okToAdd = true;
        ChannelFactory factory = null;

        // Determine if we are running on Z, and if so, what region we are in
        if (currentlyOnZ()) {
            zRegion = currentZRegion();
        }

        // Ensure each of the channel configurations already exist in the framework.
        ChannelData[] channelDataArray = new ChannelData[channelNameList.length];
        ChannelData channelData = null;
        int i = 0;
        int lastIndex = channelNameList.length - 1;
        for (i = 0; i <= lastIndex; i++) {
            factory = null;
            channelData = channelDataMap.get(channelNameList[i]);
            if (null == channelData) {
                InvalidChannelNameException e = new InvalidChannelNameException("Can't add chain config due to unknown channel, " + channelNameList[i]);
                FFDCFilter.processException(e, getClass().getName() + ".addChain", "1443", this, new Object[] { channelNameList[i] });
                throw e;
            }
            if (zRegion != RegionType.NOT_ON_Z && chainType.equals(FlowType.INBOUND)) {
                // On Z and inbound, need to do some special Z things
                if (i == lastIndex) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "On Z, looking at Application Channel, " + channelData.getName());
                    }
                    // Looking at the Inbound Application Channel
                    factory = getChannelFactoryInternal(channelData.getFactoryType(), false);

                    if (zRegion == RegionType.SR_REGION) {
                        // in SR, check if we should start this chain
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Operating in Servant Region");
                        }
                        if (factory instanceof BoundRegion) {
                            if (!(((BoundRegion) factory).isServantStartable(channelDataMap))) {
                                // channel does not want to start given the current
                                // configuration
                                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                    Tr.debug(tc, "Channel says it is not startable in Servant Region");
                                }
                                okToAdd = false;
                            }
                        }
                    } else if ((zRegion == BoundRegion.CR_REGION) || (zRegion == BoundRegion.CRA_REGION)) {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Operating in CR or CRA Region, Region constant: " + zRegion);
                        }
                        // In a secure region. check if the channel implements BoundRegion,
                        // and is configured to run in this region
                        if (factory instanceof BoundRegion) {
                            if (zRegion != (((BoundRegion) factory).getRegion(channelDataMap))) {
                                // channel does not support running in this region
                                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                    Tr.debug(tc, "This Channel says it is not startable in this Region: getRegion returned: " + ((BoundRegion) factory).getRegion(channelDataMap));
                                }
                                okToAdd = false;
                            }
                        }
                    }
                } else {
                    // Not Looking at an application channel in the chain
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "On Z, looking at non-application Channel, " + channelData.getName());
                    }

                    if ((zRegion == BoundRegion.CR_REGION) || (zRegion == BoundRegion.CRA_REGION)) {
                        // mark what region this channel is being asked to run in, and
                        // log a warning if this gives a sharable problem
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Operating in CR or CRA Region, Region constant: " + zRegion);
                        }

                        // Get Channel entry from HashMap
                        Integer channelEntry = ChannelZRegions.get(channelData.getName());
                        if (channelEntry == null) {
                            // new entry
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                Tr.debug(tc, "First time setting region entry for this channel");
                            }
                            ChannelZRegions.put(channelData.getName(), Integer.valueOf(zRegion));
                        } else {
                            // check to see if we are being asked to run in a different region
                            int entryValue = channelEntry.intValue();

                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                Tr.debug(tc, "Not first time setting region entry for this channel, current region entry is: " + entryValue);
                            }

                            if ((entryValue & zRegion) == 0) {
                                // being asked to be run in a different region, see if this is
                                // sharable
                                factory = getChannelFactoryInternal(channelData.getFactoryType(), false);
                                if (factory instanceof CrossRegionSharable) {
                                    if (!(((CrossRegionSharable) factory).isSharable(channelDataMap))) {
                                        // non-sharable channel is being put into different regions
                                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                            Tr.debug(tc, "Channel says it is not sharable");
                                        }
                                        Tr.warning(tc, "channel.shared.warning", new Object[] { channelData.getName() });

                                    }
                                }
                                // update regions that this channel is being used in
                                ChannelZRegions.put(channelData.getName(), Integer.valueOf(entryValue | zRegion));
                            }
                        }
                    }
                }
            }
            channelDataArray[i] = channelData;
        } // end-for loop on channels

        if (okToAdd) {
            try {
                // Store values for the host and port in the chain if it is inbound.
                Map<Object, Object> chainProperties = null;
                if (FlowType.INBOUND.equals(chainType)) {
                    chainProperties = new HashMap<Object, Object>();
                    Map<Object, Object> tcpProperties = channelDataArray[0].getPropertyBag();
                    chainProperties.put(ChannelFrameworkConstants.HOST_NAME, tcpProperties.get(ChannelFrameworkConstants.HOST_NAME));
                    chainProperties.put(ChannelFrameworkConstants.PORT, tcpProperties.get(ChannelFrameworkConstants.PORT));
                    chainProperties.put(ChannelFrameworkConstants.LISTENING_PORT, tcpProperties.get(ChannelFrameworkConstants.LISTENING_PORT));
                }
                chainData = (ChainDataImpl) createChainData(chainName, chainType, channelDataArray, chainProperties);
                // Add the new chain to the framework configuration.
                this.chainDataMap.put(chainName, chainData);
                // Associate any global chain event listeners.
                for (int j = 0; j < globalChainEventListeners.size(); j++) {
                    chainData.addChainEventListener(globalChainEventListeners.get(j));
                }
            } catch (IncoherentChainException e) {
                FFDCFilter.processException(e, getClass().getName() + ".addChain", "1601", this, new Object[] { chainName, chainType, channelDataArray });
                throw e;
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "addChain");
        }
        return chainData;
    }
408435
@Override
    public List<String> getDefaultProviderChain() {
        List<String> list = new ArrayList<>(getProviderNames());
        Collections.sort(list);
        return list;
    }
1064446
@Override
    public void addDefaultConfiguration(String pid, Dictionary<String, String> properties) throws ConfigUpdateException {
        bundleProcessor.addDefaultConfiguration(pid, properties);
    }
1206505
public void setChaincodeVersion(String chaincodeVersion) throws InvalidArgumentException {
        if (Utils.isNullOrEmpty(chaincodeVersion)) {
            throw new InvalidArgumentException("The chaincodeVersion parameter can not be null or empty.");
        }
        this.chaincodeVersion = chaincodeVersion;

    }
1190105
public boolean hasDefaultConstructor() {
	    if (!delegate.isPresent()) {
	        return false;
	    }
	    
	    final Constructor<?>[] constructors = delegateClass().getConstructors();
        for (final Constructor<?> constructor : constructors) {
            if (constructor.getParameterTypes().length == 0) {
                return true;
            }
        }
        
        return false;
	}
680077
protected ChainedResourceBundlePostProcessor getCustomProcessorWrapper(ResourceBundlePostProcessor customProcessor,
			String key, boolean isVariantPostProcessor) {
		return new CustomPostProcessorChainWrapper(key, customProcessor, isVariantPostProcessor);
	}
1115833
public DefaultReconfigurationProblem build() throws SchedulerException {

        if (runs == null) {
            //The others are supposed to be null too as they are set using the same method
            Mapping map = model.getMapping();
            runs = new HashSet<>();
            sleep = new HashSet<>();
            for (Node n : map.getOnlineNodes()) {
                runs.addAll(map.getRunningVMs(n));
                sleep.addAll(map.getSleepingVMs(n));
            }
            waits = map.getReadyVMs();
            over = Collections.emptySet();
        }

        if (manageable == null) {
            manageable = new HashSet<>();
            manageable.addAll(model.getMapping().getSleepingVMs());
            manageable.addAll(model.getMapping().getRunningVMs());
            manageable.addAll(model.getMapping().getReadyVMs());
        }

        if (ps == null) {
            ps = new DefaultParameters();
        }
        return new DefaultReconfigurationProblem(model, ps, waits, runs, sleep, over, manageable);
    }
105339
public Fault buildFault(Throwable ex) {
		Fault fault;
		int stacktracelength = configuration.getStacktracelength();
		if (stacktracelength == 0 || logger.isDebugEnabled()) {
			logger.error("Invocation failed", ex);
		}
		fault = new Fault(ex, stacktracelength);
		return fault;
	}
194221
public static void addDefaultConstructor(ClassFile file, List<DeferredBytecode> initialValueBytecode, final boolean useUnsafeInstantiators) {
        addConstructor(BytecodeUtils.VOID_CLASS_DESCRIPTOR, new String[0], new String[0], file, initialValueBytecode, useUnsafeInstantiators);
    }