javax.inject.Provider Java Examples

The following examples show how to use javax.inject.Provider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PrimitiveAdapter.java    From Graywater with Apache License 2.0 6 votes vote down vote up
@Inject
public PrimitiveAdapter(final Map<Class<? extends PrimitiveViewHolder>, ViewHolderCreator> viewHolderCreatorMapClass,
                        @NonNull final Map<Class<? extends Primitive>,
		                        Provider<ItemBinder<
				                        ? extends Primitive,
				                        ? extends PrimitiveViewHolder,
				                        ? extends Binder<? extends Primitive, PrimitiveViewHolder, ? extends PrimitiveViewHolder>>>>
		                        itemBinderMap,
                        @NonNull final Map<Class<? extends Primitive>,
		                        Provider<GraywaterAdapter.ActionListener<
				                        ? extends Primitive,
				                        PrimitiveViewHolder,
				                        ? extends PrimitiveViewHolder>>> actionListenerMap) {

	for (Map.Entry<Class<? extends PrimitiveViewHolder>, ViewHolderCreator> entry : viewHolderCreatorMapClass.entrySet()) {
		register(entry.getValue(), entry.getKey());
	}

	mItemBinderMap = itemBinderMap;
	mActionListenerMap = actionListenerMap;
}
 
Example #2
Source File: TransactionMap.java    From linstor-server with GNU General Public License v3.0 6 votes vote down vote up
public TransactionMap(
    Map<KEY, VALUE> mapRef,
    MapDatabaseDriver<KEY, VALUE> driver,
    Provider<TransactionMgr> transMgrProviderRef
)
{
    super(transMgrProviderRef);
    map = mapRef;
    if (driver == null)
    {
        dbDriver = new NoOpMapDatabaseDriver<>();
    }
    else
    {
        dbDriver = driver;
    }

    oldValues = new HashMap<>();
}
 
Example #3
Source File: UserRPCServer.java    From dremio-oss with Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
UserRPCServer(
    RpcConfig rpcConfig,
    Provider<UserService> userServiceProvider,
    Provider<NodeEndpoint> nodeEndpointProvider,
    WorkIngestor workIngestor,
    Provider<UserWorker> worker,
    BufferAllocator allocator,
    EventLoopGroup eventLoopGroup,
    InboundImpersonationManager impersonationManager,
    Tracer tracer,
    OptionValidatorListing optionValidatorListing
    ) {
  super(rpcConfig, allocator.getAsByteBufAllocator(), eventLoopGroup);
  this.userServiceProvider = userServiceProvider;
  this.nodeEndpointProvider = nodeEndpointProvider;
  this.workIngestor = workIngestor;
  this.worker = worker;
  this.allocator = allocator;
  this.impersonationManager = impersonationManager;
  this.sessionOptionManagerFactory = new SessionOptionManagerFactoryImpl(optionValidatorListing);
  this.tracer = tracer;
}
 
Example #4
Source File: SampleDataPopulatorService.java    From dremio-oss with Apache License 2.0 6 votes vote down vote up
public SampleDataPopulatorService(
  Provider<SabotContext> contextProvider,
  Provider<LegacyKVStoreProvider> kvStore,
  Provider<UserService> userService,
  Provider<InitializerRegistry> init,
  Provider<JobsService> jobsService,
  Provider<CatalogService> catalogService,
  Provider<ReflectionServiceHelper> reflectionHelper,
  Provider<ConnectionReader> connectionReader,
  Provider<CollaborationHelper> collaborationService,
  Provider<OptionManager> optionManager,
  boolean prepopulate,
  boolean addDefaultUser) {
  this.contextProvider = contextProvider;
  this.kvStore = kvStore;
  this.userService = userService;
  this.init = init;
  this.jobsService = jobsService;
  this.catalogService = catalogService;
  this.reflectionHelper = reflectionHelper;
  this.connectionReader = connectionReader;
  this.collaborationService = collaborationService;
  this.optionManager = optionManager;
  this.prepopulate = prepopulate;
  this.addDefaultUser = addDefaultUser;
}
 
