FileDocCategorySizeDatePackage
SFSBClientVersionManager.javaAPI DocGlassfish v2 API3712Thu May 31 15:43:32 BST 2007com.sun.enterprise.iiop

SFSBClientVersionManager

public class SFSBClientVersionManager extends Object implements SFSBVersionConstants

Fields Summary
private static final Logger
_logger
private static Map
id2Map
Constructors Summary
Methods Summary
public static synchronized longgetClientVersion(long containerId, java.lang.Object oid)

    
            
        Map<Object, Long> map = id2Map.get(new Long(containerId));
        long version = NO_VERSION;
        if (map != null) {
            Long vv = map.get(oid);
            version = (vv != null) ? vv : NO_VERSION;
        }
        
        return version;
    
public static voidremoveAllEntries(long containerId)

        id2Map.remove(containerId);
    
public static synchronized voidremoveClientVersion(long containerId, java.lang.Object oid)

        Map<Object, Long> map = id2Map.get(new Long(containerId));
        if (map != null) {
            map.remove(oid);
        }
    
public static synchronized voidsetClientVersion(long containerId, java.lang.Object oid, long version)

        if (version != NO_VERSION) {
            Map<Object, Long> map = id2Map.get(new Long(containerId));
            if (map == null) {
                map = new HashMap<Object, Long>();
                id2Map.put(new Long(containerId), map);
            }

            
            Long existingVersion = map.get(oid);
            
            if ((existingVersion == null) || (version > existingVersion)) {
                map.put(oid, version);
            }
        }