org.sonar.batch
Class DefaultResourceCreationLock

java.lang.Object
  extended by org.sonar.batch.DefaultResourceCreationLock
All Implemented Interfaces:
ResourceCreationLock, BatchComponent

public final class DefaultResourceCreationLock
extends Object
implements ResourceCreationLock

This lock is used to ensure that Sonar resources (files, packages, directories) are not created by buggy plugins when saving measures/violations on unknown resources.

Since:
2.3

Constructor Summary
DefaultResourceCreationLock()
           
DefaultResourceCreationLock(org.apache.commons.configuration.Configuration configuration)
           
 
Method Summary
 boolean isFailWhenLocked()
           
 boolean isLocked()
           
 void lock()
          Forbids the creation of resources when saving violations and measures.
 void setFailWhenLocked(boolean b)
           
 void unlock()
          Unlocking is for internal use only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResourceCreationLock

public DefaultResourceCreationLock()

DefaultResourceCreationLock

public DefaultResourceCreationLock(org.apache.commons.configuration.Configuration configuration)
Method Detail

isLocked

public boolean isLocked()

lock

public void lock()
Description copied from interface: ResourceCreationLock
Forbids the creation of resources when saving violations and measures. By default it's unlocked, so only warnings are logged. When locked, then an exception is thrown.

Specified by:
lock in interface ResourceCreationLock

unlock

public void unlock()
Unlocking is for internal use only.


isFailWhenLocked

public boolean isFailWhenLocked()

setFailWhenLocked

public void setFailWhenLocked(boolean b)


Copyright © 2009-2012 SonarSource. All Rights Reserved.