lombok.Synchronized.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中lombok.Synchronized.<init>()方法的一些代码示例,展示了Synchronized.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Synchronized.<init>()方法的具体详情如下:
包路径:lombok.Synchronized
类名称:Synchronized
方法名:<init>

Synchronized.<init>介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-gobblin

/**
 * Start the {@link TaskScheduler}.
 *
 * @param name the name of the {@link TaskScheduler}
 */
@Synchronized
final void start(Optional<String> name) {
 if (!this.isStarted) {
  this.startImpl(name);
  this.isStarted = true;
 }
}

代码示例来源:origin: apache/incubator-gobblin

/**
 * Closes this {@link TaskScheduler}, ensuring that new tasks cannot be created
 * and cancelling existing tasks.
 *
 * @throws IOException if an I/O error occurs
 */
@Override
@Synchronized
public final void close() throws IOException {
 if (this.isStarted) {
  this.isStarted = false;
  this.closeImpl();
 }
}

代码示例来源:origin: apache/incubator-gobblin

/**
  * Return a StreamEncryptor for the given algorithm and with appropriate parameters.
  * @param algorithm Algorithm to build
  * @param parameters Parameters for algorithm
  * @return A StreamCodec for that algorithm
  * @throws IllegalArgumentException If the given algorithm/parameter pair cannot be built
  */
 @Synchronized
 public static StreamCodec buildStreamCryptoProvider(String algorithm, Map<String, Object> parameters) {
  for (EncryptionProvider provider : encryptionProviderLoader) {
   log.debug("Looking for algorithm {} in provider {}", algorithm, provider.getClass().getName());
   StreamCodec codec = provider.buildStreamCryptoProvider(algorithm, parameters);
   if (codec != null) {
    log.debug("Found algorithm {} in provider {}", algorithm, provider.getClass().getName());
    return codec;
   }
  }

  throw new IllegalArgumentException("Could not find a provider to build algorithm " + algorithm + " - is gobblin-crypto-provider in classpath?");
 }
}

代码示例来源:origin: apache/incubator-gobblin

/**
  * Build a CredentialStore with the given config parameters. The type will be extracted from the parameters.
  * See {@link EncryptionConfigParser} for a set of standard configuration parameters, although
  * each encryption provider may have its own arbitrary set.
  * @return A CredentialStore for the given parameters
  * @throws IllegalArgumentException If no provider exists that can build the requested encryption codec
  */
 @Synchronized
 public static CredentialStore buildCredentialStore(Map<String, Object> parameters) {
  String credType = EncryptionConfigParser.getKeystoreType(parameters);

  for (CredentialStoreProvider provider : credentialStoreProviderLoader) {
   log.debug("Looking for cred store type {} in provider {}", credType, provider.getClass().getName());
   CredentialStore credStore = provider.buildCredentialStore(parameters);
   if (credStore != null) {
    log.debug("Found cred store type {} in provider {}", credType, provider.getClass().getName());
    return credStore;
   }
  }

  throw new IllegalArgumentException("Could not find a provider to build algorithm " + credType + " - is gobblin-crypto-provider in classpath?");
 }
}

代码示例来源:origin: testcontainers/testcontainers-java

@Synchronized
public DockerClient client() {

代码示例来源:origin: SpigotMC/BungeeCord

@Override
@Synchronized("pluginChannels")
public void unregisterChannel(String channel)
{
  pluginChannels.remove( channel );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Override
@Synchronized("pluginChannels")
public Collection<String> getChannels()
{
  return Collections.unmodifiableCollection( pluginChannels );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Synchronized("players")
public void addPlayer(ProxiedPlayer player)
{
  players.add( player );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Override
@Synchronized("pluginChannels")
public void registerChannel(String channel)
{
  pluginChannels.add( channel );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Synchronized("players")
public void removePlayer(ProxiedPlayer player)
{
  players.remove( player );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Synchronized("players")
@Override
public Collection<ProxiedPlayer> getPlayers()
{
  return Collections.unmodifiableCollection( new HashSet<>( players ) );
}

代码示例来源:origin: aol/cyclops

@Synchronized("lock")
public void removeQueue(final Queue<T> q) {
   subscribers = subscribers.removeValue(q);
}

代码示例来源:origin: aol/cyclops

@Synchronized("lock")
public void addQueue(final Queue<T> q) {
  subscribers = subscribers.append(q);
}

代码示例来源:origin: aol/cyclops

@Synchronized("lock")
private <R> ReactiveSeq<R> connect(final Function<Queue<T>, ReactiveSeq<R>> streamCreator) {
  final Queue<T> queue = this.getNextQueue();
  final ReactiveSeq<R> stream = streamCreator.apply(queue);
  this.streamToQueue = streamToQueue.put(stream, queue);
  return stream;
}

代码示例来源:origin: aol/cyclops

/**
 * Topic will maintain a queue for each Subscribing Stream
 * If a Stream is finished with a Topic it is good practice to disconnect from the Topic
 * so messages will no longer be stored for that Stream
 *
 * @param stream
 */
@Synchronized("lock")
public void disconnect(final ReactiveSeq<T> stream) {
 Option<Queue<T>> o = streamToQueue.get(stream);
  distributor.removeQueue(streamToQueue.getOrElse(stream, new Queue<>()));
  this.streamToQueue = streamToQueue.remove(stream);
  this.index--;
}

代码示例来源:origin: pravega/pravega

/**
 * Adds stream name to the scope.
 *
 * @param stream Name of stream to be added.
 */
@Synchronized
public void addStreamToScope(String stream) {
  this.streamsInScope.add(stream);
}

代码示例来源:origin: pravega/pravega

@Override
@Synchronized
public CompletableFuture<List<String>> listScopes() {
  return CompletableFuture.completedFuture(new ArrayList<>(scopes.keySet()));
}

代码示例来源:origin: pravega/pravega

@Synchronized
@Override
public CompletableFuture<List<String>> getStreamsForBucket(int bucket, Executor executor) {
  if (bucketedStreams.containsKey(bucket)) {
    return CompletableFuture.completedFuture(Collections.unmodifiableList(bucketedStreams.get(bucket)));
  } else {
    return CompletableFuture.completedFuture(Collections.emptyList());
  }
}

代码示例来源:origin: pravega/pravega

@Override
@Synchronized
public Map<String, Position> getPositions(final String process, final String readerGroup) {
  return Collections.unmodifiableMap(map.get(getKey(process, readerGroup)).getMap());
}

代码示例来源:origin: pravega/pravega

@Override
@Synchronized
public CompletableFuture<String> getScopeConfiguration(final String scopeName) {
  if (scopes.containsKey(scopeName)) {
    return CompletableFuture.completedFuture(scopeName);
  } else {
    return Futures.failedFuture(StoreException.create(StoreException.Type.DATA_NOT_FOUND, scopeName));
  }
}

相关文章

Synchronized类方法