Interface Repeater

All Superinterfaces:
Broadcaster, Listener, NamedObject, Receiver<Transmittable>, Transceiver, Transmitter<Transmittable>
All Known Subinterfaces:
Component, ComponentMixin, Converter<From,​To>, FileService, NetworkResource, RepeaterMixin, Resource, SerializationSession, StringConverter<Value>, TwoWayConverter<From,​To>, WritableResource
All Known Implementing Classes:
Application, AttachmentConverter, AttachmentListConverter, BaseCollectionChangeWatcher, BaseCollectionConverter, BaseComponent, BaseConverter, BaseExtractor, BaseFormattedConverter, BaseFormattedLocalTimeConverter, BaseHttpResource, BaseListConverter, BaseNetworkResource, BaseReadableResource, BaseRepeater, BaseSetConverter, BaseStringConverter, BaseWritableResource, Batcher, BatcherTest, BatcherTest.TestBatcher, BodyConverter, BooleanConverter, Bytes.Converter, ClassConverter, Confidence.Converter, ConnectionListener, CoreApplicationProject, CoreCollectionsProject, CoreCommandLineProject, CoreConfigurationProject, CoreNetworkEmailProject, CoreNetworkFtpProject, CoreNetworkHttpProject, CoreNetworkSocketProject, CoreSecurityProject, CoreTestProject, Count.Converter, DateTimeConverter, Deployment, Deployment.Converter, DeploymentSet, DoubleConverter, Duration.Converter, Duration.MillisecondsConverter, Duration.SecondsConverter, EmailAddress.Converter, EmailAddressConverter, EmailAddressSetConverter, EmailSender, EnumConverter, EnumListConverter, EnumSetConverter, FieldArchive, File, File.Converter, FileCache, FileList.Converter, FilePath.Converter, FloatConverter, Folder, Folder.Converter, FolderChangeWatcher, FolderList.Converter, FormattedDoubleConverter, FormattedIntegerConverter, FormattedLongConverter, Frequency.Converter, FtpResource, HexadecimalLongConverter, Host.Converter, HttpDateTimeConverter, HttpGetResource, HttpNetworkLocation.Converter, HttpPostResource, HttpPutResource, HumanizedLocalDateTimeConverter, Identifier.Converter, IdentityConverter, InputResource, IntegerConverter, IntegerIdentifier.Converter, IsoLocalDateTimeConverter, JarLauncher, KernelProject, KivaKit, KivaKitThread, KryoSerializationSession, LanguageIsoCode.Converter, Level.Converter, LocalDateConverter, LocalDateTimeConverter, LocalDateTimeWithMillisecondsConverter, LocalDateTimeWithSecondsConverter, LocalTimeConverter, LongConverter, Maximum.Converter, MessageChecker, Minimum.Converter, NetworkCoreProject, NetworkLocation.Converter, NetworkPath.Converter, NullResource, OutputResource, PackageResource, PatternConverter, Percent.Converter, PeriodicCollectionChangeWatcher, PlainTextPassword.Converter, Port.Converter, Port.ListConverter, Project, Quantizable.Converter, RepeatingKivaKitThread, Resource.Converter, ResourceFolder.Converter, ResourceList.Converter, ResourcePath.Converter, ResourceProject, ResourceSection, Retry, SecureFtpResource, SecureHttpGetResource, SecureHttpPostResource, SerializationCoreProject, SerializationJerseyJsonProject, SerializationJsonProject, SerializationKryoProject, Server, Settings, SettingsFolder, SettingsPackage, SftpFolderWatcher, SmtpEmailSender, StateMachine, StringList.Converter, StringResource, ThrowableConverter, UserName.Converter, UtcDateTimeConverter, VersionConverter, VirtualReferenceTracker, ZipEntry, ZoneIdConverter

public interface Repeater extends Listener, Broadcaster
A repeater is both a Listener and a Broadcaster, receiving messages in receive(Transmittable) and rebroadcasting them to its own listeners with Broadcaster.transmit(Transmittable).

A variety of convenient methods are accessible when an object implements Repeater by extending BaseRepeater. In the example below, EmployeeLoader is a repeater which transmits a warning to all of its registered listeners. The PayrollProcessor class is also a Repeater which listens to messages transmitted by the EmployeeLoader and re-transmits them to its own listeners. Clients of the PayrollProcessor can listen to it in turn and they will receive the warning transmitted EmployeeLoader, when it is repeated by the PayrollProcessor. This pattern creates a chain of repeaters that terminates in one or more listeners. The final listener is often, but not always a logger. The base Application class in kivakit-application, for example, is a Repeater which logs the messages it receives by default.

Repeater Example

 class EmployeeLoader extends BaseRepeater
 {

     [...]

     warning("Unable to load $", employee);

     [...]
 }

 class PayrollProcessor extends BaseRepeater
 {

     [...]

     var loader = listenTo(new EmployeeLoader());

     [...]

 }

 var processor = LOGGER.listenTo(new PayrollProcessor());

 
Author:
jonathanl (shibo)
See Also:
Broadcaster, Listener