Example #5
Source File: ResourceControllerFactory.java    From linstor-server with GNU General Public License v3.0 6 votes vote down vote up
@Inject
public ResourceControllerFactory(
    ResourceDatabaseDriver dbDriverRef,
    ObjectProtectionFactory objectProtectionFactoryRef,
    PropsContainerFactory propsContainerFactoryRef,
    TransactionObjectFactory transObjFactoryRef,
    Provider<TransactionMgr> transMgrProviderRef,
    CtrlRscLayerDataFactory layerStackHelperRef
)
{
    dbDriver = dbDriverRef;
    objectProtectionFactory = objectProtectionFactoryRef;
    propsContainerFactory = propsContainerFactoryRef;
    transObjFactory = transObjFactoryRef;
    transMgrProvider = transMgrProviderRef;
    layerStackHelper = layerStackHelperRef;
}
 
Example #6
Source File: NodeSatelliteFactory.java    From linstor-server with GNU General Public License v3.0 6 votes vote down vote up
@Inject
public NodeSatelliteFactory(
    NodeDatabaseDriver dbDriverRef,
    ObjectProtectionFactory objectProtectionFactoryRef,
    StorPoolSatelliteFactory storPoolFactoryRef,
    PropsContainerFactory propsContainerFactoryRef,
    TransactionObjectFactory transObjFactoryRef,
    FreeSpaceMgrSatelliteFactory freeSpaceMgrFactoryRef,
    Provider<TransactionMgr> transMgrProviderRef,
    CoreModule.NodesMap nodesMapRef
)
{
    dbDriver = dbDriverRef;
    objectProtectionFactory = objectProtectionFactoryRef;
    storPoolFactory = storPoolFactoryRef;
    propsContainerFactory = propsContainerFactoryRef;
    transObjFactory = transObjFactoryRef;
    freeSpaceMgrFactory = freeSpaceMgrFactoryRef;
    transMgrProvider = transMgrProviderRef;
    nodesMap = nodesMapRef;
}
 
Example #7
Source File: CmdSetConfValue.java    From linstor-server with GNU General Public License v3.0 6 votes vote down vote up
@Inject
public CmdSetConfValue(
    DbConnectionPool dbConnectionPoolRef,
    @Named(CoreModule.CTRL_CONF_LOCK) ReadWriteLock confLockRef,
    SystemConfRepository systemConfRepositoryRef,
    Provider<TransactionMgr> trnActProviderRef
)
{
    super(
        new String[]
        {
            "SetCfgVal"
        },
        "Set configuration value",
        "Sets the value of a configuration entry.\nIf the entry does not exist, it is created.",
        PARAMETER_DESCRIPTIONS,
        null
    );

    dbConnectionPool = dbConnectionPoolRef;
    confWrLock = confLockRef.writeLock();
    systemConfRepository = systemConfRepositoryRef;
    trnActProvider = trnActProviderRef;
}
 
Example #8
Source File: GraywaterAdapter.java    From Graywater with Apache License 2.0 6 votes vote down vote up
/**
 * @param itemPosition
 * 		the item position.
 * @return the range of viewholders that represent the item. The first is the offset, the second is the count.
 */
@Nullable
public Pair<Integer, Integer> getViewHolderRange(final int itemPosition) {
	final Pair<Integer, Integer> range;

	if (isItemPositionWithinBounds(itemPosition)) {
		final int numViewHolders = getViewHolderCount(itemPosition);

		final List<Provider<Binder<? super T, VH, ? extends VH>>> binders = mBinderListCache.get(itemPosition);

		range = new Pair<>(numViewHolders, binders.size());
	} else {
		range = null;
	}

	return range;
}
 
