net.sourceforge.cruisecontrol.listeners
Class CMSynergySessionMonitor

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.listeners.CMSynergySessionMonitor
All Implemented Interfaces:
Listener, java.io.Serializable

public class CMSynergySessionMonitor
extends java.lang.Object
implements Listener

Monitors a set of one or more CM Synergy sessions, launching new sessions as needed. The session information is persisted and made available to other CM Synergy plugins through the session file - a simple properties file which maps a session name to a CM Synergy session ID.

Author:
Robert J. Smith
See Also:
Serialized Form

Nested Class Summary
 class CMSynergySessionMonitor.CMSynergySession
          A simple representation of a CM Synergy commandline session
 
Constructor Summary
CMSynergySessionMonitor()
           
 
Method Summary
 CMSynergySessionMonitor.CMSynergySession createSession()
          Creates a new CMSynergySession object and adds it to our list of monitored sessions.
 void handleEvent(ProjectEvent event)
           
 void setCcmExe(java.lang.String ccmExe)
          Sets the name of the CM Synergy executable to use when issuing commands.
 void setSessionFile(java.lang.String sessionFile)
          Sets the file which contains the mapping between CM Synergy session names and IDs.
 void validate()
          Called after the configuration is read to make sure that all the mandatory parameters were specified..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMSynergySessionMonitor

public CMSynergySessionMonitor()
Method Detail

setCcmExe

public void setCcmExe(java.lang.String ccmExe)
Sets the name of the CM Synergy executable to use when issuing commands.

Parameters:
ccmExe - the name of the CM Synergy executable

setSessionFile

public void setSessionFile(java.lang.String sessionFile)
Sets the file which contains the mapping between CM Synergy session names and IDs. This file should be in the standard properties file format. Each line should map one name to a CM Synergy session ID (as returned by the "ccm status" command).

example:

session1=localhost:65024:192.168.1.17

Parameters:
sessionFile - The session file

createSession

public CMSynergySessionMonitor.CMSynergySession createSession()
Creates a new CMSynergySession object and adds it to our list of monitored sessions.

Returns:
The newly created CMSynergySession object.

handleEvent

public void handleEvent(ProjectEvent event)
                 throws CruiseControlException
Specified by:
handleEvent in interface Listener
Throws:
CruiseControlException

validate

public void validate()
              throws CruiseControlException
Description copied from interface: Listener
Called after the configuration is read to make sure that all the mandatory parameters were specified..

Specified by:
validate in interface Listener
Throws:
CruiseControlException - if there was a configuration error.