/*
(non-Javadoc)

@see
mtas.solr.handler.component.util.MtasSolrComponent#prepare(org.apache.solr.
handler.component.ResponseBuilder,
mtas.codec.util.CodecComponent.ComponentFields)
517912
public void prepare(ResponseBuilder rb, ComponentFields mtasFields)
      throws IOException {
    Set<String> ids = MtasSolrResultUtil
        .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_GROUP);
    if (!ids.isEmpty()) {
      int tmpCounter = 0;
      String[] fields = new String[ids.size()];
      String[] queryTypes = new String[ids.size()];
      String[] queryValues = new String[ids.size()];
      String[] queryPrefixes = new String[ids.size()];
      String[] queryIgnores = new String[ids.size()];
      String[] queryMaximumIgnoreLengths = new String[ids.size()];
      HashMap<String, String[]>[] queryVariables = new HashMap[ids.size()];
      String[] keys = new String[ids.size()];
      String[] numbers = new String[ids.size()];
      String[] starts = new String[ids.size()];
      String[][] groupingLeftPosition = new String[ids.size()][];
      String[][] groupingLeftPrefixes = new String[ids.size()][];
      String[][] groupingRightPosition = new String[ids.size()][];
      String[][] groupingRightPrefixes = new String[ids.size()][];
      String[] groupingHitInsidePrefixes = new String[ids.size()];
      String[][] groupingHitLeftPosition = new String[ids.size()][];
      String[][] groupingHitLeftPrefixes = new String[ids.size()][];
      String[][] groupingHitRightPosition = new String[ids.size()][];
      String[][] groupingHitRightPrefixes = new String[ids.size()][];
      String[][] groupingHitInsideLeftPosition = new String[ids.size()][];
      String[][] groupingHitInsideLeftPrefixes = new String[ids.size()][];
      String[][] groupingHitInsideRightPosition = new String[ids.size()][];
      String[][] groupingHitInsideRightPrefixes = new String[ids.size()][];
      for (String id : ids) {
        fields[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_GROUP + "." + id + "." + NAME_MTAS_GROUP_FIELD, null);
        keys[tmpCounter] = rb.req.getParams()
            .get(PARAM_MTAS_GROUP + "." + id + "." + NAME_MTAS_GROUP_KEY,
                String.valueOf(tmpCounter))
            .trim();
        numbers[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_GROUP + "." + id + "." + NAME_MTAS_GROUP_NUMBER, null);
        starts[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_GROUP + "." + id + "." + NAME_MTAS_GROUP_START, null);
        queryTypes[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_GROUP + "." + id + "." + NAME_MTAS_GROUP_QUERY_TYPE,
            null);
        queryValues[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_GROUP + "." + id + "." + NAME_MTAS_GROUP_QUERY_VALUE,
            null);
        queryPrefixes[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_GROUP + "." + id + "." + NAME_MTAS_GROUP_QUERY_PREFIX,
            null);
        queryIgnores[tmpCounter] = rb.req.getParams().get(
            PARAM_MTAS_GROUP + "." + id + "." + NAME_MTAS_GROUP_QUERY_IGNORE,
            null);
        queryMaximumIgnoreLengths[tmpCounter] = rb.req.getParams()
            .get(PARAM_MTAS_GROUP + "." + id + "."
                + NAME_MTAS_GROUP_QUERY_MAXIMUM_IGNORE_LENGTH, null);
        Set<String> vIds = MtasSolrResultUtil.getIdsFromParameters(
            rb.req.getParams(),
            PARAM_MTAS_GROUP + "." + id + "." + NAME_MTAS_GROUP_QUERY_VARIABLE);
        queryVariables[tmpCounter] = new HashMap<>();
        if (!vIds.isEmpty()) {
          HashMap<String, ArrayList<String>> tmpVariables = new HashMap<>();
          for (String vId : vIds) {
            String name = rb.req.getParams()
                .get(PARAM_MTAS_GROUP + "." + id + "."
                    + NAME_MTAS_GROUP_QUERY_VARIABLE + "." + vId + "."
                    + SUBNAME_MTAS_GROUP_QUERY_VARIABLE_NAME, null);
            if (name != null) {
              if (!tmpVariables.containsKey(name)) {
                tmpVariables.put(name, new ArrayList<String>());
              }
              String value = rb.req.getParams()
                  .get(PARAM_MTAS_GROUP + "." + id + "."
                      + NAME_MTAS_GROUP_QUERY_VARIABLE + "." + vId + "."
                      + SUBNAME_MTAS_GROUP_QUERY_VARIABLE_VALUE, null);
              if (value != null) {
                ArrayList<String> list = new ArrayList<>();
                String[] subList = value.split("(?<!\\\\),");
                for (int i = 0; i < subList.length; i++) {
                  list.add(
                      subList[i].replace("\\,", ",").replace("\\\\", "\\"));
                }
                tmpVariables.get(name).addAll(list);
              }
            }
          }
          for (Entry<String, ArrayList<String>> entry : tmpVariables
              .entrySet()) {
            queryVariables[tmpCounter].put(entry.getKey(),
                entry.getValue().toArray(new String[entry.getValue().size()]));
          }
        }
        groupingHitInsidePrefixes[tmpCounter] = null;
        // collect
        SortedSet<String> gids;
        String tmpName;
        // collect grouping inside
        tmpName = PARAM_MTAS_GROUP + "." + id + "."
            + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE;
        groupingHitInsidePrefixes[tmpCounter] = rb.req.getParams()
            .get(tmpName + "." + NAME_MTAS_GROUP_GROUPING_PREFIXES);
        // collect grouping left
        tmpName = PARAM_MTAS_GROUP + "." + id + "."
            + NAME_MTAS_GROUP_GROUPING_LEFT;
        gids = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
            tmpName);
        groupingLeftPosition[tmpCounter] = new String[gids.size()];
        groupingLeftPrefixes[tmpCounter] = new String[gids.size()];
        prepare(rb.req.getParams(), gids, tmpName,
            groupingLeftPosition[tmpCounter], groupingLeftPrefixes[tmpCounter]);
        // collect grouping right
        tmpName = PARAM_MTAS_GROUP + "." + id + "."
            + NAME_MTAS_GROUP_GROUPING_RIGHT;
        gids = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
            tmpName);
        groupingRightPosition[tmpCounter] = new String[gids.size()];
        groupingRightPrefixes[tmpCounter] = new String[gids.size()];
        prepare(rb.req.getParams(), gids, tmpName,
            groupingRightPosition[tmpCounter],
            groupingRightPrefixes[tmpCounter]);
        // collect grouping hit left
        tmpName = PARAM_MTAS_GROUP + "." + id + "."
            + NAME_MTAS_GROUP_GROUPING_HIT_LEFT;
        gids = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
            tmpName);
        groupingHitLeftPosition[tmpCounter] = new String[gids.size()];
        groupingHitLeftPrefixes[tmpCounter] = new String[gids.size()];
        prepare(rb.req.getParams(), gids, tmpName,
            groupingHitLeftPosition[tmpCounter],
            groupingHitLeftPrefixes[tmpCounter]);
        // collect grouping hit right
        tmpName = PARAM_MTAS_GROUP + "." + id + "."
            + NAME_MTAS_GROUP_GROUPING_HIT_RIGHT;
        gids = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
            tmpName);
        groupingHitRightPosition[tmpCounter] = new String[gids.size()];
        groupingHitRightPrefixes[tmpCounter] = new String[gids.size()];
        prepare(rb.req.getParams(), gids, tmpName,
            groupingHitRightPosition[tmpCounter],
            groupingHitRightPrefixes[tmpCounter]);
        // collect grouping hit inside left
        tmpName = PARAM_MTAS_GROUP + "." + id + "."
            + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_LEFT;
        gids = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
            tmpName);
        groupingHitInsideLeftPosition[tmpCounter] = new String[gids.size()];
        groupingHitInsideLeftPrefixes[tmpCounter] = new String[gids.size()];
        prepare(rb.req.getParams(), gids, tmpName,
            groupingHitInsideLeftPosition[tmpCounter],
            groupingHitInsideLeftPrefixes[tmpCounter]);
        // collect grouping hit inside right
        tmpName = PARAM_MTAS_GROUP + "." + id + "."
            + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_RIGHT;
        gids = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
            tmpName);
        groupingHitInsideRightPosition[tmpCounter] = new String[gids.size()];
        groupingHitInsideRightPrefixes[tmpCounter] = new String[gids.size()];
        prepare(rb.req.getParams(), gids, tmpName,
            groupingHitInsideRightPosition[tmpCounter],
            groupingHitInsideRightPrefixes[tmpCounter]);

        tmpCounter++;
      }
      String uniqueKeyField = rb.req.getSchema().getUniqueKeyField().getName();
      mtasFields.doGroup = true;
      rb.setNeedDocSet(true);
      for (String field : fields) {
        if (field == null || field.isEmpty()) {
          throw new IOException("no (valid) field in mtas group");
        } else if (!mtasFields.list.containsKey(field)) {
          mtasFields.list.put(field, new ComponentField(uniqueKeyField));
        }
      }
      MtasSolrResultUtil.compareAndCheck(keys, fields, NAME_MTAS_GROUP_KEY,
          NAME_MTAS_GROUP_FIELD, true);
      MtasSolrResultUtil.compareAndCheck(queryValues, fields,
          NAME_MTAS_GROUP_QUERY_VALUE, NAME_MTAS_GROUP_FIELD, false);
      MtasSolrResultUtil.compareAndCheck(queryTypes, fields,
          NAME_MTAS_GROUP_QUERY_TYPE, NAME_MTAS_GROUP_FIELD, false);
      for (int i = 0; i < fields.length; i++) {
        ComponentField cf = mtasFields.list.get(fields[i]);
        Integer maximumIgnoreLength = (queryMaximumIgnoreLengths[i] == null)
            ? null : Integer.parseInt(queryMaximumIgnoreLengths[i]);
        MtasSpanQuery q = MtasSolrResultUtil.constructQuery(queryValues[i],
            queryTypes[i], queryPrefixes[i], queryVariables[i], fields[i],
            queryIgnores[i], maximumIgnoreLength);
        // minimize number of queries
        if (cf.spanQueryList.contains(q)) {
          q = cf.spanQueryList.get(cf.spanQueryList.indexOf(q));
        } else {
          cf.spanQueryList.add(q);
        }
        String key = (keys[i] == null) || (keys[i].isEmpty())
            ? String.valueOf(i) + ":" + fields[i] + ":" + queryValues[i]
            : keys[i].trim();
        int number = (numbers[i] == null) || (numbers[i].isEmpty())
            ? DEFAULT_NUMBER : Integer.parseInt(numbers[i]);
        int start = (starts[i] == null) || (starts[i].isEmpty()) ? 0
            : Integer.parseInt(starts[i]);
        mtasFields.list.get(fields[i]).groupList.add(new ComponentGroup(q, key,
            number, start, groupingHitInsidePrefixes[i],
            groupingHitInsideLeftPosition[i], groupingHitInsideLeftPrefixes[i],
            groupingHitInsideRightPosition[i],
            groupingHitInsideRightPrefixes[i], groupingHitLeftPosition[i],
            groupingHitLeftPrefixes[i], groupingHitRightPosition[i],
            groupingHitRightPrefixes[i], groupingLeftPosition[i],
            groupingLeftPrefixes[i], groupingRightPosition[i],
            groupingRightPrefixes[i]));
      }
    }
  }
860318
@Override
	public void prepare() throws Exception {
		final TaskConfig config = this.taskContext.getTaskConfig();
		if (config.getDriverStrategy() != DriverStrategy.ALL_REDUCE) {
			throw new Exception("Unrecognized driver strategy for AllReduce driver: " + config.getDriverStrategy().name());
		}
		
		TypeSerializerFactory<T> serializerFactory = this.taskContext.getInputSerializer(0);
		this.serializer = serializerFactory.getSerializer();
		this.input = this.taskContext.getInput(0);
	}
168234
private void processComponents(MAPDialogImpl mapDialogImpl, Component[] components) {

        // Now let us decode the Components
        for (Component c : components) {

            doProcessComponent(mapDialogImpl, c);
        }
    }
798363
private void prepare(SolrParams solrParams, SortedSet<String> gids,
      String name, String[] positions, String[] prefixes) throws IOException {
    if (!gids.isEmpty()) {
      int tmpSubCounter = 0;
      for (String gid : gids) {
        positions[tmpSubCounter] = solrParams.get(
            name + "." + gid + "." + NAME_MTAS_GROUP_GROUPING_POSITION, null);
        prefixes[tmpSubCounter] = solrParams.get(
            name + "." + gid + "." + NAME_MTAS_GROUP_GROUPING_PREFIXES, null);
        if (positions[tmpSubCounter] == null) {
          throw new IOException("no position for " + gid);
        } else if (prefixes[tmpSubCounter] == null) {
          throw new IOException("no prefix for " + gid);
        }
        tmpSubCounter++;
      }
    }
  }
550491
final public StringWrapper prepare(String s) {
		MultiStringWrapper ms = new MultiStringWrapper(s,delim);
		if (!isLegalMultiStringWrapperSize(ms.size())) {
			throw new IllegalArgumentException("string has invalid number of fields");
		}
		for (int i=0; i<ms.size(); i++) {
			ms.set(i, getDistance(i).prepare( ms.get(i).unwrap() ));
		}
		return ms;
	}
1246468
public ClassFileBuilder prepare() throws SupportException {
        if (mPrimaryKey == null) {
            throw new IllegalStateException("Primary key not defined");
        }

        // Clear the cached result, if any
        mStorableClass = null;

        mClassFileGenerator = new StorableClassFileBuilder(
             mClassNameProvider,
             mLoader,
             SyntheticStorableBuilder.class,
             mEvolvable);
        ClassFile cf = mClassFileGenerator.getClassFile();

        for (SyntheticProperty prop : mPropertyList) {
            definePropertyBeanMethods(cf, prop);
        }

        definePrimaryKey(cf);
        defineAlternateKeys(cf);
        defineIndexes(cf);

        return mClassFileGenerator;
    }
834034
public int prepare() throws ProtocolException, RollbackException, SeverePersistenceException, TransactionException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "prepare");

        // Check the current transaction state (use state lock to ensure we see the latest value)
        synchronized (_stateLock)
        {
            if (_state != TransactionState.STATE_ACTIVE)
            {
                ProtocolException pe = new ProtocolException("TRAN_PROTOCOL_ERROR_SIMS1001", new Object[]{});
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot prepare Transaction. Transaction is complete or completing!", pe);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare");
                throw pe;
            }

            // Transition our prepare sub-state immediately - before we call the callbacks
            _preCommitSubstate = TransactionState.STATE_PREPARING;
        }

        // PK81848
        // From this point on, we must perform a rollback if we fail to complete the prepare,
        // or another thread requests a deferred rollback
        try
        {
            // Call beforeCompletion on MP callback
            for (int i = 0; i < _callbacks.size(); i++)
            {
                TransactionCallback callback = (TransactionCallback) _callbacks.get(i);
                callback.beforeCompletion(this);
            }

            // Do we have work to do?
            if (_workList != null)
            {
                _workList.preCommit(this);

                synchronized (_stateLock)
                {
                    // Need to change the overalll state after we have 
                    // called the callbacks and preCommitted 
                    // the workList as they may trigger
                    // an addWork call to add work to the
                    // transaction.
                    _state = TransactionState.STATE_PREPARING;
                }

                // The transaction is about to be in a state where any rollback must
                // update the database.  We cannot narrow the window any more than this
                _rollbackChanges = true;
                
                // Perform the prepare
                _persistence.prepare(this);

                // State check/change must be performed holding the state lock
                synchronized (_stateLock)
                {
                    // Another thread may have have received a rollback, while we were
                    // performing our prepare - if the database was extremely slow to respond
                    if (_preCommitSubstate == TransactionState.STATE_ROLLBACK_DEFERRED)
                    {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.event(this, tc, "Deferred rollback requested during prepare for TranId: "+_ptid);

                        // Throw an exception to trigger rollback processing.
                        throw new DeferredRollbackException();
                    }
                    else
                    {
                        _state = _preCommitSubstate = TransactionState.STATE_PREPARED;
                    }
                }                
            }
            else
            {
                // State change must be performed holding the state lock
                synchronized (_stateLock)
                {
                    // Defect 301480
                    // We don't have any work in our workList so in theory we should be
                    // able to vote READ_ONLY at this point. However in a particular case
                    // (Best Effort message being sent off server) a call back in an empty
                    // XAResource is used to trigger work on a remote server. In this case 
                    // we need beforeCompletion AND afterCompletion to be called at the 
                    // CORRECT time during transaction completion to ensure that the off 
                    // server work stays part of the XA transaction and gets informed of 
                    // the correct completion direction.
                    _state = _preCommitSubstate = TransactionState.STATE_PREPARED;
                }
            }
        }
        catch (SeverePersistenceException spe)
        {
            // SPE exceptions are handled with an RMFAIL return code by the caller,
            // so unlike all other types of exception no attempt is made here to
            // rollback the transaction. However, we report a local error - so
            // the whole JVM will be coming down with a few minutes.
            com.ibm.ws.ffdc.FFDCFilter.processException(spe, "com.ibm.ws.sib.msgstore.transactions.XidParticipant.prepare", "1:420:1.73", this);

            // As we have thrown a severe exception we need to inform
            // the ME that this instance is no longer able to continue.
            if (_ms != null)
            {
                _ms.reportLocalError();
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unrecoverable persistence exception caught during prepare phase of transaction!", spe);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare", spe);
            throw spe;
        }
        // Catch and handle all exceptions but allow 
        // Errors to filter up without interference
        catch (Exception e)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.transactions.XidParticipant.prepare", "1:436:1.73", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Transaction will roll-back due to Exception in prepare!", e);

            // Update our prepare state before calling rollback. If we are responding
            // to a deferred rollback request this will have no affect but if this is 
            // due to some other failure it will lock out any other attempts to rollback
            synchronized (_stateLock)
            {
                _preCommitSubstate = TransactionState.STATE_ROLLINGBACK;
            }

            // An error has occurred but we are able to keep the ME
            // going so we just need to clean up this transaction.
            try
            {
                // When we throw our RollbackException the TM is
                // going to assume we are complete so we need to 
                // ensure we are rolled-back.
                // 
                // PK81848.2
                // We need to pass "true" in order to turn off the
                // state checking which should block other threads 
                // from attempting a rollback when we are in the 
                // middle of internal rollback processing.
                rollback(true);
            }
            // Catch and handle all exceptions but allow 
            // Errors to filter up without interference
            catch (Exception e2)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(e2, "com.ibm.ws.sib.msgstore.transactions.XIDParticipant.prepare", "1:466:1.73", this);
                
                // This is a problem because we now must RMFAIL this prepare call as we do not know the outcome.
                // Transition to rollback expected state now even if we are in deferred rollback.  This is the
                // only thing we can do (problem is we said XA_OK to roll back in deferred case and now we
                // cannot honour it).  This case may still leave indoubts.
                synchronized(_stateLock)
                {
                    _state = _preCommitSubstate = TransactionState.STATE_ROLLBACK_EXPECTED;
                }
                
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare", "Exception caught rolling-back transaction after preCommit failure! " + e2);
                throw new TransactionException(e2);
            }

            // Mark ourselves as complete, regardless of the outcome of the attempt to rollback.
            synchronized (_stateLock)
            {
                _state = _preCommitSubstate = TransactionState.STATE_ROLLEDBACK;
            }

            // Wrap any persistence exception, or an unexpected exception, in a rollback exception.
            // This informs the TM that they can forget about this transaction.
            RollbackException re = new RollbackException("COMPLETION_EXCEPTION_SIMS1002", new Object[]{e}, e);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare", re);
            throw re;
        }

        // Non-exception return path always returns XA_OK
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare", "return="+XAResource.XA_OK);
        return XAResource.XA_OK;
    }
1047868
@Override
	protected void preparePaintComponent(final Request request) {
		super.preparePaintComponent(request);
		if (!isInitialised()) {
			table.setBean(ExampleDataUtil.createExampleData());
			setInitialised(true);
		}
	}
618837
@Override
  public RecordMaterializer<T> prepareForRead(Configuration configuration,
                                              Map<String, String> keyValueMetaData, MessageType fileSchema,
                                              ReadSupport.ReadContext readContext) {
    ThriftMetaData thriftMetaData = ThriftMetaData.fromExtraMetaData(keyValueMetaData);
    try {
      if (thriftClass == null) {
        thriftClass = getThriftClass(keyValueMetaData, configuration);
      }

      ThriftType.StructType descriptor = null;
      if (thriftMetaData != null) {
        descriptor = thriftMetaData.getDescriptor();
      } else {
        ScroogeStructConverter schemaConverter = new ScroogeStructConverter();
        descriptor = schemaConverter.convert(thriftClass);
      }

      ThriftRecordConverter<T> converter = new ScroogeRecordConverter<T>(
        thriftClass,
        readContext.getRequestedSchema(),
        descriptor);
      return converter;
    } catch (Exception t) {
      throw new RuntimeException("Unable to create Thrift Converter for Thrift metadata " + thriftMetaData, t);
    }
  }
1224548
@Override
	public void prepare() throws Exception {
		final TaskConfig config = this.taskContext.getTaskConfig();
		this.strategy = config.getDriverStrategy();

		switch (this.strategy) {
			case ALL_GROUP_REDUCE_COMBINE:
				if (!(this.taskContext.getStub() instanceof GroupCombineFunction)) {
					throw new Exception("Using combiner on a UDF that does not implement the combiner interface " + GroupCombineFunction.class.getName());
				}
			case ALL_GROUP_REDUCE:
			case ALL_GROUP_COMBINE:
				break;
			default:
				throw new Exception("Unrecognized driver strategy for AllGroupReduce driver: " + this.strategy.name());
		}

		this.serializer = this.taskContext.<IT>getInputSerializer(0).getSerializer();
		this.input = this.taskContext.getInput(0);

		ExecutionConfig executionConfig = taskContext.getExecutionConfig();
		this.objectReuseEnabled = executionConfig.isObjectReuseEnabled();

		if (LOG.isDebugEnabled()) {
			LOG.debug("AllGroupReduceDriver object reuse: " + (this.objectReuseEnabled ? "ENABLED" : "DISABLED") + ".");
		}
	}
46723
protected void prepareCasResponseAttributesForViewModel(final Map<String, Object> model) {
        val service = authenticationRequestServiceSelectionStrategies.resolveService(getServiceFrom(model));
        val registeredService = this.servicesManager.findServiceBy(service);

        val principalAttributes = getCasPrincipalAttributes(model, registeredService);
        val attributes = new HashMap<String, Object>(principalAttributes);

        LOGGER.trace("Processed principal attributes from the output model to be [{}]", principalAttributes.keySet());
        val protocolAttributes = getCasProtocolAuthenticationAttributes(model, registeredService);
        attributes.putAll(protocolAttributes);

        LOGGER.debug("Final collection of attributes for the response are [{}].", attributes.keySet());
        putCasResponseAttributesIntoModel(model, attributes, registeredService, this.attributesRenderer);
    }
634502
@Override
    public void prepare(@SuppressWarnings("rawtypes") Map map, TopologyContext tc, OutputCollector oc) {
        this.collector = oc;
        Configuration cepConfig = new Configuration();
        if (this.eventTypes == null || (this.objectStatements == null && this.statements == null)) {
            throw new FailedException("Event types cannot be null and at least one type of statement has to be not null");
        }
        for (Map.Entry<GlobalStreamId, Grouping> a : tc.getThisSources().entrySet()) {
            Fields f = tc.getComponentOutputFields(a.getKey());
            if (!this.eventTypes.keySet().containsAll(f.toList())) {
                throw new FailedException("Event types and fields from source streams do not match: Event Types="
                        + Arrays.toString(this.eventTypes.keySet().toArray())
                        + " Stream Fields=" + Arrays.toString(f.toList().toArray()));
            }
            cepConfig.addEventType(a.getKey().get_componentId() + "_" + a.getKey().get_streamId(), this.eventTypes);
        }
        this.epService = EPServiceProviderManager.getDefaultProvider(cepConfig);
        this.epService.initialize();
        if (!processStatemens()) {
            throw new FailedException("At least one type of statement has to be not empty");
        }
    }
1226573
@Override
	protected void preparePaintComponent(final Request request) {
		super.preparePaintComponent(request);

		if (!isInitialised()) {
			textArea.setFocussed();

			setInitialised(true);
		}
	}
1034775
@Override
	public void prepare() throws Exception {
		final TaskConfig config = this.taskContext.getTaskConfig();
		if (config.getDriverStrategy() != DriverStrategy.ALL_REDUCE) {
			throw new Exception("Unrecognized driver strategy for AllReduce driver: " + config.getDriverStrategy().name());
		}
		
		TypeSerializerFactory<T> serializerFactory = this.taskContext.getInputSerializer(0);
		this.serializer = serializerFactory.getSerializer();
		this.input = this.taskContext.getInput(0);

		ExecutionConfig executionConfig = taskContext.getExecutionConfig();
		this.objectReuseEnabled = executionConfig.isObjectReuseEnabled();

		if (LOG.isDebugEnabled()) {
			LOG.debug("AllReduceDriver object reuse: " + (this.objectReuseEnabled ? "ENABLED" : "DISABLED") + ".");
		}
	}
988120
private void processProps() {
    ElementFilter
        .fieldsIn(component.getEnclosedElements())
        .stream()
        .filter(field -> hasAnnotation(field, Prop.class))
        .forEach(field -> {
          String propName = field.getSimpleName().toString();
          Prop prop = field.getAnnotation(Prop.class);

          collectionFieldsValidator.validateComponentPropField(field);

          fieldsWithNameExposed.add(new ExposedField(propName, field.asType()));

          optionsBuilder.addStatement(
              "options.addJavaProp($S, $T.getFieldName(this, () -> this.$L = $L), $L, $S)",
              propName,
              VueGWTTools.class,
              propName,
              getFieldMarkingValueForType(field.asType()),
              prop.required(),
              prop.checkType() ? getNativeNameForJavaType(field.asType()) : null
          );
        });
  }
1170978
protected void prepareIO() {
        // we assume that everything in ByteArray is in AMF3
        Input input = new Input(data);
        input.enforceAMF3();
        dataInput = new DataInput(input);
        Output output = new Output(data);
        output.enforceAMF3();
        dataOutput = new DataOutput(output);
    }
644892
@Override
    protected void prepareActions() throws QTasteTestFailException {
        mSelectState = Boolean.parseBoolean(mData[0].toString());
        if (!(component instanceof AbstractButton)) {
            throw new QTasteTestFailException("Unsupported component.");
        }
    }