Class ActorSource
java.lang.Object
com.arpnetworking.metrics.common.sources.BaseSource
com.arpnetworking.metrics.common.sources.ActorSource
- All Implemented Interfaces:
com.arpnetworking.commons.observer.Observable
,Source
- Direct Known Subclasses:
BaseTcpSource
,HttpSource
,StatsdSource
Serves as a base class for actor-based sources.
- Author:
- Brandon Arp (brandon dot arp at smartsheet dot com)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ActorSource.Builder<B extends ActorSource.Builder<B,
S>, S extends Source> ActorSourceBaseSource.Builder
implementation. -
Constructor Summary
ModifierConstructorDescriptionprotected
ActorSource
(ActorSource.Builder<?, ? extends ActorSource> builder) Protected constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract akka.actor.Props
Create a props for the actor to be created at the provided path.protected akka.actor.ActorRef
getActor()
Return anActorRef
to this source's Akka actor.protected akka.actor.ActorSystem
Return theActorSystem
used by this source.void
start()
Called to allow the source to start producing records.void
stop()
Called to allow the source to clean-up.Methods inherited from class com.arpnetworking.metrics.common.sources.BaseSource
attach, detach, getMetricSafeName, getName, notify, toLogValue, toString
-
Constructor Details
-
ActorSource
Protected constructor.- Parameters:
builder
- Instance ofActorSource.Builder
.
-
-
Method Details
-
start
public void start()Description copied from interface:Source
Called to allow the source to start producing records. -
stop
public void stop()Description copied from interface:Source
Called to allow the source to clean-up. No further records should be produced. -
getActorSystem
protected akka.actor.ActorSystem getActorSystem()Return theActorSystem
used by this source.- Returns:
- The
ActorSystem
used by this source.
-
getActor
protected akka.actor.ActorRef getActor()Return anActorRef
to this source's Akka actor.- Returns:
- An
ActorRef
to this source's Akka actor.
-
createProps
protected abstract akka.actor.Props createProps()Create a props for the actor to be created at the provided path.- Returns:
- A props to create the actor with.
-