Example #9
Source File: IntFullSyncResponse.java    From linstor-server with GNU General Public License v3.0 6 votes vote down vote up
@Inject
public IntFullSyncResponse(
    ScopeRunner scopeRunnerRef,
    @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef,
    @Named(CoreModule.STOR_POOL_DFN_MAP_LOCK) ReadWriteLock storPoolDfnMapLockRef,
    StorPoolInternalCallHandler storPoolApiCallHandlerRef,
    CtrlFullSyncResponseApiCallHandler ctrlFullSyncApiCallHandlerRef,
    Provider<Peer> satelliteProviderRef
)
{
    scopeRunner = scopeRunnerRef;
    nodesMapLock = nodesMapLockRef;
    storPoolDfnMapLock = storPoolDfnMapLockRef;
    storPoolApiCallHandler = storPoolApiCallHandlerRef;
    ctrlFullSyncApiCallHandler = ctrlFullSyncApiCallHandlerRef;
    satelliteProvider = satelliteProviderRef;
}
 
Example #10
Source File: TestZKClusterClient.java    From dremio-oss with Apache License 2.0 6 votes vote down vote up
@Test
public void testDefaultConnection() throws Exception {
  // Default root from sabot-module.conf
  assertNull(zooKeeperServer.getZKClient().exists("/dremio/test-path", false));

  final SabotConfig config = DEFAULT_SABOT_CONFIG
      .withValue(ZK_ROOT, ConfigValueFactory.fromAnyRef("dremio/test-path"))
      .withValue(CLUSTER_ID, ConfigValueFactory.fromAnyRef("test-cluster-id"));

  try(ZKClusterClient client = new ZKClusterClient(config, new Provider<Integer>() {
    @Override
    public Integer get() {
      return zooKeeperServer.getPort();
    }
  })) {
    client.start();
    ZKServiceSet serviceSet = client.newServiceSet("coordinator");
    serviceSet.register(NodeEndpoint.newBuilder().setAddress("foo").build());


    Stat stat = zooKeeperServer.getZKClient().exists("/dremio/test-path/test-cluster-id/coordinator", false);
    assertNotNull(stat);
    assertEquals(1, stat.getNumChildren());
  }
}
 
Example #11
Source File: CtrlVlmListApiCallHandler.java    From linstor-server with GNU General Public License v3.0 6 votes vote down vote up
@Inject
public CtrlVlmListApiCallHandler(
    ErrorReporter errorReporterRef,
    ScopeRunner scopeRunnerRef,
    VlmAllocatedFetcher vlmAllocatedFetcherRef,
    ResourceDefinitionRepository resourceDefinitionRepositoryRef,
    NodeRepository nodeRepositoryRef,
    LockGuardFactory lockGuardFactoryRef,
    @PeerContext Provider<AccessContext> peerAccCtxRef
)
{
    errorReporter = errorReporterRef;
    scopeRunner = scopeRunnerRef;
    vlmAllocatedFetcher = vlmAllocatedFetcherRef;
    resourceDefinitionRepository = resourceDefinitionRepositoryRef;
    nodeRepository = nodeRepositoryRef;
    lockGuardFactory = lockGuardFactoryRef;
    peerAccCtx = peerAccCtxRef;
}
 
Example #12
Source File: ProviderExtensionSupport.java    From smallrye-jwt with Apache License 2.0 6 votes vote down vote up
/**
 * Collect the types of all {@linkplain Provider} injection points annotated with {@linkplain Claim}.
 *
 * @param pip - the injection point event information
 */
void processClaimProviderInjections(@Observes ProcessInjectionPoint<?, ? extends Provider> pip) {
    CDILogging.log.pip(pip.getInjectionPoint());
    final InjectionPoint ip = pip.getInjectionPoint();
    if (ip.getAnnotated().isAnnotationPresent(Claim.class)) {
        Claim claim = ip.getAnnotated().getAnnotation(Claim.class);
        if (claim.value().length() == 0 && claim.standard() == Claims.UNKNOWN) {
            pip.addDefinitionError(CDIMessages.msg.claimHasNoNameOrValidStandardEnumSetting(ip));
        }
        boolean usesEnum = claim.standard() != Claims.UNKNOWN;
        final String claimName = usesEnum ? claim.standard().name() : claim.value();
        CDILogging.log.checkingProviderClaim(claimName, ip);
        Type matchType = ip.getType();
        // The T from the Provider<T> injection site
        Type actualType = ((ParameterizedType) matchType).getActualTypeArguments()[0];
        // Don't add Optional or JsonValue as this is handled specially
        if (isOptional(actualType)) {
            // Validate that this is not an Optional<JsonValue>
            Type innerType = ((ParameterizedType) actualType).getActualTypeArguments()[0];
            if (!isJson(innerType)) {
                providerOptionalTypes.add(actualType);
                providerQualifiers.add(claim);
            }
        }
    }
}
 
