org.alfresco.repo.model.filefolder.loader
Class AbstractLoaderThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.alfresco.repo.model.filefolder.loader.AbstractLoaderThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
LoaderCOCIThread, LoaderDeleteThread, LoaderListFoldersThread, LoaderTotalsThread, LoaderUpdateThread, LoaderUploadThread

public abstract class AbstractLoaderThread
extends java.lang.Thread

A description of what the remote loader should do.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.lang.String loaderName
           
protected  LoaderSession session
           
protected  long testLoadDepth
           
protected  long testPeriod
           
protected  long testTotal
           
protected  boolean verbose
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AbstractLoaderThread(LoaderSession session, java.lang.String loaderName, long testPeriod, long testTotal, long testLoadDepth, boolean verbose)
           
 
Method Summary
protected  java.util.List chooseFolderPath()
           
protected  void doAfter(LoaderServerProxy loaderServerProxy, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Run after record stats
protected  void doBefore(LoaderServerProxy loaderServerProxy, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Run before record stats
protected abstract  java.lang.String doLoading(LoaderServerProxy serverProxy, org.alfresco.service.cmr.repository.NodeRef workingRootNodeRef)
           
protected  java.io.File getFile()
           
 java.lang.String getSummary()
           NAME+36\tCOUNT \tTOTAL TIME \tAVERAGE TIME \tPER SECOND \tDESCRIPTION
protected  org.alfresco.service.cmr.repository.NodeRef makeFolders(java.lang.String ticket, LoaderServerProxy serverProxy, org.alfresco.service.cmr.repository.NodeRef workingRootNodeRef, java.util.List folderPath)
          Creates or find the folders based on caching.
 void run()
           
 void setStop()
          Notify the running thread to exit at the first available opportunity.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

session

protected final LoaderSession session

loaderName

protected final java.lang.String loaderName

testPeriod

protected final long testPeriod

testTotal

protected final long testTotal

testLoadDepth

protected final long testLoadDepth

verbose

protected final boolean verbose
Constructor Detail

AbstractLoaderThread

public AbstractLoaderThread(LoaderSession session,
                            java.lang.String loaderName,
                            long testPeriod,
                            long testTotal,
                            long testLoadDepth,
                            boolean verbose)
Method Detail

setStop

public void setStop()
Notify the running thread to exit at the first available opportunity.


run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getSummary

public java.lang.String getSummary()
 NAME+36\tCOUNT          \tTOTAL TIME     \tAVERAGE TIME   \tPER SECOND     \tDESCRIPTION     
 

Returns:
Returns the summary of the results

doLoading

protected abstract java.lang.String doLoading(LoaderServerProxy serverProxy,
                                              org.alfresco.service.cmr.repository.NodeRef workingRootNodeRef)
                                       throws java.lang.Exception
Parameters:
serverProxy - the server to load
workingRootNodeRef - the root of the hierarchy to use
Returns:
a brief description of the loading
Throws:
java.lang.Exception - any exception will be handled

chooseFolderPath

protected java.util.List chooseFolderPath()

getFile

protected java.io.File getFile()
                        throws java.lang.Exception
Throws:
java.lang.Exception

makeFolders

protected org.alfresco.service.cmr.repository.NodeRef makeFolders(java.lang.String ticket,
                                                                  LoaderServerProxy serverProxy,
                                                                  org.alfresco.service.cmr.repository.NodeRef workingRootNodeRef,
                                                                  java.util.List folderPath)
                                                           throws java.lang.Exception
Creates or find the folders based on caching.

Throws:
java.lang.Exception

doBefore

protected void doBefore(LoaderServerProxy loaderServerProxy,
                        org.alfresco.service.cmr.repository.NodeRef nodeRef)
                 throws java.lang.Exception
Run before record stats

Throws:
java.lang.Exception

doAfter

protected void doAfter(LoaderServerProxy loaderServerProxy,
                       org.alfresco.service.cmr.repository.NodeRef nodeRef)
                throws java.lang.Exception
Run after record stats

Throws:
java.lang.Exception


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.