de.anneck.jcast.channels
Class ChannelController

java.lang.Object
  |
  +--de.anneck.jcast.channels.ChannelController
All Implemented Interfaces:
IController

public final class ChannelController
extends java.lang.Object
implements IController

The ChannelController is supposed to be the main entrance to all Channel releated interactions. The controller holds an internal list of existing Channels and can quickly access them. The Controller is implementend as a Singleton, you have to invoke it using the static getInstance() method.

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

Method Summary
 java.lang.Object createChannel(org.apache.avalon.framework.configuration.Configuration conf)
          Will create a new ChannelThread with the Specified name.
 java.lang.Object createChannel(java.lang.String nameOfChannelThread)
          Will create a new ChannelThread with the Specified name.
 java.lang.Thread createChannelThread(org.apache.avalon.framework.configuration.Configuration conf)
          Will create a new ChannelThread based on attribute in configuration.
 java.lang.Thread createChannelThread(java.lang.String nameOfChannelThread)
          Will create a new ChannelThread with the Specified name.
 boolean exists(java.lang.Object obj)
          Cheacks if specified object is under my control
 boolean exists(java.lang.String channelName)
          Checks if a channel with the specified name exists.
 java.lang.Object get(java.lang.String name)
          Returns one object, specified by key
 java.util.Map getAll()
          All Channels registered within this controller.
 java.lang.Object getChannel(java.lang.String channelName)
          Returns the internal Channel object.
static ChannelController getInstance()
          Returns a ChannelController.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

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

createChannelThread

public java.lang.Thread createChannelThread(java.lang.String nameOfChannelThread)
Will create a new ChannelThread with the Specified name. The configuration for the ChannelThread has to exists in the jcast-config.xml.
Parameters:
nameOfChannelThread - The name of the ChannelThread.
Returns:
The ChannelThread that was created.

createChannelThread

public java.lang.Thread createChannelThread(org.apache.avalon.framework.configuration.Configuration conf)
                                     throws org.apache.avalon.framework.configuration.ConfigurationException
Will create a new ChannelThread based on attribute in configuration. The configuration for the ChannelThread has to exists in the jcast-config.xml.
Parameters:
nameOfChannelThread - The name of the ChannelThread.
Returns:
The ChannelThread that was created.

createChannel

public java.lang.Object createChannel(java.lang.String nameOfChannelThread)
Will create a new ChannelThread with the Specified name. The configuration for the ChannelThread has to exists in the jcast-config.xml.
Parameters:
nameOfChannelThread - The name of the ChannelThread.
Returns:
The ChannelThread that was created.

createChannel

public java.lang.Object createChannel(org.apache.avalon.framework.configuration.Configuration conf)
                               throws org.apache.avalon.framework.configuration.ConfigurationException
Will create a new ChannelThread with the Specified name. The configuration for the ChannelThread has to exists in the jcast-config.xml.
Parameters:
nameOfChannelThread - The name of the ChannelThread.
Returns:
The ChannelThread that was created.

getChannel

public java.lang.Object getChannel(java.lang.String channelName)
Returns the internal Channel object. You should use it if you need to access different Interfaces of the Channel Object.
Parameters:
channelName - The unique name of the channel.
Returns:
The Channel Object.

getAll

public java.util.Map getAll()
All Channels registered within this controller. (That should be all of them!)
Specified by:
getAll in interface IController
Returns:
Name => IChannel hashmap of all Channels.

exists

public boolean exists(java.lang.String channelName)
Checks if a channel with the specified name exists.
Specified by:
exists in interface IController
Parameters:
channelName - The unique name of the Channel.
Returns:
True if a Channel with the specified unique name already exists.

exists

public boolean exists(java.lang.Object obj)
Cheacks if specified object is under my control
Specified by:
exists in interface IController

get

public java.lang.Object get(java.lang.String name)
Returns one object, specified by key
Specified by:
get in interface IController