Example #13
Source File: ResourceGroupControllerFactory.java    From linstor-server with GNU General Public License v3.0 6 votes vote down vote up
@Inject
public ResourceGroupControllerFactory(
    ResourceGroupDatabaseDriver driverRef,
    ObjectProtectionFactory objectProtectionFactoryRef,
    PropsContainerFactory propsContainerFactoryRef,
    TransactionObjectFactory transObjFactoryRef,
    Provider<TransactionMgr> transMgrProviderRef,
    ResourceGroupRepository resourceGroupRepositoryRef
)
{
    driver = driverRef;
    objectProtectionFactory = objectProtectionFactoryRef;
    propsContainerFactory = propsContainerFactoryRef;
    transObjFactory = transObjFactoryRef;
    transMgrProvider = transMgrProviderRef;
    rscGrpRepository = resourceGroupRepositoryRef;
}
 
Example #14
Source File: OpenflexLayerETCDDriver.java    From linstor-server with GNU General Public License v3.0 6 votes vote down vote up
@Inject
public OpenflexLayerETCDDriver(
    @SystemContext AccessContext dbCtxRef,
    ErrorReporter errorReporterRef,
    ResourceLayerIdDatabaseDriver idDriverRef,
    TransactionObjectFactory transObjFactoryRef,
    Provider<TransactionMgrETCD> transMgrProviderRef
)
{
    super(transMgrProviderRef);
    dbCtx = dbCtxRef;
    errorReporter = errorReporterRef;
    idDriver = idDriverRef;
    transObjFactory = transObjFactoryRef;

    nqnDriver = new NqnDriver();
}
 
Example #15
Source File: ObjectProtectionSQLDbDriver.java    From linstor-server with GNU General Public License v3.0 6 votes vote down vote up
@Inject
public ObjectProtectionSQLDbDriver(
    @SystemContext AccessContext accCtx,
    ErrorReporter errorReporterRef,
    TransactionObjectFactory transObjFactoryRef,
    Provider<TransactionMgrSQL> transMgrProviderRef
)
{
    dbCtx = accCtx;
    transMgrProvider = transMgrProviderRef;
    identityDriver = new IdentityGenericDbDriver();
    roleDriver = new RoleGenericDbDriver();
    securityTypeDriver = new SecurityTypeGenericDbDriver();
    errorReporter = errorReporterRef;
    transObjFactory = transObjFactoryRef;
}
 
Example #16
Source File: TokenManagerImpl.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
public TokenManagerImpl(final Provider<LegacyKVStoreProvider> kvProvider,
                        final Provider<SchedulerService> schedulerService,
                        final Provider<OptionManager> optionManagerProvider,
                        final boolean isMaster,
                        final DACConfig config) {
  this(kvProvider,
      schedulerService,
      optionManagerProvider,
      isMaster,
      config.getConfig().getInt(DremioConfig.WEB_TOKEN_CACHE_SIZE),
      config.getConfig().getInt(DremioConfig.WEB_TOKEN_CACHE_EXPIRATION));
}
 
Example #17
Source File: VolumeControllerFactory.java    From linstor-server with GNU General Public License v3.0 5 votes vote down vote up
@Inject
public VolumeControllerFactory(
    VolumeDatabaseDriver driverRef,
    PropsContainerFactory propsContainerFactoryRef,
    TransactionObjectFactory transObjFactoryRef,
    Provider<TransactionMgr> transMgrProviderRef,
    CtrlRscLayerDataFactory layerStackHelperRef
)
{
    driver = driverRef;
    propsContainerFactory = propsContainerFactoryRef;
    transObjFactory = transObjFactoryRef;
    transMgrProvider = transMgrProviderRef;
    layerStackHelper = layerStackHelperRef;
}
 
