Files
sdrtrunk/src/instrument/InstrumentableProcessingChain.java
denny f7f6c2fc3e Merges changes from master branch to resolve issue with CPU and memory
and constraints on scheduled thread pool saturation.  Adds a new
scheduled thread pool for each processing chain that the components in
the chain can share, versus the single shared pool exposed by the
threadpoolmanager class.
2016-02-15 15:47:14 -05:00

66 lines
1.2 KiB
Java

package instrument;
import instrument.tap.Tap;
import instrument.tap.TapGroup;
import java.util.ArrayList;
import java.util.List;
import module.Module;
import module.ProcessingChain;
import source.Source;
import controller.channel.Channel.ChannelType;
public class InstrumentableProcessingChain extends ProcessingChain implements Instrumentable
{
public InstrumentableProcessingChain()
{
super( "instrumented", ChannelType.STANDARD );
}
public void setSource( Source source ) throws IllegalStateException
{
mSource = source;
}
@Override
public List<TapGroup> getTapGroups()
{
List<TapGroup> groups = new ArrayList<>();
for( Module module: getModules() )
{
if( module instanceof Instrumentable )
{
groups.addAll( ((Instrumentable)module).getTapGroups() );
}
}
return groups;
}
@Override
public void registerTap( Tap tap )
{
for( Module module: getModules() )
{
if( module instanceof Instrumentable )
{
((Instrumentable)module).registerTap( tap );
}
}
}
@Override
public void unregisterTap( Tap tap )
{
for( Module module: getModules() )
{
if( module instanceof Instrumentable )
{
((Instrumentable)module).unregisterTap( tap );
}
}
}
}