mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
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.
66 lines
1.2 KiB
Java
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 );
|
|
}
|
|
}
|
|
}
|
|
}
|