Example #18
Source File: LuksLayer.java    From linstor-server with GNU General Public License v3.0 5 votes vote down vote up
@Inject
public LuksLayer(
    @DeviceManagerContext AccessContext sysCtxRef,
    CryptSetupCommands cryptSetupRef,
    ExtCmdFactory extCmdFactoryRef,
    Provider<DeviceHandler> resourceProcessorRef,
    ErrorReporter errorReporterRef
)
{
    sysCtx = sysCtxRef;
    cryptSetup = cryptSetupRef;
    extCmdFactory = extCmdFactoryRef;
    resourceProcessorProvider = resourceProcessorRef;
    errorReporter = errorReporterRef;
}
 
Example #19
Source File: PhysicalPlanReaderTestFactory.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
public static PhysicalPlanReader defaultPhysicalPlanReader(
    SabotConfig c,
    ScanResult scanResult,
    Provider<CatalogService> catalogService) {
  SabotContext sabotContext = Mockito.mock(SabotContext.class);
  Mockito.when(sabotContext.getConnectionReaderProvider())
    .thenReturn(DirectProvider.wrap(ConnectionReader.of(DremioTest.CLASSPATH_SCAN_RESULT, DremioTest.DEFAULT_SABOT_CONFIG)));
  return new PhysicalPlanReader(
      c, scanResult, new LogicalPlanPersistence(c, scanResult),
      CoordinationProtos.NodeEndpoint.getDefaultInstance(),
      catalogService, sabotContext);
}
 
Example #20
Source File: PaletteItemBinder.java    From Graywater with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public List<Provider<? extends GraywaterAdapter.Binder<Palette, PrimitiveViewHolder, ? extends PrimitiveViewHolder>>>
getBinderList(@NonNull final Palette model, final int position) {
	return new ArrayList<Provider<? extends GraywaterAdapter.Binder<Palette, PrimitiveViewHolder, ? extends PrimitiveViewHolder>>>() {{
		add(mPaletteTextPrimitiveBinder);

		for (int color : model.getColors()) {
			add(mPaletteColorBinder);
		}
	}};
}
 
Example #21
Source File: UnlinkedMapOfProviderBinding.java    From dagger-reflect with Apache License 2.0 5 votes vote down vote up
@Override
public LinkedBinding<Map<Object, Provider<Object>>> link(Linker linker, Scope scope) {
  Map<Object, Provider<Object>> mapOfProviders = new LinkedHashMap<>(entryBindings.size());
  for (Map.Entry<Object, Binding> entryBinding : entryBindings.entrySet()) {
    LinkedBinding<Object> binding =
        (LinkedBinding<Object>) entryBinding.getValue().link(linker, scope);
    mapOfProviders.put(entryBinding.getKey(), binding);
  }
  return new LinkedInstanceBinding<>(mapOfProviders);
}
 
Example #22
Source File: ModuleHolder.java    From react-native-GPay with MIT License 5 votes vote down vote up
public ModuleHolder(ReactModuleInfo moduleInfo, Provider<? extends NativeModule> provider) {
  mName = moduleInfo.name();
  mCanOverrideExistingModule = moduleInfo.canOverrideExistingModule();
  mHasConstants = moduleInfo.hasConstants();
  mProvider = provider;
  mIsCxxModule = moduleInfo.isCxxModule();
  if (moduleInfo.needsEagerInit()) {
    mModule = create();
  }
}
 
Example #23
Source File: Hive3StoragePluginConfig.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
@Override
public StoragePlugin newPlugin(SabotContext context, String name, Provider<StoragePluginId> pluginIdProvider) {
  final PluginManager manager = new NativeLibPluginManager();

  manager.loadPlugins();
  manager.startPlugin(getPf4jPluginId());
  final StoragePluginCreator pluginCreator =
    manager.getExtensions(StoragePluginCreator.class, getPf4jPluginId()).get(0);

  return pluginCreator.createStoragePlugin(manager, this, context, name, pluginIdProvider);
}
 
