Package org.apache.jackrabbit.rmi.server
Class ServerLock
- java.lang.Object
-
- java.rmi.server.RemoteObject
-
- java.rmi.server.RemoteServer
-
- java.rmi.server.UnicastRemoteObject
-
- org.apache.jackrabbit.rmi.server.ServerObject
-
- org.apache.jackrabbit.rmi.server.ServerLock
-
- All Implemented Interfaces:
Serializable
,Remote
,RemoteLock
public class ServerLock extends ServerObject implements RemoteLock
Remote adapter for the JCRLock
interface. This class makes a local lock available as an RMI service using theRemoteLock
interface.- See Also:
Lock
,RemoteLock
, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.rmi.server.RemoteObject
ref
-
-
Constructor Summary
Constructors Constructor Description ServerLock(Lock lock, RemoteAdapterFactory factory)
Creates a remote adapter for the given local lock.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getLockOwner()
Remote version of theLock.getLockOwner()
method.String
getLockToken()
Remote version of theLock.getLockToken()
method.RemoteNode
getNode()
Remote version of theLock.getNode()
method.long
getSecondsRemaining()
Remote version of theLock.getSecondsRemaining()
() Lock.getSecondsRemaining()} method.boolean
isDeep()
Remote version of theLock.isDeep()
method.boolean
isLive()
Remote version of theLock.isLive()
method.boolean
isLockOwningSession()
Remote version of theLock.isLockOwningSession()
() Lock.isLockOwningSession()} method.boolean
isSessionScoped()
Remote version of theLock.isSessionScoped()
() Lock.isSessionScoped()} method.void
refresh()
Remote version of theLock.refresh()
method.-
Methods inherited from class org.apache.jackrabbit.rmi.server.ServerObject
getFactory, getRemoteItem, getRemoteNode, getRemoteNodeTypeArray, getRepositoryException, getSerialValue, getSerialValues
-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
-
-
-
Constructor Detail
-
ServerLock
public ServerLock(Lock lock, RemoteAdapterFactory factory) throws RemoteException
Creates a remote adapter for the given local lock.- Parameters:
lock
- local lock- Throws:
RemoteException
- on RMI errors
-
-
Method Detail
-
getNode
public RemoteNode getNode() throws RemoteException
Remote version of theLock.getNode()
method.- Specified by:
getNode
in interfaceRemoteLock
- Returns:
- remote node
- Throws:
RemoteException
- on RMI errors
-
getLockOwner
public String getLockOwner() throws RemoteException
Remote version of theLock.getLockOwner()
method.- Specified by:
getLockOwner
in interfaceRemoteLock
- Returns:
- lock owner
- Throws:
RemoteException
- on RMI errors
-
isDeep
public boolean isDeep() throws RemoteException
Remote version of theLock.isDeep()
method.- Specified by:
isDeep
in interfaceRemoteLock
- Returns:
true
if the lock is deep,false
otherwise- Throws:
RemoteException
- on RMI errors
-
getLockToken
public String getLockToken() throws RemoteException
Remote version of theLock.getLockToken()
method.- Specified by:
getLockToken
in interfaceRemoteLock
- Returns:
- lock token
- Throws:
RemoteException
- on RMI errors
-
isLive
public boolean isLive() throws RepositoryException, RemoteException
Remote version of theLock.isLive()
method.- Specified by:
isLive
in interfaceRemoteLock
- Returns:
true
if the lock is live,false
otherwise- Throws:
RepositoryException
- on repository errorsRemoteException
- on RMI errors
-
refresh
public void refresh() throws RepositoryException, RemoteException
Remote version of theLock.refresh()
method.- Specified by:
refresh
in interfaceRemoteLock
- Throws:
RepositoryException
- on repository errorsRemoteException
- on RMI errors
-
isSessionScoped
public boolean isSessionScoped() throws RemoteException
Remote version of theLock.isSessionScoped()
() Lock.isSessionScoped()} method.- Specified by:
isSessionScoped
in interfaceRemoteLock
- Returns:
true
if the lock is live,false
otherwise- Throws:
RemoteException
- on RMI errors
-
getSecondsRemaining
public long getSecondsRemaining() throws RepositoryException, RemoteException
Remote version of theLock.getSecondsRemaining()
() Lock.getSecondsRemaining()} method.- Specified by:
getSecondsRemaining
in interfaceRemoteLock
- Returns:
- the number of seconds remaining until this lock times out.
- Throws:
RepositoryException
- on repository errorsRemoteException
- on RMI errors
-
isLockOwningSession
public boolean isLockOwningSession() throws RemoteException
Remote version of theLock.isLockOwningSession()
() Lock.isLockOwningSession()} method.- Specified by:
isLockOwningSession
in interfaceRemoteLock
- Returns:
- a
boolean
. - Throws:
RemoteException
- on RMI errors
-
-