Builds {@link HotRodRouterConfiguration}.
963447
public HotRodRouterConfiguration build() {
        if (this.enabled) {
            try {
                validate();
            } catch (Exception e) {
                throw logger.configurationValidationError(e);
            }
            return new HotRodRouterConfiguration(ip, port, sendBufferSize, receiveBufferSize, tcpKeepAlive, tcpNoDelay);
        }
        return null;
    }
1163252
public function build()
    {
        $config = $this->getConfiguration();

        Validator::validateConfiguration($this->classMetadata, $config);

        $this->classMetadata->addExtension(UploadableDriver::EXTENSION_NAME, $config);
    }
343642
public RemoteMenuController build() {
        if(protocol == null) {
            protocol = new TagValMenuCommandProtocol();
        }
        if(executorService == null) {
            executorService = Executors.newScheduledThreadPool(2,
                    new NamedDaemonThreadFactory("rs232-remote"));
        }
        Rs232RemoteConnector connector = new Rs232RemoteConnector(portName, baud, protocol, executorService);
        return new RemoteMenuController(connector, menuTree, executorService, name, clock);
    }
336170
public JsonTransformer build() {
		try {
			return new WrappingTransformer(buildPipe());
		} catch(Exception e) {
			throw new RuntimeException("Failed to build pipeline: " + e.getMessage(), e);
		}
	}
811534
public RestRouterConfiguration build() {
        if (this.enabled) {
            try {
                validate();
            } catch (Exception e) {
                throw logger.configurationValidationError(e);
            }
            return new RestRouterConfiguration(ip, port);
        }
        return null;
    }
1006016
@Override
    protected void configure() {

        // Run request processor first so give it a high rank
        bind(RequestProcessor.class).to(VertxRequestProcessor.class).ranked(999);
        // Run response processor last so give it a low rank
        bind(ResponseProcessor.class).to(VertxResponseProcessor.class).ranked(-999);
        // Run post response processor last so give it a low rank
        bind(PostResponseProcessor.class).to(VertxPostResponseProcessor.class).ranked(-999);

    }
329986
private void configureComponentsBeforeBuilding(final AnalysisJobBuilder jobBuilder, final int partitionNumber) {
        // update datastores and resource properties to point to node-specific
        // targets if possible. This way parallel writing to files on HDFS does
        // not cause any inconsistencies because each node is writing to a
        // separate file.
        for (final ComponentBuilder cb : jobBuilder.getComponentBuilders()) {
            // find any datastore properties that point to HDFS files
            final Set<ConfiguredPropertyDescriptor> targetDatastoreProperties =
                    cb.getDescriptor().getConfiguredPropertiesByType(UpdateableDatastore.class, false);
            for (final ConfiguredPropertyDescriptor targetDatastoreProperty : targetDatastoreProperties) {
                final Object datastoreObject = cb.getConfiguredProperty(targetDatastoreProperty);
                if (datastoreObject instanceof ResourceDatastore) {
                    final ResourceDatastore resourceDatastore = (ResourceDatastore) datastoreObject;
                    final Resource resource = resourceDatastore.getResource();
                    final Resource replacementResource = createReplacementResource(resource, partitionNumber);
                    if (replacementResource != null) {
                        final ResourceDatastore replacementDatastore =
                                createReplacementDatastore(cb, resourceDatastore, replacementResource);
                        if (replacementDatastore != null) {
                            cb.setConfiguredProperty(targetDatastoreProperty, replacementDatastore);
                        }
                    }
                }
            }

            final Set<ConfiguredPropertyDescriptor> resourceProperties =
                    cb.getDescriptor().getConfiguredPropertiesByType(Resource.class, false);
            for (final ConfiguredPropertyDescriptor resourceProperty : resourceProperties) {
                final Resource resource = (Resource) cb.getConfiguredProperty(resourceProperty);
                final Resource replacementResource = createReplacementResource(resource, partitionNumber);
                if (replacementResource != null) {
                    cb.setConfiguredProperty(resourceProperty, replacementResource);
                }
            }

            // special handlings of specific component types are handled here
            if (cb.getComponentInstance() instanceof CreateCsvFileAnalyzer) {
                if (partitionNumber > 0) {
                    // ensure header is only created once
                    cb.setConfiguredProperty(CreateCsvFileAnalyzer.PROPERTY_INCLUDE_HEADER, false);
                }
            }
        }

        // recursively apply this function also on output data stream jobs
        final List<AnalysisJobBuilder> children = jobBuilder.getConsumedOutputDataStreamsJobBuilders();
        for (final AnalysisJobBuilder childJobBuilder : children) {
            configureComponentsBeforeBuilding(childJobBuilder, partitionNumber);
        }
    }
