Builds a PipeConnectionEvent with a source pipe and provider.

@param source pipe that triggers this event
@param type event type
@param provider the provider
@param paramMap parameters map
@return event
335968
public final static PipeConnectionEvent build(AbstractPipe source, EventType type, IProvider provider, Map<String, Object> paramMap) {
        return new PipeConnectionEvent(source, type, provider, paramMap);
    }
1201003
@Override
    public void supplierChanged(SupplierEvent supplierEvent) {
        SupplierEvent.Type type = supplierEvent.type();
        @SuppressWarnings("unchecked")
        Supplier<T> supplier = (Supplier<T>) supplierEvent.supplier();
        switch (type) {
            case ADD:
                if (supplierReference.compareAndSet(null, supplier)) {
                    supplierFutureRef.get().complete(supplier);
                }
                break;
            case REMOVE:
                if (supplierReference.compareAndSet(supplier, null)) {
                    supplierFutureRef.set(new CompletableFuture<>());
                }
                break;
            default:
                throw new IllegalStateException("Unknown supplier event: " + supplierEvent);
        }
    }
1021830
public static void fireCmsEvent(int type, Map<String, Object> data) {

        OpenCmsCore.getInstance().getEventManager().fireEvent(type, data);
    }
1341977
public static DataSource createDataSource(String source, String type, String config){
		DataSourceProvider dsp = dataSourceProviders.get(type);
		if (dsp == null){
			log.error("Unknown data source type for '" + source + "': " + type);
			return null;
		}
		
		DataSource ds = null;
		ds = dsp.createDataSource(source, config);
		if (ds != null){
			log.info("Data source created for: " + source);
		}else{
			log.error("Creation of data source failed for: " + source);
		}
		
		return ds;
	}
715508
public static <T> ParameterBuilder<T> create(String name, Class<T> type) {
    return new ParameterBuilder<T>()
        .name(name)
        .type(type);
  }
788659
@NonNull
    public SourceParams setTypeRaw(@NonNull String typeRaw) {
        mType = Source.asSourceType(typeRaw);
        mTypeRaw = typeRaw;
        return this;
    }
772455
@Override
    public <T> PluggableProviderService<T> createPluginService(Class<T> type, final String serviceName) {
        //load provider service implementation via java ServiceLoader if available
        PluggableProviderService<T> pluginProviderService = ServiceTypes.getPluginProviderService(type, serviceName, this);
        if (null != pluginProviderService) {
            return pluginProviderService;
        }

        //otherwise construct default service implementation
        BasePluginProviderService<T> basePluginProviderService = new BasePluginProviderService<T>(
                serviceName,
                type
        );
        basePluginProviderService.setRundeckServerServiceProviderLoader(this);
        return basePluginProviderService;
    }
114135
protected <H extends EventHandler> HandlerRegistration addHandler(final H handler, GwtEvent.Type<H> type) {

        return ensureHandlers().addHandlerToSource(type, this, handler);
    }
1302709
@SuppressWarnings({"unchecked"})
  public static <T extends MessageBundle> T create(final Class<T> type) {
    checkNotNull(type);
    return (T) Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, new Handler(type));
  }
197164
public <S, D> TypeMap<S, D> getOrCreate(S source, Class<S> sourceType, Class<D> destinationType,
      String typeMapName, MappingEngineImpl engine) {
    return getOrCreate(source, sourceType, destinationType, typeMapName, null, null,
        engine);
  }
1371300
@Process(actionType = CreateConnector.class)
    public void createConnector(final CreateConnector action, final Dispatcher.Channel channel) {

        final List<Property> connectors = getModelsFor(action.getAddressTemplate());
        // First create the connector, then create the security=sasl singleton and finally
        // create the sasl-policy=policy singleton
        Outcome<FunctionContext> outcome = new Outcome<FunctionContext>() {
            @Override
            public void onFailure(FunctionContext context) {
                channel.nack(context.getError());
            }

            @Override
            public void onSuccess(FunctionContext context) {
                lastModifiedInstance = action.getInstanceName();
                read(action.getAddressTemplate().getResourceType(), getModelsFor(action.getAddressTemplate()), channel);
            }
        };

        AddressTemplate securityAddress = action.getAddressTemplate().append("security=" + SASL_SINGLETON);
        AddressTemplate policyAddress = securityAddress.append("sasl-policy=" + POLICY_SINGLETON);
        new Async<FunctionContext>(new Progress.Nop()).waterfall(new FunctionContext(), outcome,
                new CreateConnectorFn(dispatcher, statementContext, action.getAddressTemplate(),
                        action.getInstanceName(), action.getNewModel()),
                new CreateSaslSingleton(dispatcher, statementContext, action.getInstanceName(), securityAddress),
                new CreateSaslSingleton(dispatcher, statementContext, action.getInstanceName(), policyAddress));
    }
1342970
static ServerSocketChannelUDT newAcceptorChannelUDT(
            final TypeUDT type) {
        try {
            return SelectorProviderUDT.from(type).openServerSocketChannel();
        } catch (final IOException e) {
            throw new ChannelException("failed to open a server socket channel", e);
        }
    }
