FileDocCategorySizeDatePackage
PersistenceType.javaAPI DocGlassfish v2 API6573Fri May 04 22:34:10 BST 2007com.sun.enterprise.web.session

PersistenceType

public final class PersistenceType extends Object
Represents each of the persistence mechanisms supported by the session managers.

Fields Summary
public static final PersistenceType
MEMORY
Memory based persistence for sessions (i.e. none);
public static final PersistenceType
FILE
File based persistence for sessions.
public static final PersistenceType
CUSTOM
Custom/user implemented session manager.
public static final PersistenceType
S1WS60
old iWS 6.0 style session manager.
public static final PersistenceType
MMAP
old iWS 6.0 style MMapSessionManager.
public static final PersistenceType
JDBC
JDBC based persistence for sessions.
public static final PersistenceType
HA
HADB based persistence for sessions.
public static final PersistenceType
REPLICATED
SJSWS replicated persistence for sessions.
private String
_type
The persistence type specifier.
Constructors Summary
private PersistenceType(String type)
Default constructor that sets its type to the specified string.


    // ----------------------------------------------------------- Constructors

                   
       
        _type = type;
    
Methods Summary
public java.lang.StringgetType()
Returns a string describing the persistence mechanism that the object represents.


    // ------------------------------------------------------------- Properties
    
                    
       
        return _type;
    
public static com.sun.enterprise.web.session.PersistenceTypeparseType(java.lang.String type)
Parse the specified string and return the corresponding instance of this class that represents the persistence type specified in the string.

        // Default persistence type is MEMORY
        PersistenceType pType = MEMORY;
        if (type != null) {
            if (type.equalsIgnoreCase(FILE.getType()))
                pType = FILE;
            else if (type.equalsIgnoreCase(CUSTOM.getType()))
                pType = CUSTOM;
            else if (type.equalsIgnoreCase(S1WS60.getType()))
                pType = S1WS60;
            else if (type.equalsIgnoreCase(MMAP.getType()))
                pType = MMAP;
            else if (type.equalsIgnoreCase(JDBC.getType()))
                pType = JDBC;            
            else if (type.equalsIgnoreCase(HA.getType()))
                pType = HA;
            else if (type.equalsIgnoreCase(REPLICATED.getType()))
                pType = REPLICATED; 
        }
        return pType;
    
public static com.sun.enterprise.web.session.PersistenceTypeparseType(java.lang.String type, com.sun.enterprise.web.session.PersistenceType defaultType)
Parse the specified string and return the corresponding instance of this class that represents the persistence type specified in the string. Default back into passed-in parameter

        // Default persistence type is defaultTypee
        PersistenceType pType = defaultType;
        if (type != null) {
            if (type.equalsIgnoreCase(MEMORY.getType()))
                pType = MEMORY;            
            else if (type.equalsIgnoreCase(FILE.getType()))
                pType = FILE;
            else if (type.equalsIgnoreCase(CUSTOM.getType()))
                pType = CUSTOM;
            else if (type.equalsIgnoreCase(S1WS60.getType()))
                pType = S1WS60;
            else if (type.equalsIgnoreCase(MMAP.getType()))
                pType = MMAP;
            else if (type.equalsIgnoreCase(JDBC.getType()))
                pType = JDBC;            
            else if (type.equalsIgnoreCase(HA.getType()))
                pType = HA;
            else if (type.equalsIgnoreCase(REPLICATED.getType()))
                pType = REPLICATED;    
        }
        return pType;