93967
public function build() : RouterInterface
    {
        $router = $this->router;
        foreach($this->routing_rules as $routing_rule => $events)
        {
            if (is_string($events)){
                try{
                    $router->bind($routing_rule, '*', $events);
                }
                catch(RoutingRuleBindingException $e)
                {
                    throw new RouterBuildingException('Rule binding failed:' . $routing_rule . ' event:' . $events, $e);
                }
            }
            else if (is_array($events)){
                foreach($events as $filter => $event){
                    try{
                        $router->bind($routing_rule, $filter, $event);
                    }
                    catch(RoutingRuleBindingException $e)
                    {
                        throw new RouterBuildingException('Rule binding failed:' . $routing_rule . ' event:' . $event . ' filter:' . $filter, $e);
                    }
                }
            }
        }
        return $router;
    }
1279314
@Override
    protected void configure()
    {
        final ExportBuilder builder = MBeanModule.newExporter(binder());
        builder.export(CollectorController.class).as("com.ning.metrics.eventtracker:name=CollectorController");
    }
1355970
public void configure() throws Exception {

        final Namespaces ns = new Namespaces("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
        ns.add("indexing", "http://fedora.info/definitions/v4/indexing#");
        ns.add("ldp", "http://www.w3.org/ns/ldp#");


        /*
         * A generic error handler (specific to this RouteBuilder)
         */
        onException(Exception.class)
            .maximumRedeliveries("{{error.maxRedeliveries}}")
            .log("Index Routing Error: ${routeId}");

        /*
         * route a message to the proper queue, based on whether
         * it is a DELETE or UPDATE operation.
         */
        from("{{input.stream}}")
            .routeId("FcrepoSolrRouter")
            .process(new EventProcessor())
            .choice()
                .when(or(header(FCREPO_EVENT_TYPE).contains(RESOURCE_DELETION),
                            header(FCREPO_EVENT_TYPE).contains(DELETE)))
                    .to("direct:delete.solr")
                .otherwise()
                    .to("direct:index.solr");

        /*
         * Handle re-index events
         */
        from("{{solr.reindex.stream}}")
            .routeId("FcrepoSolrReindex")
            .to("direct:index.solr");

        /*
         * Based on an item's metadata, determine if it is indexable.
         */
        from("direct:index.solr")
            .routeId("FcrepoSolrIndexer")
            .removeHeaders("CamelHttp*")
            .filter(not(in(tokenizePropertyPlaceholder(getContext(), "{{filter.containers}}", ",").stream()
                        .map(uri -> or(
                            header(FCREPO_URI).startsWith(constant(uri + "/")),
                            header(FCREPO_URI).isEqualTo(constant(uri))))
                        .collect(toList()))))
            .choice()
                .when(and(simple("{{indexing.predicate}} != 'true'"),
                          simple("{{fcrepo.checkHasIndexingTransformation}} != 'true'")))
                    .setHeader(INDEXING_TRANSFORMATION).simple("{{fcrepo.defaultTransform}}")
                    .to("direct:update.solr")
                .otherwise()
                    .to("fcrepo:{{fcrepo.baseUrl}}?preferOmit=PreferContainment&accept=application/rdf+xml")
                    .setHeader(INDEXING_TRANSFORMATION).xpath(hasIndexingTransformation, String.class, ns)
                    .choice()
                        .when(or(header(INDEXING_TRANSFORMATION).isNull(),
                                 header(INDEXING_TRANSFORMATION).isEqualTo("")))
                            .setHeader(INDEXING_TRANSFORMATION).simple("{{fcrepo.defaultTransform}}").end()
                    .removeHeaders("CamelHttp*")
                    .choice()
                        .when(or(simple("{{indexing.predicate}} != 'true'"),
                                 header(FCREPO_RESOURCE_TYPE).contains(INDEXABLE)))
                            .to("direct:update.solr")
                        .otherwise()
                            .to("direct:delete.solr");


        /*
         * Remove an item from the solr index.
         */
        from("direct:delete.solr").routeId("FcrepoSolrDeleter")
            .removeHeaders("CamelHttp*")
            .to("mustache:org/fcrepo/camel/indexing/solr/delete.mustache")
            .log(LoggingLevel.INFO, logger, "Deleting Solr Object ${headers[CamelFcrepoUri]}")
            .setHeader(HTTP_METHOD).constant("POST")
            .setHeader(CONTENT_TYPE).constant("application/json")
            .setHeader(HTTP_QUERY).simple("commitWithin={{solr.commitWithin}}")
            .to("{{solr.baseUrl}}/update?useSystemProperties=true");

        from("direct:external.ldpath").routeId("FcrepoSolrLdpathFetch")
            .removeHeaders("CamelHttp*")
            .setHeader(HTTP_URI).header(INDEXING_TRANSFORMATION)
            .setHeader(HTTP_METHOD).constant("GET")
            .to("http4://localhost/ldpath");

        from("direct:transform.ldpath").routeId("FcrepoSolrTransform")
            .removeHeaders("CamelHttp*")
            .setHeader(HTTP_URI).simple("{{ldpath.service.baseUrl}}")
            .setHeader(HTTP_QUERY).simple("context=${headers.CamelFcrepoUri}")
            .to("http4://localhost/ldpath");

        /*
         * Handle update operations
         */
        from("direct:update.solr").routeId("FcrepoSolrUpdater")
            .log(LoggingLevel.INFO, logger, "Indexing Solr Object ${header.CamelFcrepoUri}")
            .setBody(constant(null))
            .setHeader(INDEXING_URI).simple("${header.CamelFcrepoUri}")
            // Don't index the transformation itself
            .filter().simple("${header.CamelIndexingTransformation} != ${header.CamelIndexingUri}")
                .choice()
                    .when(header(INDEXING_TRANSFORMATION).startsWith("http"))
                        .log(LoggingLevel.INFO, logger,
                                "Fetching external LDPath program from ${header.CamelIndexingTransformation}")
                        .to("direct:external.ldpath")
                        .setHeader(HTTP_METHOD).constant("POST")
                        .to("direct:transform.ldpath")
                        .to("direct:send.to.solr")
                    .when(or(header(INDEXING_TRANSFORMATION).isNull(), header(INDEXING_TRANSFORMATION).isEqualTo("")))
                        .setHeader(HTTP_METHOD).constant("GET")
                        .to("direct:transform.ldpath")
                        .to("direct:send.to.solr")
                    .otherwise()
                        .log(LoggingLevel.INFO, logger, "Skipping ${header.CamelFcrepoUri}");

        /*
         * Send the transformed resource to Solr
         */
        from("direct:send.to.solr").routeId("FcrepoSolrSend")
            .removeHeaders("CamelHttp*")
            .setHeader(HTTP_METHOD).constant("POST")
            .setHeader(HTTP_QUERY).simple("commitWithin={{solr.commitWithin}}")
            .to("{{solr.baseUrl}}/update?useSystemProperties=true");
    }
2921
public function build()
    {
        $routeCollection = new RouteCollection();

        foreach ($this->routes as $name => $route) {
            if ($route instanceof Route) {
                $route->setDefaults(array_merge($this->defaults, $route->getDefaults()));
                $route->setOptions(array_merge($this->options, $route->getOptions()));

                foreach ($this->requirements as $key => $val) {
                    if (!$route->hasRequirement($key)) {
                        $route->setRequirement($key, $val);
                    }
                }

                if (null !== $this->prefix) {
                    $route->setPath('/'.$this->prefix.$route->getPath());
                }

                if (!$route->getHost()) {
                    $route->setHost($this->host);
                }

                if (!$route->getCondition()) {
                    $route->setCondition($this->condition);
                }

                if (!$route->getSchemes()) {
                    $route->setSchemes($this->schemes);
                }

                if (!$route->getMethods()) {
                    $route->setMethods($this->methods);
                }

                // auto-generate the route name if it's been marked
                if ('_unnamed_route_' === substr($name, 0, 15)) {
                    $name = $this->generateRouteName($route);
                }

                $routeCollection->add($name, $route);
            } else {
                /* @var self $route */
                $subCollection = $route->build();
                $subCollection->addPrefix($this->prefix);

                $routeCollection->addCollection($subCollection);
            }
        }

        foreach ($this->resources as $resource) {
            $routeCollection->addResource($resource);
        }

        return $routeCollection;
    }
644594
@Override
    protected void configure()
    {
        final ExportBuilder builder = MBeanModule.newExporter(binder());
        builder.export(ScribeSender.class).as("eventtracker:name=ScribeSender");
        install(new CollectorControllerMBeanModule());
    }
813394
function build(iRouterStack $router)
    {
        foreach($this->routes as $routeName => $routeValuable)
        {
            $route = $routeValuable;

            if ( is_string($routeName) && is_array($routeValuable) ) {
                // when route provided as array options
                $route = $this->_attainRouteFromArray($routeName, $routeValuable);
                $override = (isset($routeValuable['override']))  ? $routeValuable['override'] : true;
                $priority = (isset($routeValuable['priority']))  ? $routeValuable['priority'] : null;
            }

            if (! $route instanceof  iRoute )
                throw new \InvalidArgumentException(sprintf(
                    'Invalid argument provided. ("%s")'
                    , \Poirot\Std\flatten($routeValuable)
                ));



            # add router
            if ( isset($override) && isset($priority) )
                ## just if override option provided
                $router->add($route, $override, $priority);
            else
                ## using default value
                $router->add($route);
        }
    }
345684
public void buildAndWrite() {

		try {
			RouterController routerController = RequestContextUtils
					.findWebApplicationContext(this.request)
					.getBean(RouterController.class);

			routerController.writeJsonResponse(this.request, this.response,
					this.extDirectResponse, this.jsonView);

		}
		catch (IOException e) {
			LogFactory.getLog(getClass()).error("buildAndWrite", e);
			throw new RuntimeException(e);
		}

	}
156174
private function build() {
        $this->getAbstractClass()->setDocumentation($this->getComment());
        $this->getAbstractClass()->setName(ucfirst($this->getTableName()));
        $this->getAbstractClass()->addUse(
            $this->getConfiguration()->getRootNamespace()
            . '\Models\\' . $this->getConfiguration()->getModelSubNamespace()
            . '\Base'
        );
        $this->getAbstractClass()->addUse('Bullhorn\FastRest\Api\Models\GeneratedInterface');
        $this->getAbstractClass()->setImplements(['GeneratedInterface']);
        $this->getAbstractClass()->setNamespace(
            $this->getConfiguration()->getRootNamespace()
            . '\Models\\' . $this->getConfiguration()->getModelSubNamespace()
            . '\Generated'
        );
        $this->getAbstractClass()->addUse(
            $this->getConfiguration()->getRootNamespace()
            . '\Models\\' . $this->getConfiguration()->getModelSubNamespace()
            . '\\' . ucfirst($this->getTableName()) . ' as ChildModel'
        );
        $this->getAbstractClass()->setExtends('Base');
        $this->getAbstractClass()->setAbstract(true);
        $this->buildIdField();

        $this->buildEnumConstants();

        $this->buildInitialize();
        $this->buildFieldsTypes();
        $this->buildVariableDefinitions();
        $this->buildOnConstruct();

        $this->buildGetSource();
        $this->buildAddJoin();

        $this->buildFindFirst();
        $this->buildFind();

        $this->buildGettersAndSetters();
        $this->buildRelationshipGetters();
        $this->buildColumnMap();
        $this->buildRelationshipsList();
    }
626332
public ConfigurationProvider build() {
    LOG.info("Initializing ConfigurationProvider with "
        + configurationSource.getClass().getCanonicalName() + " source, "
        + reloadStrategy.getClass().getCanonicalName() + " reload strategy and "
        + environment.getClass().getCanonicalName() + " environment");

    final CachedConfigurationSource cachedConfigurationSource = new CachedConfigurationSource(configurationSource);
    if (metricRegistry != null) {
      configurationSource = new MeteredConfigurationSource(metricRegistry, prefix, cachedConfigurationSource);
    }
    cachedConfigurationSource.init();

    Reloadable reloadable = () -> cachedConfigurationSource.reload(environment);

    if (metricRegistry != null) {
      reloadable = new MeteredReloadable(metricRegistry, prefix, reloadable);
    }
    reloadable.reload();
    reloadStrategy.register(reloadable);

    SimpleConfigurationProvider configurationProvider = new SimpleConfigurationProvider(cachedConfigurationSource, environment);
    if (metricRegistry != null) {
      return new MeteredConfigurationProvider(metricRegistry, prefix, configurationProvider);
    }

    return configurationProvider;
  }
902832
private function buildRoutes(): void
    {
        if ($this->loaded['routes']) {
            return;
        }

        $this->loaded['routes'] = true;

        $this->routes = new RouteCollection(
            $this->getBaseCodeRoute(),
            $this->getBaseRouteName(),
            $this->getBaseRoutePattern(),
            $this->getBaseControllerName()
        );

        $this->routeBuilder->build($this, $this->routes);

        $this->configureRoutes($this->routes);

        foreach ($this->getExtensions() as $extension) {
            $extension->configureRoutes($this, $this->routes);
        }
    }