public void setSource(DataSource source)
throws IncompatibleSourceException
{
// Accept only PullDataSources
if(! (source instanceof PullDataSource) ) {
throw new IncompatibleSourceException(
"MediaHandler " + getClass().getName() +
" does not support " +
"DataSource " + source.getClass().getName() );
}
PullSourceStream[] streams =
((PullDataSource)source).getStreams();
if( streams == null || streams.length == 0 ) {
throw new IncompatibleSourceException(
"DataSource " + source.getClass().getName() +
" does not contain valid streams." );
}
super.setSource(source);