Example #24
Source File: VolumeConnectionDbDriver.java    From linstor-server with GNU General Public License v3.0 5 votes vote down vote up
@Inject
public VolumeConnectionDbDriver(
    @SystemContext AccessContext dbCtxRef,
    ErrorReporter errorReporterRef,
    DbEngine dbEngineRef,
    Provider<TransactionMgr> transMgrProviderRef,
    ObjectProtectionDatabaseDriver objProtDriverRef,
    PropsContainerFactory propsContainerFactoryRef,
    TransactionObjectFactory transObjFactoryRef
)
{
    super(errorReporterRef, GeneratedDatabaseTables.VOLUME_CONNECTIONS, dbEngineRef, objProtDriverRef);
    dbCtx = dbCtxRef;
    transMgrProvider = transMgrProviderRef;
    propsContainerFactory = propsContainerFactoryRef;
    transObjFactory = transObjFactoryRef;

    setColumnSetter(UUID, vc -> vc.getUuid().toString());
    setColumnSetter(
        NODE_NAME_SRC,
        vc -> vc.getSourceVolume(dbCtxRef).getAbsResource().getNode().getName().value
    );
    setColumnSetter(
        NODE_NAME_DST,
        vc -> vc.getTargetVolume(dbCtxRef).getAbsResource().getNode().getName().value
    );
    setColumnSetter(
        RESOURCE_NAME,
        vc -> vc.getSourceVolume(dbCtxRef).getAbsResource().getDefinition().getName().value
    );

    setColumnSetter(VLM_NR, vc -> vc.getSourceVolume(dbCtxRef).getVolumeDefinition().getVolumeNumber().value);

    setColumnSetter(SNAPSHOT_NAME, ignored -> DFLT_SNAP_NAME_FOR_RSC);
}
 
Example #25
Source File: CtrlNodeDeleteApiCallHandler.java    From linstor-server with GNU General Public License v3.0 5 votes vote down vote up
@Inject
public CtrlNodeDeleteApiCallHandler(
    @ApiContext AccessContext apiCtxRef,
    ScopeRunner scopeRunnerRef,
    Provider<CtrlSatelliteConnectionNotifier> ctrlSatelliteConnectionNotifierRef,
    CtrlTransactionHelper ctrlTransactionHelperRef,
    CtrlApiDataLoader ctrlApiDataLoaderRef,
    NodeRepository nodeRepositoryRef,
    CtrlSatelliteUpdateCaller ctrlSatelliteUpdateCallerRef,
    ResponseConverter responseConverterRef,
    LockGuardFactory lockGuardFactoryRef,
    @PeerContext Provider<AccessContext> peerAccCtxRef,
    CtrlSnapshotDeleteApiCallHandler ctrlSnapshotDeleteApiCallHandlerRef
)
{
    apiCtx = apiCtxRef;
    scopeRunner = scopeRunnerRef;
    ctrlSatelliteConnectionNotifier = ctrlSatelliteConnectionNotifierRef;
    ctrlTransactionHelper = ctrlTransactionHelperRef;
    ctrlApiDataLoader = ctrlApiDataLoaderRef;
    nodeRepository = nodeRepositoryRef;
    ctrlSatelliteUpdateCaller = ctrlSatelliteUpdateCallerRef;
    responseConverter = responseConverterRef;
    lockGuardFactory = lockGuardFactoryRef;
    peerAccCtx = peerAccCtxRef;
    ctrlSnapshotDeleteApiCallHandler = ctrlSnapshotDeleteApiCallHandlerRef;
}
 
Example #26
Source File: ConduitServer.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
public ConduitServer(
  Provider<ConduitServiceRegistry> registryProvider,
  int port,
  Optional<SSLEngineFactory> sslEngineFactory
) {
  this.registryProvider = registryProvider;
  this.sslEngineFactory = sslEngineFactory;
  this.serverBuilder = NettyServerBuilder.forPort(port);
  this.closeableServices = new ArrayList<>();
}
 
