|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.cluster.ClusterNode
public class ClusterNode
Default clustered node implementation.
Field Summary | |
---|---|
static String |
SYSTEM_PROPERTY_NODE_ID
System property specifying a node id to use. |
Constructor Summary | |
---|---|
ClusterNode()
|
Method Summary | |
---|---|
void |
consume(Record record)
Consume a record. |
LockEventChannel |
createLockChannel(String workspace)
Create a LockEventChannel for some workspace. |
UpdateEventChannel |
createUpdateChannel(String workspace)
Create an UpdateEventChannel for some workspace. |
void |
ended(DefaultClusterOperation operation,
boolean successful)
Invoked when a cluster operation has ended. |
protected String |
getClusterNodeIdFromFile()
Return a cluster node from a file, creating it if necessary. |
String |
getId()
Return the unique identifier of the records this consumer will be able to handle. |
Journal |
getJournal()
Return the journal created by this cluster node. |
long |
getRevision()
Return the revision this consumer has last seen. |
long |
getStopDelay()
Return the stop delay. |
protected void |
init()
Initialize this cluster node (overridable). |
void |
init(ClusterContext clusterContext)
Initialize this cluster node. |
void |
process(ChangeLogRecord record)
Process a change log record. |
void |
process(LockRecord record)
Process a lock record. |
void |
process(NamespaceRecord record)
Process a namespace record. |
void |
process(NodeTypeRecord record)
Process a node type record |
void |
process(WorkspaceRecord record)
Process a workspace record |
void |
registered(Collection ntDefs)
Called when one or more node types have been registered. |
void |
remapped(String oldPrefix,
String newPrefix,
String uri)
Called when a namespace has been remapped. |
void |
reregistered(NodeTypeDef ntDef)
Called when a node types has been re-registered. |
void |
run()
Run loop that will sync this node after some delay. |
void |
setListener(NamespaceEventListener listener)
Set listener that will receive information about incoming, external namespace events. |
void |
setListener(NodeTypeEventListener listener)
Set listener that will receive information about incoming, external node type events. |
void |
setListener(WorkspaceListener listener)
|
void |
setRevision(long revision)
Set the revision this consumer has last seen. |
void |
setStopDelay(long stopDelay)
Set the stop delay, i.e. number of millseconds to wait for the synchronization thread to stop. |
void |
start()
Starts this cluster node. |
void |
stop()
Stops this cluster node. |
void |
sync()
Synchronize contents from journal. |
void |
unregistered(Collection qnames)
Called when one or more node types have been unregistered. |
void |
workspaceCreated(String workspaceName,
ClonedInputSource inputSource)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SYSTEM_PROPERTY_NODE_ID
Constructor Detail |
---|
public ClusterNode()
Method Detail |
---|
public void init(ClusterContext clusterContext) throws ClusterException
ClusterException
- if an error occursprotected void init() throws ClusterException
ClusterException
- if an error occurspublic void setStopDelay(long stopDelay)
stopDelay
- stop delay in millisecondspublic long getStopDelay()
setStopDelay(long)
public void start() throws ClusterException
ClusterException
- if an error occurspublic void run()
run
in interface Runnable
public void sync() throws ClusterException
ClusterException
- if an error occurspublic void stop()
public UpdateEventChannel createUpdateChannel(String workspace)
UpdateEventChannel
for some workspace.
workspace
- workspace name
public LockEventChannel createLockChannel(String workspace)
LockEventChannel
for some workspace.
workspace
- workspace name
public Journal getJournal()
protected String getClusterNodeIdFromFile() throws IOException
IOException
- if an I/O error occurspublic void remapped(String oldPrefix, String newPrefix, String uri)
remapped
in interface NamespaceEventChannel
oldPrefix
- old prefix. if null
this is a fresh mappingnewPrefix
- new prefix. if null
this is an unmap operationuri
- uri to map prefix topublic void setListener(NamespaceEventListener listener)
NamespaceEventChannel
setListener
in interface NamespaceEventChannel
listener
- namespace event listenerpublic void registered(Collection ntDefs)
registered
in interface NodeTypeEventChannel
ntDefs
- collection of node type definitionspublic void reregistered(NodeTypeDef ntDef)
reregistered
in interface NodeTypeEventChannel
ntDef
- node type definitionpublic void unregistered(Collection qnames)
unregistered
in interface NodeTypeEventChannel
qnames
- collection of node type qnamespublic void setListener(NodeTypeEventListener listener)
setListener
in interface NodeTypeEventChannel
listener
- node type event listenerpublic String getId()
getId
in interface RecordConsumer
public long getRevision()
getRevision
in interface RecordConsumer
public void consume(Record record)
consume
in interface RecordConsumer
record
- record to consumepublic void setRevision(long revision)
setRevision
in interface RecordConsumer
revision
- revisionpublic void process(ChangeLogRecord record)
process
in interface ClusterRecordProcessor
record
- change log recordpublic void process(LockRecord record)
process
in interface ClusterRecordProcessor
record
- lock recordpublic void process(NamespaceRecord record)
process
in interface ClusterRecordProcessor
record
- namespace recordpublic void process(NodeTypeRecord record)
process
in interface ClusterRecordProcessor
record
- node type recordpublic void process(WorkspaceRecord record)
ClusterRecordProcessor
process
in interface ClusterRecordProcessor
record
- workspace recordpublic void setListener(WorkspaceListener listener)
setListener
in interface WorkspaceEventChannel
public void workspaceCreated(String workspaceName, ClonedInputSource inputSource)
workspaceCreated
in interface WorkspaceEventChannel
public void ended(DefaultClusterOperation operation, boolean successful)
successful
,
attempts to fill the journal record and update it, otherwise cancels
the update.
operation
- cluster operationsuccessful
- true
if the operation was successful and
the journal record should be updated;
false
to revoke changes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |