S - the common supertype that all services must sharepublic final class ServiceGroup<S extends Service>
extends com.google.common.collect.ForwardingSet<S>
Service instances user-specified
iteration order. Does not permit null elements.| Modifier and Type | Method and Description |
|---|---|
protected java.util.Set<S> |
delegate() |
<U extends S> |
fetch(java.lang.Class<U> type) |
<U extends S> |
narrow(java.lang.Class<U> type) |
static <S extends Service> |
of()
Returns the empty service group.
|
static <S extends Service> |
of(S service)
Returns a service group containing a single service.
|
static <S extends Service> |
of(S first,
S second)
Returns a service group containing the given services, in order.
|
static <S extends Service> |
of(S first,
S second,
S... rest)
Returns a service group containing the given services, in order.
|
ServiceGroup<S> |
reverse() |
void |
startSynchronously() |
void |
startSynchronously(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
startSynchronously(TimeValue timeout) |
java.util.Map<S,com.google.common.util.concurrent.Service.State> |
states() |
void |
stopSynchronously() |
void |
stopSynchronously(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
stopSynchronously(TimeValue timeout) |
equals, hashCode, standardEquals, standardHashCode, standardRemoveAlladd, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static <S extends Service> ServiceGroup<S> of()
public static <S extends Service> ServiceGroup<S> of(S service)
public static <S extends Service> ServiceGroup<S> of(S first, S second)
Object.equals(java.lang.Object))
after the first are ignored.java.lang.NullPointerException - if any service is null@SafeVarargs public static <S extends Service> ServiceGroup<S> of(S first, S second, S... rest)
Object.equals(java.lang.Object))
after the first are ignored.java.lang.NullPointerException - if any service is nullprotected java.util.Set<S> delegate()
public void startSynchronously()
public void startSynchronously(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutExceptionpublic void startSynchronously(TimeValue timeout) throws java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutExceptionpublic void stopSynchronously()
public void stopSynchronously(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutExceptionpublic void stopSynchronously(TimeValue timeout) throws java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutExceptionpublic java.util.Map<S,com.google.common.util.concurrent.Service.State> states()
public <U extends S> ServiceGroup<U> narrow(java.lang.Class<U> type)
public <U extends S> U fetch(java.lang.Class<U> type)
public ServiceGroup<S> reverse()