本文整理了Java中com.atlassian.util.concurrent.NotNull.<init>()
方法的一些代码示例,展示了NotNull.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NotNull.<init>()
方法的具体详情如下:
包路径:com.atlassian.util.concurrent.NotNull
类名称:NotNull
方法名:<init>
暂无
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Execute the supplied {@link Callable} under a lock determined by the
* descriptor.
*
* @param <R> the result type
* @param callable the operation to perform under lock
* @return whatever the supplied {@link Callable} returns
* @throws Exception if the supplied {@link Callable} throws an exception
*/
<R> R withLock(final @NotNull Callable<R> callable) throws Exception;
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Execute the supplied {@link Runnable} under a lock determined by the
* descriptor.
*
* @param runnable the operation to perform under lock
*/
void withLock(final @NotNull Runnable runnable);
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* A {@link Supplier} of {@link ReentrantReadWriteLock read write locks}.
*
* @return lock factory
*/
static @NotNull com.atlassian.util.concurrent.Supplier<ReadWriteLock> readWriteLockFactory() {
return new com.atlassian.util.concurrent.Supplier<ReadWriteLock>() {
public ReadWriteLock get() {
return new ReentrantReadWriteLock();
}
};
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Execute the supplied {@link Supplier} under a lock determined by the
* descriptor.
* <p>
* Unlike {@link #withLock(Callable)} this version returns a result and does
* not declare a checked exception.
*
* @param <R> the result type
* @param supplier the operation to perform under lock
* @return whatever the supplied {@link Callable} returns
*/
<R> R withLock(final @NotNull Supplier<R> supplier);
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* A {@link Supplier} of {@link ReentrantLock locks}.
*
* @return lock factory
*/
static @NotNull com.atlassian.util.concurrent.Supplier<Lock> lockFactory() {
return new com.atlassian.util.concurrent.Supplier<Lock>() {
public Lock get() {
return new ReentrantLock();
}
};
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Get a {@link ManagedLock} that manages the supplied {@link Lock}.
*
* @param lock the lock to use.
* @return a managed lock
*/
public static @NotNull ManagedLock manage(final @NotNull Lock lock) {
return new ManagedLockImpl(lock);
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Get a {@link ManagedLock.ReadWrite} that manages the supplied
* {@link ReadWriteLock}.
*
* @param lock the lock to use.
* @return a managed read write lock
*/
public static @NotNull ManagedLock.ReadWrite manageReadWrite(final @NotNull ReadWriteLock lock) {
return new ReadWriteManagedLock(lock);
}
代码示例来源:origin: org.randombits.supplier/supplier-core
@Override
public void init( @NotNull final Plugin plugin, @NotNull Element element ) throws PluginParseException {
super.init( plugin, element );
supplier = null;
}
代码示例来源:origin: com.atlassian.plugins/base-hipchat-integration-plugin-api
@JsonCreator
public HipChatUserId(@NotNull @JsonProperty ("entityId") final String entityId,
@NotNull @JsonProperty ("hipChatLinkId") HipChatLinkId hipChatLinkId) {
this.entityId = entityId;
this.hipChatLinkId = hipChatLinkId;
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Get a {@link ManagedLock} that manages a {@link ReentrantLock}.
*
* @return a managed lock
*/
public static @NotNull ManagedLock newManagedLock() {
return manage(new ReentrantLock());
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Creates a new SRSW BlockingReference.
*
* @deprecated use {@link #newSRSW()} instead.
*/
@Deprecated public BlockingReference(@NotNull final V value) {
this(new BooleanLatch(), value);
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Construct a new {@link WeakMemoizer} instance.
*
* @param initialCapacity how large the internal map should be initially.
* @param delegate for creating the initial values.
* @throws IllegalArgumentException if the initial capacity of elements is
* negative.
*/
WeakMemoizer(final @NotNull Function<K, V> delegate) {
this.map = new ConcurrentHashMap<K, MappedReference<K, V>>();
this.delegate = notNull("delegate", delegate);
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Create a Builder with the supplied Executor
*
* @param executor
*/
public Builder(@NotNull final Executor executor) {
this.executor = notNull("executor", executor);
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Get a function that uses the Supplier as a factory for all inputs.
*
* @param <D> the key type, ignored
* @param <R> the result type
* @param supplier called for all inputs
* @return the function
*/
public static <D, R> Function<D, R> fromSupplier(final @NotNull Supplier<R> supplier) {
return new FromSupplier<D, R>(supplier);
}
代码示例来源:origin: com.atlassian.labs.hipchat/hipchat-for-jira-plugin
@Override
public Collection<ProjectConfiguration> load(@NotNull Long projectId) {
ProjectConfigurationAO[] projectConfigurationAOs = getAO().find(
ProjectConfigurationAO.class, ProjectConfigurationAO.COLUMN_PROJECT_ID + " = ?", projectId);
return Arrays.<ProjectConfiguration>asList(projectConfigurationAOs);
}
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Get a {@link ThreadFactory} with the required name prefix and type (user or
* daemon). The produced threads have normal priority.
*
* @param name the prefix to use for naming the threads.
* @param type whether they are User or Daemon threads.
* @return a configured {@link ThreadFactory}
*/
public static ThreadFactory namedThreadFactory(@NotNull final String name, @NotNull final Type type) {
return named(name).type(type).build();
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Convenience method that calls
* {@link ManagedLocks#weakManagedLockFactory(Function)} using the
* {@link Functions#identity() identity function} for striping, essentially
* meaning that unique input will have its own lock.
*
* @param <T> the type of the thing used to look up locks
* @see #weakManagedLockFactory(Function, Supplier)
*/
public static @NotNull <T> com.atlassian.util.concurrent.Function<T, ManagedLock> weakManagedLockFactory() {
return weakManagedLockFactory(Functions.<T> identity());
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Set the value of this reference. This method is lock-free. A thread waiting
* in {@link #take()} or {@link #take(long, TimeUnit)} will be released and
* given this value.
*
* @param value the new value.
*/
public void set(@NotNull final V value) {
notNull("value", value);
internalSet(value);
}
代码示例来源:origin: com.atlassian.util.concurrent/atlassian-util-concurrent
/**
* Get a {@link ThreadFactory} with the required name prefix. The produced
* threads are user threads and have normal priority.
*
* @param name the prefix to use for naming the threads.
* @return a configured {@link ThreadFactory}
*/
public static ThreadFactory namedThreadFactory(@NotNull final String name) {
return named(name).build();
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-schema-plugin
@Override
public void init(@NotNull Plugin plugin, @NotNull Element element) throws PluginParseException
{
super.init(plugin, element);
this.type = getOptionalAttribute(element, "type", getKey());
this.schemaFactoryClassName = getOptionalAttribute(element, "schema-factory-class", null);
this.schemaTransformerClassName = getOptionalAttribute(element, "schema-transformer-class", null);
this.maxOccurs = getOptionalAttribute(element, "max-occurs", "unbounded");
this.requiredPermissions = getPermissions(element.element("required-permissions"));
this.optionalPermissions = getPermissions(element.element("optional-permissions"));
}
内容来源于网络,如有侵权,请联系作者删除!