de.anneck.jcast.sources
Class SourceController

java.lang.Object
  |
  +--de.anneck.jcast.sources.SourceController
All Implemented Interfaces:
IController

public class SourceController
extends java.lang.Object
implements IController

The SourceController is the central point of reference to all sources. Always use the controller to create, delete, etc. all kinds of sources. The controller is implemented as a Singleton, call getInstance() to get one.

Version:
$Revision: 1.10 $
Author:
andre.anneck@web.de

Method Summary
 java.lang.Object createSource(org.apache.avalon.framework.configuration.Configuration conf, IChannel aChannel)
          Will create a new ISourceThread Instance with the Specified name.
 java.lang.Object createSource(java.lang.String name, IChannel aChannel)
          Will create a new ISourceThread Instance with the Specified name.
 java.lang.Thread createSourceThread(java.lang.String name, IChannel aChannel)
          Will create a new Thread containing an ISourceThread instance with the Specified name.
 boolean exists(java.lang.Object obj)
          Cheacks if specified object is under my control.
 boolean exists(java.lang.String name)
          Checks if specified name is under my control
 java.lang.Object get(java.lang.String name)
          Returns one object, specified by key name.
 java.util.Map getAll()
          Returns a Hashmap of all sources return All sources.
static SourceController getInstance()
          Returns a SourceController.
 void remove(ISource source)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SourceController getInstance()
Returns a SourceController.
Returns:
SourceController

createSourceThread

public java.lang.Thread createSourceThread(java.lang.String name,
                                           IChannel aChannel)
                                    throws JCastException
Will create a new Thread containing an ISourceThread instance with the Specified name. The configuration for the SourceThread has to exists in the jcast-config.xml.
Parameters:
aChannel - The IChannel.
name - The name the ISourceThread, and the xml-tag. Both need to be equal!
Returns:
Thread The SourceThread that was created.

createSource

public java.lang.Object createSource(org.apache.avalon.framework.configuration.Configuration conf,
                                     IChannel aChannel)
                              throws JCastException,
                                     org.apache.avalon.framework.configuration.ConfigurationException
Will create a new ISourceThread Instance with the Specified name. The configuration for the SourceThread has to exists in the jcast-config.xml.
Parameters:
conf - A configuration object, needs to contain .
aChannel - The IChannel.
Returns:
Object The ISourceThread you wanted.

createSource

public java.lang.Object createSource(java.lang.String name,
                                     IChannel aChannel)
                              throws JCastException
Will create a new ISourceThread Instance with the Specified name. The configuration for the SourceThread has to exists in the jcast-config.xml.
Parameters:
name - The name the SourceThread, and the xml-tag. Both need to be equal!
aChannel - The IChannel.
Returns:
Object The ISourceThread you wanted.

getAll

public java.util.Map getAll()
Returns a Hashmap of all sources return All sources.
Specified by:
getAll in interface IController

exists

public boolean exists(java.lang.String name)
Checks if specified name is under my control
Specified by:
exists in interface IController
Parameters:
name - The name of the ISourceThread.

exists

public boolean exists(java.lang.Object obj)
Cheacks if specified object is under my control.
Specified by:
exists in interface IController
Parameters:
obj - The instance of ISourceThread you want to check.

get

public java.lang.Object get(java.lang.String name)
Returns one object, specified by key name.
Specified by:
get in interface IController
Parameters:
name - Key to search for. (Keys are String objects).

remove

public void remove(ISource source)