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, standardRemoveAll
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public 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 null
protected 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.TimeoutException
public void startSynchronously(TimeValue timeout) throws java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutException
public void stopSynchronously()
public void stopSynchronously(long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutException
public void stopSynchronously(TimeValue timeout) throws java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutException
public 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()