use of java.util.concurrent.locks.Lock in project tomcat by apache.
the class StandardJarScanFilter method setTldScan.
public void setTldScan(String tldScan) {
this.tldScan = tldScan;
Lock writeLock = configurationLock.writeLock();
writeLock.lock();
try {
populateSetFromAttribute(tldScan, tldScanSet);
} finally {
writeLock.unlock();
}
}
use of java.util.concurrent.locks.Lock in project tomcat by apache.
the class StandardJarScanFilter method setTldSkip.
public void setTldSkip(String tldSkip) {
this.tldSkip = tldSkip;
Lock writeLock = configurationLock.writeLock();
writeLock.lock();
try {
populateSetFromAttribute(tldSkip, tldSkipSet);
} finally {
writeLock.unlock();
}
}
use of java.util.concurrent.locks.Lock in project tomcat by apache.
the class StandardJarScanFilter method check.
@Override
public boolean check(JarScanType jarScanType, String jarName) {
Lock readLock = configurationLock.readLock();
readLock.lock();
try {
final boolean defaultScan;
final Set<String> toSkip;
final Set<String> toScan;
switch(jarScanType) {
case TLD:
{
defaultScan = defaultTldScan;
toSkip = tldSkipSet;
toScan = tldScanSet;
break;
}
case PLUGGABILITY:
{
defaultScan = defaultPluggabilityScan;
toSkip = pluggabilitySkipSet;
toScan = pluggabilityScanSet;
break;
}
case OTHER:
default:
{
defaultScan = true;
toSkip = defaultSkipSet;
toScan = defaultScanSet;
}
}
if (defaultScan) {
if (Matcher.matchName(toSkip, jarName)) {
if (Matcher.matchName(toScan, jarName)) {
return true;
} else {
return false;
}
}
return true;
} else {
if (Matcher.matchName(toScan, jarName)) {
if (Matcher.matchName(toSkip, jarName)) {
return false;
} else {
return true;
}
}
return false;
}
} finally {
readLock.unlock();
}
}
use of java.util.concurrent.locks.Lock in project tomcat by apache.
the class ContainerBase method getClusterInternal.
/*
* Provide access to just the cluster component attached to this container.
*/
protected Cluster getClusterInternal() {
Lock readLock = clusterLock.readLock();
readLock.lock();
try {
return cluster;
} finally {
readLock.unlock();
}
}
use of java.util.concurrent.locks.Lock in project tomcat by apache.
the class ContainerBase method getRealm.
/**
* Return the Realm with which this Container is associated. If there is
* no associated Realm, return the Realm associated with our parent
* Container (if any); otherwise return <code>null</code>.
*/
@Override
public Realm getRealm() {
Lock l = realmLock.readLock();
l.lock();
try {
if (realm != null)
return (realm);
if (parent != null)
return (parent.getRealm());
return null;
} finally {
l.unlock();
}
}
Aggregations