org.modeshape.jboss.managed
Class ManagedLock

java.lang.Object
  extended by org.modeshape.jboss.managed.ManagedLock
All Implemented Interfaces:
ModeShapeManagedObject

@Immutable
public final class ManagedLock
extends Object
implements ModeShapeManagedObject

The ManagedSession class is a JBoss managed object of a ModeShape lock.


Field Summary
static Comparator<ManagedLock> SORT_BY_OWNER
          A sorter for when locks need to be sorted by owner.
 
Constructor Summary
ManagedLock(String workspaceName, boolean sessionBased, String sessionId, org.joda.time.DateTime expiration, String id, String owner, boolean deep)
          Constructs a managed object for a ModeShape lock.
 
Method Summary
 org.joda.time.DateTime getExpiration()
          Obtains the lock's expiration time.
 String getId()
          Obtains the lock's identifier.
 String getOwner()
          Obtains the lock's owner.
 String getSessionId()
          Obtains the session's unique identifier.
 String getWorkspaceName()
          Obtains the lock's workspace name.
 boolean isDeep()
          Indicates if this lock is a deep lock.
 boolean isSessionBased()
          Indicates if this lock is a session-based lock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SORT_BY_OWNER

public static final Comparator<ManagedLock> SORT_BY_OWNER
A sorter for when locks need to be sorted by owner.

Constructor Detail

ManagedLock

public ManagedLock(String workspaceName,
                   boolean sessionBased,
                   String sessionId,
                   org.joda.time.DateTime expiration,
                   String id,
                   String owner,
                   boolean deep)
Constructs a managed object for a ModeShape lock.

Parameters:
workspaceName - the name of the lock's workspace (never null and never empty)
sessionBased - the flag indicating if this lock is session-based
sessionId - the session ID of this lock (never null and never empty)
expiration - the lock expiration time (never null)
id - the lock ID (never null and never empty)
owner - the owner of the lock (never null or empty)
deep - the flag indicating if this is a deep lock
Method Detail

getExpiration

public org.joda.time.DateTime getExpiration()
Obtains the lock's expiration time. This is a JBoss managed readonly property.

Returns:
the time this lock will expire (never null)

getId

public String getId()
Obtains the lock's identifier. This is a JBoss managed readonly property.

Returns:
the identifier of this lock (never null and never empty)

getOwner

public String getOwner()
Obtains the lock's owner. This is a JBoss managed readonly property.

Returns:
the owner of this lock (never null and never empty)

getSessionId

public String getSessionId()
Obtains the session's unique identifier. This is a JBoss managed readonly property.

Returns:
the session identifier of this lock (never null and never empty)

getWorkspaceName

public String getWorkspaceName()
Obtains the lock's workspace name. This is a JBoss managed readonly property.

Returns:
the workspace name of this lock (never null and never empty)

isDeep

public boolean isDeep()
Indicates if this lock is a deep lock. This is a JBoss managed readonly property.

Returns:
true if a deep lock

isSessionBased

public boolean isSessionBased()
Indicates if this lock is a session-based lock. This is a JBoss managed readonly property.

Returns:
true if a session-based lock


Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.