You can automate many aspects of deployment monitoring and management by configuring event listeners on the asset management server and the target servers, to listen for deployment events that include a specific state code.

To create and configure a DeploymentEventListener:

For an example, examine the source code for the DeploymentEmailer Listener class, which is located at:

<ATG10dir>/Publishing/samples/Java

DeploymentEmailer Listener

ATG Content Administration includes this DeploymentEventListener class:

atg.deployment.common.event.DeploymentEmailer

You can use this listener to send email notifications when a deployment succeeds, is interrupted, or fails.

By default, instances of the DeploymentEmailer class listen for deployment events that are fired when a deployment enters one of the following states:

On receiving such an event, the listener sends an email message to a specified recipient.

To set up a DeploymentEmailer listener, first configure an instance of the DeploymentEmailer class on the asset management server. For example:

$class=atg.deployment.common.event.DeploymentEmailer

SMTPEmailSender=/atg/dynamo/service/SMTPEmail
fromAddress=personA@myCompany.com
toAddress=personB@myCompany.com
useShortMessage=true

The following table describes the properties to configure:

Property

Description

SMTPEmailSender

The SMTPEmailSender service through which to send the email.

ATG provides a standard component of type SMTPEmailSender at:

/atg/dynamo/service/SMTPEmail

For more information on email senders and listeners, see the ATG Platform Programming Guide.

fromAddress

The sender’s email address.

toAddress

The destination email address.

useShortMessage

Specifies the level of message detail:

True: The listener sends a short, pager-sized message.

False (default): The listener sends a longer, more verbose message.

active

Specifies whether to enable the listener:

True (default): The listener is enabled to send email notifications.

False: The listener is disabled.

After the DeploymentEmailer listener is configured, register it with the /atg/epub/DeploymentServer by adding it to the list of listeners in the deploymentEventListeners property.

If you require different functionality for the event listener, create a subclass of DeploymentEmailer, override its deploymentEvent() method with your own implementation, and configure an instance of this subclass.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved.

Legal Notices