Class SvnOperationRunner<V,T extends SvnOperation<V>>
- java.lang.Object
-
- org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner<V,T>
-
- All Implemented Interfaces:
ISVNCanceller
,ISVNEventHandler
,ISvnOperationRunner<V,T>
- Direct Known Subclasses:
SvnLocalOperationRunner
,SvnRemoteOperationRunner
public abstract class SvnOperationRunner<V,T extends SvnOperation<V>> extends java.lang.Object implements ISvnOperationRunner<V,T>, ISVNEventHandler
-
-
Field Summary
Fields Modifier and Type Field Description private T
operation
private SVNWCContext
wcContext
-
Fields inherited from interface org.tmatesoft.svn.core.ISVNCanceller
NULL
-
Fields inherited from interface org.tmatesoft.svn.core.wc.ISVNEventHandler
UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description SvnOperationRunner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
checkCancelled()
Checks if the current operation is cancelled (somehow interrupted) and should throw an SVNCancelException or notify the handler if exists.T
getOperation()
protected SVNWCContext
getWcContext()
protected void
handleEvent(SVNEvent event)
void
handleEvent(SVNEvent event, double progress)
Handles the current event.void
reset(SvnWcGeneration wcGeneration)
Resets runner's working copy generation.protected abstract V
run()
V
run(T operation)
Implementation of operation'srun
method for concrete working copy generationvoid
setOperation(T operation)
void
setWcContext(SVNWCContext context)
Sets operation's context-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tmatesoft.svn.core.wc2.ISvnOperationRunner
getWcGeneration, isApplicable
-
-
-
-
Field Detail
-
operation
private T extends SvnOperation<V> operation
-
wcContext
private SVNWCContext wcContext
-
-
Method Detail
-
run
public V run(T operation) throws SVNException
Description copied from interface:ISvnOperationRunner
Implementation of operation'srun
method for concrete working copy generation- Specified by:
run
in interfaceISvnOperationRunner<V,T extends SvnOperation<V>>
- Parameters:
operation
- operation that needs to be executed- Returns:
- execution result value of operation's return type
- Throws:
SVNException
-
reset
public void reset(SvnWcGeneration wcGeneration)
Description copied from interface:ISvnOperationRunner
Resets runner's working copy generation.- Specified by:
reset
in interfaceISvnOperationRunner<V,T extends SvnOperation<V>>
- Parameters:
wcGeneration
- new working copy generation for the runner
-
setWcContext
public void setWcContext(SVNWCContext context)
Description copied from interface:ISvnOperationRunner
Sets operation's context- Specified by:
setWcContext
in interfaceISvnOperationRunner<V,T extends SvnOperation<V>>
- Parameters:
context
- context of the operation
-
getWcContext
protected SVNWCContext getWcContext()
-
run
protected abstract V run() throws SVNException
- Throws:
SVNException
-
setOperation
public void setOperation(T operation)
-
getOperation
public T getOperation()
-
checkCancelled
public void checkCancelled() throws SVNCancelException
Description copied from interface:ISVNCanceller
Checks if the current operation is cancelled (somehow interrupted) and should throw an SVNCancelException or notify the handler if exists. This method is often called during iterations when processing trees of versioned items. This way the entire operation may be interrupted without waiting till the iteration run out.- Specified by:
checkCancelled
in interfaceISVNCanceller
- Throws:
SVNCancelException
-
handleEvent
public void handleEvent(SVNEvent event, double progress) throws SVNException
Description copied from interface:ISVNEventHandler
Handles the current event.Generally all operations represented by do*() methods of SVN*Client objects are followed by generating a sequence of events that are passed to the registered ISVNEventHandler object for custom processing. For example, during an update operation each local item being modified is signaled about by dispatching a specific for this item SVNEvent object to this method where this event can be scrutinized and handled in a desired way.
- Specified by:
handleEvent
in interfaceISVNEventHandler
- Parameters:
event
- the current event that keeps detailed information on the type of action occured and other attributes like path, status, etc.progress
- currently reserved for future use; now it's value is always set toISVNEventHandler.UNKNOWN
- Throws:
SVNException
-
handleEvent
protected void handleEvent(SVNEvent event) throws SVNException
- Throws:
SVNException
-
-