Example #27
Source File: DrbdVlmData.java    From linstor-server with GNU General Public License v3.0 5 votes vote down vote up
public DrbdVlmData(
    AbsVolume<RSC> vlmRef,
    DrbdRscData<RSC> rscDataRef,
    DrbdVlmDfnData<RSC> vlmDfnDataRef,
    StorPool extMetaDataStorPoolRef,
    DrbdLayerDatabaseDriver dbDriverRef,
    TransactionObjectFactory transObjFactoryRef,
    Provider<? extends TransactionMgr> transMgrProvider
)
{
    super(transMgrProvider);

    vlm = vlmRef;
    rscData = rscDataRef;
    vlmDfnData = vlmDfnDataRef;

    exists = false;
    failed = false;

    checkMetaData = true;
    isMetaDataNew = false;

    externalMetaDataStorPool = transObjFactoryRef.createTransactionSimpleObject(
        this,
        extMetaDataStorPoolRef,
        dbDriverRef.getExtStorPoolDriver()
    );

    states = transObjFactoryRef.createTransactionList(this, new ArrayList<>(), null);

    transObjs = Arrays.asList(
        vlm,
        rscData,
        vlmDfnData,
        states
    );
}
 
Example #28
Source File: CtrlSnapshotRestoreApiCallHandler.java    From linstor-server with GNU General Public License v3.0 5 votes vote down vote up
@Inject
public CtrlSnapshotRestoreApiCallHandler(
    ScopeRunner scopeRunnerRef,
    CtrlTransactionHelper ctrlTransactionHelperRef,
    CtrlSnapshotHelper ctrlSnapshotHelperRef,
    CtrlRscCrtApiHelper ctrlRscCrtApiHelperRef,
    CtrlVlmCrtApiHelper ctrlVlmCrtApiHelperRef,
    CtrlApiDataLoader ctrlApiDataLoaderRef,
    ResponseConverter responseConverterRef,
    Provider<Peer> peerRef,
    @PeerContext Provider<AccessContext> peerAccCtxRef,
    LockGuardFactory lockGuardFactoryRef,
    CtrlRscAutoHelper ctrlRscAutoHelperRef,
    CtrlPropsHelper ctrlPropsHelperRef
)
{
    scopeRunner = scopeRunnerRef;
    ctrlTransactionHelper = ctrlTransactionHelperRef;
    ctrlSnapshotHelper = ctrlSnapshotHelperRef;
    ctrlRscCrtApiHelper = ctrlRscCrtApiHelperRef;
    ctrlVlmCrtApiHelper = ctrlVlmCrtApiHelperRef;
    ctrlApiDataLoader = ctrlApiDataLoaderRef;
    responseConverter = responseConverterRef;
    peer = peerRef;
    peerAccCtx = peerAccCtxRef;
    lockGuardFactory = lockGuardFactoryRef;
    autoHelper = ctrlRscAutoHelperRef;
    ctrlPropsHelper = ctrlPropsHelperRef;
}
 
Example #29
Source File: ViewModelFactory.java    From ground-android with Apache License 2.0 5 votes vote down vote up
/**
 * Instantiates a new instance of the specified view model, injecting required dependencies.
 */
@Override
public <T extends ViewModel> T create(Class<T> modelClass) {
  Provider<? extends ViewModel> creator = creators.get(modelClass);
  if (creator == null) {
    throw new IllegalArgumentException("Unknown model class " + modelClass);
  }
  return (T) creator.get();
}
 
Example #30
Source File: ReqVlmAllocated.java    From linstor-server with GNU General Public License v3.0 5 votes vote down vote up
@Inject
public ReqVlmAllocated(
    ScopeRunner scopeRunnerRef,
    StltApiCallHandlerUtils apiCallHandlerUtilsRef,
    CommonSerializer commonSerializerRef,
    @Named(ApiModule.API_CALL_ID) Provider<Long> apiCallIdProviderRef
)
{
    scopeRunner = scopeRunnerRef;
    apiCallHandlerUtils = apiCallHandlerUtilsRef;
    commonSerializer = commonSerializerRef;
    apiCallIdProvider = apiCallIdProviderRef;
}