alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Akka/Scala example source code file (ActivationMessage.scala)

This example Akka source code file (ActivationMessage.scala) is included in my "Source Code Warehouse" project. The intent of this project is to help you more easily find Akka and Scala source code examples by using tags.

All credit for the original source code belongs to akka.io; I'm just trying to make examples easier to find. (For my Scala work, see my Scala examples and tutorials.)

Akka tags/keywords

activationmessage, actor, actorref, akka, camel, endpointactivated, endpointdeactivated, endpointfailedtoactivate, endpointfailedtodeactivate, option, serializable, serialversionuid, throwable

The ActivationMessage.scala Akka example source code

package akka.camel.internal

/**
 * Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
 */

import akka.actor.ActorRef

private[camel] object ActivationProtocol {
  /**
   * Super class of all activation messages. Registration of the Camel [[akka.camel.Consumer]]s and [[akka.camel.Producer]]s
   * is done asynchronously. Activation messages are sent in the Camel extension when endpoints are
   * activated, de-activated, failed to activate and failed to de-activate.
   * You can use the [[akka.camel.Activation]] trait which is available on [[akka.camel.Camel]]
   * to await activation or de-activation of endpoints.
   */
  @SerialVersionUID(1L)
  private[camel] abstract class ActivationMessage(val actor: ActorRef) extends Serializable

  /**
   * INTERNAL API
   *  companion object of <code>ActivationMessage</code>
   */
  private[camel] object ActivationMessage {
    def unapply(msg: ActivationMessage): Option[ActorRef] = Option(msg.actor)
  }

  /**
   * INTERNAL API
   * Event message indicating that a single endpoint has been activated.
   * You can use the [[akka.camel.Activation]] trait which is available on [[akka.camel.Camel]]
   * to await activation or de-activation of endpoints.
   * @param actorRef the endpoint that was activated
   */
  @SerialVersionUID(1L)
  final case class EndpointActivated(actorRef: ActorRef) extends ActivationMessage(actorRef)

  /**
   * INTERNAL API
   * Event message indicating that a single endpoint failed to activate.
   * You can use the [[akka.camel.Activation]] trait which is available on [[akka.camel.Camel]]
   * to await activation or de-activation of endpoints.
   * @param actorRef the endpoint that failed to activate
   * @param cause the cause for failure
   */
  @SerialVersionUID(1L)
  final case class EndpointFailedToActivate(actorRef: ActorRef, cause: Throwable) extends ActivationMessage(actorRef)

  /**
   * INTERNAL API
   * Event message indicating that a single endpoint was de-activated.
   * You can use the [[akka.camel.Activation]] trait which is available on [[akka.camel.Camel]]
   * to await activation or de-activation of endpoints.
   * @param actorRef the endpoint that was de-activated
   */
  @SerialVersionUID(1L)
  final case class EndpointDeActivated(actorRef: ActorRef) extends ActivationMessage(actorRef)

  /**
   * INTERNAL API
   * Event message indicating that a single endpoint failed to de-activate.
   * You can use the [[akka.camel.Activation]] trait which is available on [[akka.camel.Camel]]
   * to await activation or de-activation of endpoints.
   * @param actorRef the endpoint that failed to de-activate
   * @param cause the cause for failure
   */
  @SerialVersionUID(1L)
  final case class EndpointFailedToDeActivate(actorRef: ActorRef, cause: Throwable) extends ActivationMessage(actorRef)
}

Other Akka source code examples

Here is a short list of links related to this Akka ActivationMessage.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.