|
ModeShape Distribution 3.2.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.bus.ClusteredRepositoryChangeBus
@ThreadSafe public final class ClusteredRepositoryChangeBus
Implementation of a ChangeBus
which can run in a cluster, via JGroups. This bus wraps around another bus, to which it
delegates all "local" processing of events.
Nested Class Summary | |
---|---|
protected class |
ClusteredRepositoryChangeBus.Listener
|
protected class |
ClusteredRepositoryChangeBus.ObjectInputStreamWithClassLoader
ObjectInputStream extention that allows a different class loader to be used when resolving types. |
protected class |
ClusteredRepositoryChangeBus.Receiver
|
Field Summary | |
---|---|
protected RepositoryConfiguration.Clustering |
clusteringConfiguration
The clustering configuration |
protected ChangeBus |
delegate
The wrapped standalone bus to which standard bus operations are delegated |
protected AtomicBoolean |
isOpen
Flag that dictates whether this bus has connected to the cluster. |
protected static Logger |
LOGGER
|
protected AtomicBoolean |
multipleAddressesInCluster
Flag that dictates whether there are multiple participants in the cluster; if not, then the changes are propagated only to the local observers. |
Constructor Summary | |
---|---|
ClusteredRepositoryChangeBus(RepositoryConfiguration.Clustering clusteringConfiguration,
ChangeBus delegate)
|
Method Summary | |
---|---|
protected ChangeSet |
deserialize(byte[] data)
|
boolean |
hasObservers()
Checks if there are any observers registered with the bus. |
boolean |
isStarted()
Return whether this bus has been started and not yet shut down . |
protected void |
logReceivedOperation(ChangeSet changeSet)
|
protected void |
logSendOperation(ChangeSet changeSet)
|
void |
notify(ChangeSet changeSet)
|
boolean |
register(ChangeSetListener observer)
Register the supplied observer. |
protected byte[] |
serialize(ChangeSet changes)
|
void |
shutdown()
Shuts down the change bus, closing and clearing resources created during ChangeBus.start() |
void |
start()
Starts up the change bus. |
boolean |
unregister(ChangeSetListener observer)
Unregister the supplied observer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Logger LOGGER
protected final ChangeBus delegate
protected final AtomicBoolean isOpen
protected final AtomicBoolean multipleAddressesInCluster
protected final RepositoryConfiguration.Clustering clusteringConfiguration
Constructor Detail |
---|
public ClusteredRepositoryChangeBus(RepositoryConfiguration.Clustering clusteringConfiguration, ChangeBus delegate)
Method Detail |
---|
public void start() throws Exception
ChangeBus
start
in interface ChangeBus
Exception
- if anything unexpected fails during startup.public boolean hasObservers()
ChangeBus
hasObservers
in interface ChangeBus
true
if there are any registered observers, false
otherwisepublic boolean isStarted()
started
and not yet shut down
.
start()
has been called but shutdown()
has not, or false otherwisepublic void shutdown()
ChangeBus
ChangeBus.start()
shutdown
in interface ChangeBus
public void notify(ChangeSet changeSet)
notify
in interface ChangeSetListener
protected final void logSendOperation(ChangeSet changeSet)
protected final void logReceivedOperation(ChangeSet changeSet)
public boolean register(ChangeSetListener observer)
Observable
register
in interface Observable
observer
- the observer to be added; may be null
public boolean unregister(ChangeSetListener observer)
Observable
unregister
in interface Observable
observer
- the observer to be removed; may not be null
protected byte[] serialize(ChangeSet changes) throws Exception
Exception
protected ChangeSet deserialize(byte[] data) throws Exception
Exception
|
ModeShape Distribution 3.2.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |