public abstract class AbstractSetBalancer<Z,D extends Database<Z>> extends AbstractBalancer<Z,D>
Balancer
implementation.Modifier | Constructor and Description |
---|---|
protected |
AbstractSetBalancer(Set<D> databases) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(D database) |
boolean |
addAll(Collection<? extends D> databases) |
protected abstract void |
added(D database)
Called when a database was added to the set.
|
void |
clear() |
protected abstract void |
cleared()
Called when the set was cleared.
|
protected Set<D> |
getDatabases() |
protected Lock |
getLock() |
<T,R,E extends Exception> |
invoke(Invoker<Z,D,T,R,E> invoker,
D database,
T object)
Invoke the specified invoker on the specified object against the specified database, potentially informing the balancer.
|
D |
primary()
Returns the primary database.
|
boolean |
remove(Object database) |
boolean |
removeAll(Collection<?> databases) |
protected abstract void |
removed(D database)
Called when a database was removed from the set.
|
boolean |
retainAll(Collection<?> databases) |
backups, contains, containsAll, equals, hashCode, isEmpty, iterator, size, toArray, toArray, toString
protected AbstractSetBalancer(Set<D> databases)
public <T,R,E extends Exception> R invoke(Invoker<Z,D,T,R,E> invoker, D database, T object) throws E extends Exception
T
- invoker target object typeR
- invoker return typeE
- invoker exception typeE
E extends Exception
Balancer.invoke(net.sf.hajdbc.invocation.Invoker, net.sf.hajdbc.Database, java.lang.Object)
public D primary()
Balancer.primary()
protected Set<D> getDatabases()
getDatabases
in class AbstractBalancer<Z,D extends Database<Z>>
AbstractBalancer.getDatabases()
public boolean remove(Object database)
Set.remove(java.lang.Object)
protected abstract void removed(D database)
database
- a database descriptorpublic boolean add(D database)
Set.add(java.lang.Object)
protected abstract void added(D database)
database
- a database descriptorpublic boolean addAll(Collection<? extends D> databases)
Set.addAll(java.util.Collection)
public boolean removeAll(Collection<?> databases)
Set.removeAll(java.util.Collection)
public boolean retainAll(Collection<?> databases)
Set.retainAll(java.util.Collection)
public void clear()
Set.clear()
protected abstract void cleared()
Copyright © 2004–2014 Paul Ferraro. All rights reserved.