org.mmbase.streams.createcaches
Class Processor

java.lang.Object
  extended by org.mmbase.streams.createcaches.Processor
All Implemented Interfaces:
Externalizable, Serializable, CommitProcessor

public class Processor
extends Object
implements CommitProcessor, Externalizable

This commit-processor is used on nodes of type 'streamsources' and is used to initiate the conversions to other formats which are saved in 'streamsourcescaches'. Its analogy is derived from the conversion of 'images' in MMBase to their resulting 'icaches' nodes. Several transcodings of media files can be configured with Recognizers and Transcoders.

Version:
$Id: Processor.java 42668 2010-06-24 09:29:47Z andre $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
(package private)  String[] cacheManagers
           
(package private)  List<CommandExecutor.Method> executors
           
protected  Map<String,JobDefinition> list
          List with the configured JobDefinitions.
static String NAMESPACE_CREATECACHES
           
static String NOT
           
protected static Map<Integer,Job> runningJobs
           
 Map<Stage,ThreadPoolExecutor> threadPools
           
protected  ResourceWatcher watcher
           
static String XSD_CREATECACHES
           
 
Constructor Summary
Processor()
           
Processor(String configFile)
           
 
Method Summary
static String cancelJob(Node node)
           
protected  Processor clone()
           
 void commit(Node node, Field field)
          Commits the mediastreamsources node, calls createCaches to create resulting streamscaches nodes and start transcoding.
 Job createCaches(Cloud ntCloud, int node)
           
 Job createCaches(Cloud ntCloud, int node, Map<String,JobDefinition> jdlist)
          Creates caches nodes when not existing (or recreate) by making a transcoding Job
 Map<String,JobDefinition> getConfiguration()
           
 File getDirectory()
           
 List<CommandExecutor.Method> getExecutors()
           
static Job getJob(Node node)
           
protected  void initWatcher()
           
static Set<Job> myJobs(UserContext u)
           
 void readExternal(ObjectInput in)
           
protected static boolean removeJob(Node node)
           
static Collection<Job> runningJobs()
           
 void setCacheManagers(String... cm)
           
 void setConfigFile(String configFile)
           
 void setDirectory(File dir)
           
 void writeExternal(ObjectOutput stream)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT

public static String NOT

XSD_CREATECACHES

public static final String XSD_CREATECACHES
See Also:
Constant Field Values

NAMESPACE_CREATECACHES

public static final String NAMESPACE_CREATECACHES
See Also:
Constant Field Values

list

protected final Map<String,JobDefinition> list
List with the configured JobDefinitions.


cacheManagers

String[] cacheManagers

threadPools

public final Map<Stage,ThreadPoolExecutor> threadPools

executors

final List<CommandExecutor.Method> executors

watcher

protected final ResourceWatcher watcher

runningJobs

protected static final Map<Integer,Job> runningJobs
Constructor Detail

Processor

public Processor()

Processor

Processor(String configFile)
Method Detail

setDirectory

public void setDirectory(File dir)

getDirectory

public File getDirectory()

setCacheManagers

public void setCacheManagers(String... cm)

initWatcher

protected void initWatcher()

setConfigFile

public void setConfigFile(String configFile)

myJobs

public static Set<Job> myJobs(UserContext u)

runningJobs

public static Collection<Job> runningJobs()

getJob

public static Job getJob(Node node)

removeJob

protected static boolean removeJob(Node node)

cancelJob

public static String cancelJob(Node node)

getConfiguration

public Map<String,JobDefinition> getConfiguration()

getExecutors

public List<CommandExecutor.Method> getExecutors()

createCaches

public Job createCaches(Cloud ntCloud,
                        int node)

createCaches

public Job createCaches(Cloud ntCloud,
                        int node,
                        Map<String,JobDefinition> jdlist)
Creates caches nodes when not existing (or recreate) by making a transcoding Job

Parameters:
ntCloud - a non transactional cloud
int - node number of a source node
jdlist - job definitions
Returns:
Job recognizing and/or transcoding the source stream

commit

public void commit(Node node,
                   Field field)
Commits the mediastreamsources node, calls createCaches to create resulting streamscaches nodes and start transcoding.

Specified by:
commit in interface CommitProcessor

clone

protected Processor clone()
                   throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput stream)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException


MMBase 2.0-SNAPSHOT - null