org.apache.sling.event.impl.jobs.jcr
Class LockManager

java.lang.Object
  extended by org.apache.sling.event.impl.jobs.jcr.LockManager
All Implemented Interfaces:
Runnable, javax.jcr.observation.EventListener

@Services(value={@Service(value=java.lang.Runnable.class),@Service(value=LockManager.class)})
@Properties(value={@Property(name="scheduler.period",longValue=60L,propertyPrivate=true),@Property(name="scheduler.concurrent",boolValue=false,propertyPrivate=true)})
public class LockManager
extends Object
implements Runnable, javax.jcr.observation.EventListener


Constructor Summary
LockManager()
           
 
Method Summary
protected  void activate(Map<String,Object> props)
          Activate this component.
protected  void deactivate()
          Deactivate this component.
 void lock(javax.jcr.Session session, String path)
          Lock the node at the given path
 void onEvent(javax.jcr.observation.EventIterator events)
           
 void run()
          Cron job
 void unlock(javax.jcr.Session session, String path)
          Unlock the node at the given path.
protected  void update(Map<String,Object> props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockManager

public LockManager()
Method Detail

activate

@Activate
protected void activate(Map<String,Object> props)
                 throws javax.jcr.RepositoryException
Activate this component.

Parameters:
props - The configuration properties.
Throws:
javax.jcr.RepositoryException

deactivate

@Deactivate
protected void deactivate()
Deactivate this component.


update

@Modified
protected void update(Map<String,Object> props)

run

public void run()
Cron job

Specified by:
run in interface Runnable
See Also:
Runnable.run()

onEvent

public void onEvent(javax.jcr.observation.EventIterator events)
Specified by:
onEvent in interface javax.jcr.observation.EventListener
See Also:
EventListener.onEvent(javax.jcr.observation.EventIterator)

lock

public void lock(javax.jcr.Session session,
                 String path)
          throws javax.jcr.RepositoryException
Lock the node at the given path

Parameters:
session - The session to create the lock with
path - The path to the node to lock
Throws:
javax.jcr.RepositoryException - If anything goes wrong

unlock

public void unlock(javax.jcr.Session session,
                   String path)
            throws javax.jcr.RepositoryException
Unlock the node at the given path.

Parameters:
session - The session for unlocking
path - The path to the node to unlock
Throws:
javax.jcr.RepositoryException - If anything goes wrong


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.