org.apache.maven.werkz
Class Session

java.lang.Object
  extended byorg.apache.maven.werkz.Session
Direct Known Subclasses:
JellySession

public class Session
extends java.lang.Object

Goal satisfaction state.

A Session isolates satisfaction of Goals into an objectified context. Multiple Sessions can be deployed simultaneously against a Project or arbitrary Goal graph. Likewise, a single Session may be used simultaneous against several Projects or Goal graphs. A caveat with this last idiom revolves around Goal's implementation of equality which utilitizes only the Goal's name.

Author:
bob mcwhirter
See Also:
WerkzProject, Goal

Constructor Summary
Session()
          Construct.
 
Method Summary
(package private)  void addSatisfiedGoal(Goal goal)
          Add a satisfied Goal to this context.
 void clear()
          Clear and reset this Session so that no Goals are considered satisfied.
 void error(java.lang.String msg)
          Log an error message.
 java.lang.Object getAttribute(java.lang.String key)
          Get an attribute from this Session.
 java.util.Map getAttributes()
          Get the attributes from this Session.
 void info(java.lang.String msg)
          Log an informative message.
(package private)  boolean isGoalSatisfied(Goal goal)
          Test a Goal to determine if it has been satisfied within this context.
(package private)  void removeSatisfiedGoal(Goal goal)
          Remove a satisfied Goal from this context.
 void setAttribute(java.lang.String key, java.lang.Object value)
          Set an attribute for this Session.
 void setAttributes(java.util.Map attributes)
          Set the attributes for this Session.
 void warn(java.lang.String msg)
          Log a warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session()
Construct.

Method Detail

clear

public void clear()
Clear and reset this Session so that no Goals are considered satisfied.


addSatisfiedGoal

void addSatisfiedGoal(Goal goal)
Add a satisfied Goal to this context.

Parameters:
goal - The Goal that is satisfied.

removeSatisfiedGoal

void removeSatisfiedGoal(Goal goal)
Remove a satisfied Goal from this context.

Parameters:
goal - The Goal that is no longer satisfied.

isGoalSatisfied

boolean isGoalSatisfied(Goal goal)
Test a Goal to determine if it has been satisfied within this context.

Parameters:
goal - The Goal to test.
Returns:
true if the Goal has been satisfied within this context, otherwise false.

setAttributes

public void setAttributes(java.util.Map attributes)
Set the attributes for this Session.

Parameters:
attributes - The attributes for this Session.

getAttributes

public java.util.Map getAttributes()
Get the attributes from this Session.

Returns:
Attributes for this Session.

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Set an attribute for this Session.

Parameters:
key - Attribute key.
value - Attribute value.

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Get an attribute from this Session.

Returns:
An attribute from this Session.

info

public void info(java.lang.String msg)
Log an informative message.

Parameters:
msg - The message.

warn

public void warn(java.lang.String msg)
Log a warning message.

Parameters:
msg - The message.

error

public void error(java.lang.String msg)
Log an error message.

Parameters:
msg - The message.


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.