org.jasig.portal.container.services.information
Class PortletWindowStateInfo

java.lang.Object
  extended by org.jasig.portal.container.services.information.PortletWindowStateInfo
All Implemented Interfaces:
java.io.Serializable

public class PortletWindowStateInfo
extends java.lang.Object
implements java.io.Serializable

Class for tracking the current and previous WindowState and PortletMode for a PortletWindow. The previous mode and state fields are automaticly updated when the current mode and state are updated. The getters/setters are synchronized since setting the previous and current is not an atomic operation.

Version:
$Id: PortletWindowStateInfo.java,v 1.1.2.1 2005/06/07 00:16:34 edalquist Exp $
Author:
Eric Dalquist edalquist@unicon.net
See Also:
Serialized Form

Nested Class Summary
private  class PortletWindowStateInfo.Lock
          Utility class that is used for synchornization.
 
Field Summary
private  javax.portlet.PortletMode currentMode
           
private  javax.portlet.WindowState currentState
           
private  PortletWindowStateInfo.Lock modeLock
           
private  javax.portlet.PortletMode previousMode
           
private  javax.portlet.WindowState previousState
           
private  PortletWindowStateInfo.Lock stateLock
           
 
Constructor Summary
PortletWindowStateInfo()
           
 
Method Summary
 javax.portlet.PortletMode getCurrentMode()
           
 javax.portlet.WindowState getCurrentState()
           
 javax.portlet.PortletMode getPreviousMode()
           
 javax.portlet.WindowState getPreviousState()
           
private  void readObject(java.io.ObjectInputStream in)
          Used by the Java serialization system to re-create this object
 void setCurrentMode(javax.portlet.PortletMode currentMode)
           
 void setCurrentState(javax.portlet.WindowState currentState)
           
private  javax.portlet.PortletMode stringToMode(java.lang.String modeName)
          Utility to converting PortletMode string names to objects.
private  javax.portlet.WindowState stringToState(java.lang.String stateName)
          Utility to converting WindowState string names to objects.
 java.lang.String toString()
           
private  void writeObject(java.io.ObjectOutputStream out)
          Used by the Java serialization system to write this object out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stateLock

private final PortletWindowStateInfo.Lock stateLock

modeLock

private final PortletWindowStateInfo.Lock modeLock

currentState

private transient javax.portlet.WindowState currentState

previousState

private transient javax.portlet.WindowState previousState

currentMode

private transient javax.portlet.PortletMode currentMode

previousMode

private transient javax.portlet.PortletMode previousMode
Constructor Detail

PortletWindowStateInfo

public PortletWindowStateInfo()
Method Detail

getCurrentMode

public javax.portlet.PortletMode getCurrentMode()
Returns:
Returns the currentMode.

getCurrentState

public javax.portlet.WindowState getCurrentState()
Returns:
Returns the currentState.

getPreviousMode

public javax.portlet.PortletMode getPreviousMode()
Returns:
Returns the previousMode.

getPreviousState

public javax.portlet.WindowState getPreviousState()
Returns:
Returns the previousState.

setCurrentMode

public void setCurrentMode(javax.portlet.PortletMode currentMode)
Parameters:
currentMode - The currentMode to set.

setCurrentState

public void setCurrentState(javax.portlet.WindowState currentState)
Parameters:
currentState - The currentState to set.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

writeObject

private void writeObject(java.io.ObjectOutputStream out)
                  throws java.io.IOException
Used by the Java serialization system to write this object out.

Throws:
java.io.IOException
See Also:
Serializable

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Used by the Java serialization system to re-create this object

Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
Serializable

stringToMode

private javax.portlet.PortletMode stringToMode(java.lang.String modeName)
Utility to converting PortletMode string names to objects. Tries to re-use standard objects before resorting to creating a new object.

Parameters:
modeName - The name of the mode.
Returns:
The PorltetMode representing the name

stringToState

private javax.portlet.WindowState stringToState(java.lang.String stateName)
Utility to converting WindowState string names to objects. Tries to re-use standard objects before resorting to creating a new object.

Parameters:
stateName - The name of the state.
Returns:
The WindowState representing the name