1171952
@SuppressWarnings("unchecked")
    protected <K, V, T extends RedisChannelHandler<K, V>> ConnectionFuture<T> initializeChannelAsync(
            ConnectionBuilder connectionBuilder) {

        Mono<SocketAddress> socketAddressSupplier = connectionBuilder.socketAddress();

        if (clientResources.eventExecutorGroup().isShuttingDown()) {
            throw new IllegalStateException("Cannot connect, Event executor group is terminated.");
        }

        CompletableFuture<SocketAddress> socketAddressFuture = new CompletableFuture<>();
        CompletableFuture<Channel> channelReadyFuture = new CompletableFuture<>();

        socketAddressSupplier.doOnError(socketAddressFuture::completeExceptionally).doOnNext(socketAddressFuture::complete)
                .subscribe(redisAddress -> {

                    if (channelReadyFuture.isCancelled()) {
                        return;
                    }
                    initializeChannelAsync0(connectionBuilder, channelReadyFuture, redisAddress);
                }, channelReadyFuture::completeExceptionally);

        return new DefaultConnectionFuture<>(socketAddressFuture, channelReadyFuture.thenApply(channel -> (T) connectionBuilder
                .connection()));
    }
367073
public function createConnection(array $params, Configuration $config = null, EventManager $eventManager = null, array $mappingTypes = [])
    {
        if (isset($params['dbname'])) {
            $dbName = $this->getDbNameFromEnv($params['dbname']);
        } else {
            $dbName = $this->getDbNameFromEnv($params['master']['dbname']);
        }

        if ('pdo_sqlite' === $params['driver']) {
            if (isset($params['path'])) {
                $params['path'] = str_replace('__DBNAME__', $dbName, $params['path']);
            }

            if (isset($params['master']['path'])) {
                $params['master']['path'] = str_replace('__DBNAME__', $dbName, $params['master']['path']);
            }

            if (!empty($params['slaves'])) {
                foreach ($params['slaves'] as &$slave) {
                    $slave['path'] = str_replace('__DBNAME__', $dbName, $slave['path']);
                }
            }
        } else {
            $params['dbname'] = $dbName;
        }

        return parent::createConnection($params, $config, $eventManager, $mappingTypes);
    }
1010549
public void sendWithBulkProcessor(Map<String, ?> source, String index,
            String type, String id) {
        sendWithBulkProcessor(
                buildIndexRequest(index, type, id).source(source));
    }
1026403
private static void populateLambdaArgs(Class<?> functionalInterface, final Class<?> lambdaType,
      Map<TypeVariable<?>, Type> map) {
    if (RESOLVES_LAMBDAS) {
      // Find SAM
      for (Method m : functionalInterface.getMethods()) {
        if (!isDefaultMethod(m) && !Modifier.isStatic(m.getModifiers()) && !m.isBridge()) {
          // Skip methods that override Object.class
          Method objectMethod = OBJECT_METHODS.get(m.getName());
          if (objectMethod != null && Arrays.equals(m.getTypeParameters(), objectMethod.getTypeParameters()))
            continue;

          // Get functional interface's type params
          Type returnTypeVar = m.getGenericReturnType();
          Type[] paramTypeVars = m.getGenericParameterTypes();

          Member member = getMemberRef(lambdaType);
          if (member == null)
            return;

          // Populate return type argument
          if (returnTypeVar instanceof TypeVariable) {
            Class<?> returnType = member instanceof Method ? ((Method) member).getReturnType()
                : ((Constructor<?>) member).getDeclaringClass();
            returnType = wrapPrimitives(returnType);
            if (!returnType.equals(Void.class))
              map.put((TypeVariable<?>) returnTypeVar, returnType);
          }

          Class<?>[] arguments = member instanceof Method ? ((Method) member).getParameterTypes()
              : ((Constructor<?>) member).getParameterTypes();

          // Populate object type from arbitrary object method reference
          int paramOffset = 0;
          if (paramTypeVars.length > 0 && paramTypeVars[0] instanceof TypeVariable
              && paramTypeVars.length == arguments.length + 1) {
            Class<?> instanceType = member.getDeclaringClass();
            map.put((TypeVariable<?>) paramTypeVars[0], instanceType);
            paramOffset = 1;
          }

          // Handle additional arguments that are captured from the lambda's enclosing scope
          int argOffset = 0;
          if (paramTypeVars.length < arguments.length) {
            argOffset = arguments.length - paramTypeVars.length;
          }

          // Populate type arguments
          for (int i = 0; i + argOffset < arguments.length; i++) {
            if (paramTypeVars[i] instanceof TypeVariable)
              map.put((TypeVariable<?>) paramTypeVars[i + paramOffset], wrapPrimitives(arguments[i + argOffset]));
          }

          return;
        }
      }
    }
  }
235321
@SuppressWarnings("unused")
    public void onPipeConnectionEvent(PipeConnectionEvent event) {
        switch (event.getType()) {
            case PROVIDER_CONNECT_PUSH:
                //log.debug("Provider connect");
                if (event.getProvider() == this && event.getSource() != connMsgOut && (event.getParamMap() == null || !event.getParamMap().containsKey("record"))) {
                    livePipe = (IPipe) event.getSource();
                    //log.debug("Provider: {}", livePipe.getClass().getName());
                    for (IConsumer consumer : livePipe.getConsumers()) {
                        subscriberStats.increment();
                    }
                }
                break;
            case PROVIDER_DISCONNECT:
                //log.debug("Provider disconnect");
                //if (log.isDebugEnabled() && livePipe != null) {
                //log.debug("Provider: {}", livePipe.getClass().getName());
                //}
                if (livePipe == event.getSource()) {
                    livePipe = null;
                }
                break;
            case CONSUMER_CONNECT_PUSH:
                //log.debug("Consumer connect");
                IPipe pipe = (IPipe) event.getSource();
                //if (log.isDebugEnabled() && pipe != null) {
                //log.debug("Consumer: {}", pipe.getClass().getName());
                //}
                if (livePipe == pipe) {
                    notifyChunkSize();
                }
                subscriberStats.increment();
                break;
            case CONSUMER_DISCONNECT:
                //log.debug("Consumer disconnect: {}", event.getSource().getClass().getName());
                subscriberStats.decrement();
                break;
            default:
        }
    }