Perforce

com.perforce.reviewer
Class Reviewer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.perforce.reviewer.Reviewer
All Implemented Interfaces:
Runnable

public class Reviewer
extends Thread

Perforce Java Reviewer. This class utilizes the Perforce Java API to determine what changes have taken place on the Perforce server and handle them according to its configuration.

The default action that is taken on each changelist is to send e-mail to those users that have have added a Reviews section to their user specification that matches the current change. The e-mail sent out will contain both a text-only and HTML version of the information. This has been very useful for including links to additional information.

Requires JavaMail and Activation packages from Sun. When you have these, make sure mail.jar, activation.jar, and p4.jar (from the Perforce Java API) are in the same directory as the reviewer.jar.

As part of the reviwer.jar file, this application can be started on the command line with java 1.2 or better using the format:

    java -jar reviewer.jar /etc/reviewer.conf & 

The configuration file is the only argument accepted on the command line. This file specifies the Perforce environment and how each changelist is handled.

Version:
$Date: 2002/01/11 $ $Revision: #2 $
Author:
David Markley
See Also:
ChangeListener

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Reviewer(Env env)
          Constructor.
Reviewer(Env env, String counter)
           
 
Method Summary
 void addChangeListener(ChangeListener listener)
          Adds a change listner that will review every change.
 void addPathListener(String path, ChangeListener listener)
          Adds a change listner associated for a given path.
 void addUserListener(String user, ChangeListener listener)
          Adds a change listner associated with a particular user.
static void main(String[] argv)
          Command line execution method.
 void run()
          Check the counter every five seconds.
 void setDefaultUserListener(ChangeListener listener)
          Adds a change listner that will review every change.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Reviewer

public Reviewer(Env env)
Constructor.

Reviewer

public Reviewer(Env env,
                String counter)
Method Detail

addChangeListener

public void addChangeListener(ChangeListener listener)
Adds a change listner that will review every change. This ChangeListener's handleChange() method will alway be invoked with the current Env, Change, and list of reviewing users that have nod had a specific ChangeListener added for them using the addUserListener method.

addPathListener

public void addPathListener(String path,
                            ChangeListener listener)
Adds a change listner associated for a given path. When the path matches any path within the current change, the ChangeListener's handleChange() method is invoked with the current Env and Change. The User array passed to handleChange() is set to the list of unspecified users.

addUserListener

public void addUserListener(String user,
                            ChangeListener listener)
Adds a change listner associated with a particular user. When this user appears on the reviews list for a change, the ChangeListener's handleChange() method is invoked with the current Env and Change. The User array passed to handleChange() is set to the list of unspecified users.

main

public static void main(String[] argv)
Command line execution method. The command line takes a single argument, which is the path to the configuration file.

As part of the reviwer.jar file, this application can be started on the command line with java 1.2 or better using the format:

    java -jar reviewer.jar /etc/reviewer.conf & 

run

public void run()
Check the counter every five seconds.
Overrides:
run in class Thread

setDefaultUserListener

public void setDefaultUserListener(ChangeListener listener)
Adds a change listner that will review every change. This ChangeListener's handleChange() method will alway be invoked with the current Env, Change, and list of reviewing users that that have not had a specific ChangeListener added for them using the addUserListener method.

There is a built-in listener that is set up as the default upon instantiating this class. This listener will send e-mail to the list of users.


Perforce

Copyright © 2001, Perforce Software, All rights reserved.