Tabnine Logo
JTANonClusteredSemaphore
Code IndexAdd Tabnine to your IDE (free)

How to use
JTANonClusteredSemaphore
in
org.quartz.impl.jdbcjobstore

Best Java code snippets using org.quartz.impl.jdbcjobstore.JTANonClusteredSemaphore (Showing top 20 results out of 315)

origin: quartz-scheduler/quartz

lockName = lockName.intern();
if (isLockOwner(null, lockName)) {
    Transaction t = getTransaction();
    if (t != null) {
      if(getLog().isDebugEnabled()) {
        getLog().debug(
          "Lock '" + lockName + "' is in a JTA transaction.  " + 
          "Return deferred by: " + Thread.currentThread().getName());
  if(getLog().isDebugEnabled()) {
    getLog().debug(
      "Lock '" + lockName + "' returned by: "
          + Thread.currentThread().getName());
  getThreadLocks().remove(lockName);
  locks.remove(lockName);
  this.notify();
} else if (getLog().isDebugEnabled()) {
  getLog().debug(
    "Lock '" + lockName + "' attempt to return by: "
        + Thread.currentThread().getName()
origin: quartz-scheduler/quartz

  public void afterCompletion(int status) {
    try {
      releaseLock(lockName, true);
    } catch (LockException e) {
      // Ignore as can't be thrown with fromSynchronization set to true
    }
  }
}
origin: quartz-scheduler/quartz

if (!isLockOwner(conn, lockName)) {
  if(log.isDebugEnabled()) {
    log.debug(
  Transaction t = getTransaction();
  if (t != null) {
    try {
  getThreadLocks().add(lockName);
  locks.add(lockName);
} else if(log.isDebugEnabled()) {
origin: quartz-scheduler/quartz

/**
 * Determine whether the calling thread owns a lock on the identified
 * resource.
 */
public synchronized boolean isLockOwner(Connection conn, String lockName) {
  lockName = lockName.intern();
  return getThreadLocks().contains(lockName);
}
origin: quartz-scheduler/quartz

if (!isLockOwner(conn, lockName)) {
  if(log.isDebugEnabled()) {
    log.debug(
  Transaction t = getTransaction();
  if (t != null) {
    try {
  getThreadLocks().add(lockName);
  locks.add(lockName);
} else if(log.isDebugEnabled()) {
origin: quartz-scheduler/quartz

/**
 * Determine whether the calling thread owns a lock on the identified
 * resource.
 */
public synchronized boolean isLockOwner(Connection conn, String lockName) {
  lockName = lockName.intern();
  return getThreadLocks().contains(lockName);
}
origin: quartz-scheduler/quartz

lockName = lockName.intern();
if (isLockOwner(null, lockName)) {
    Transaction t = getTransaction();
    if (t != null) {
      if(getLog().isDebugEnabled()) {
        getLog().debug(
          "Lock '" + lockName + "' is in a JTA transaction.  " + 
          "Return deferred by: " + Thread.currentThread().getName());
  if(getLog().isDebugEnabled()) {
    getLog().debug(
      "Lock '" + lockName + "' returned by: "
          + Thread.currentThread().getName());
  getThreadLocks().remove(lockName);
  locks.remove(lockName);
  this.notify();
} else if (getLog().isDebugEnabled()) {
  getLog().debug(
    "Lock '" + lockName + "' attempt to return by: "
        + Thread.currentThread().getName()
origin: quartz-scheduler/quartz

/**
 * Release the lock on the identified resource if it is held by the calling
 * thread, unless currently in a JTA transaction.
 */
public synchronized void releaseLock(String lockName) throws LockException {
  releaseLock(lockName, false);
}

origin: quartz/quartz-all

/**
 * Determine whether the calling thread owns a lock on the identified
 * resource.
 */
public synchronized boolean isLockOwner(Connection conn, String lockName) {
  lockName = lockName.intern();
  return getThreadLocks().contains(lockName);
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

lockName = lockName.intern();
if (isLockOwner(null, lockName)) {
    Transaction t = getTransaction();
    if (t != null) {
      if(getLog().isDebugEnabled()) {
        getLog().debug(
          "Lock '" + lockName + "' is in a JTA transaction.  " + 
          "Return deferred by: " + Thread.currentThread().getName());
  if(getLog().isDebugEnabled()) {
    getLog().debug(
      "Lock '" + lockName + "' returned by: "
          + Thread.currentThread().getName());
  getThreadLocks().remove(lockName);
  locks.remove(lockName);
  this.notify();
} else if (getLog().isDebugEnabled()) {
  getLog().debug(
    "Lock '" + lockName + "' attempt to return by: "
        + Thread.currentThread().getName()
origin: quartz-scheduler/quartz

/**
 * Release the lock on the identified resource if it is held by the calling
 * thread, unless currently in a JTA transaction.
 */
public synchronized void releaseLock(String lockName) throws LockException {
  releaseLock(lockName, false);
}

origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * Determine whether the calling thread owns a lock on the identified
 * resource.
 */
public synchronized boolean isLockOwner(Connection conn, String lockName) {
  lockName = lockName.intern();
  return getThreadLocks().contains(lockName);
}
origin: quartz/quartz-all

lockName = lockName.intern();
if (isLockOwner(null, lockName)) {
    Transaction t = getTransaction();
    if (t != null) {
      if(getLog().isDebugEnabled()) {
        getLog().debug(
          "Lock '" + lockName + "' is in a JTA transaction.  " + 
          "Return deferred by: " + Thread.currentThread().getName());
  if(getLog().isDebugEnabled()) {
    getLog().debug(
      "Lock '" + lockName + "' returned by: "
          + Thread.currentThread().getName());
  getThreadLocks().remove(lockName);
  locks.remove(lockName);
  this.notify();
} else if (getLog().isDebugEnabled()) {
  getLog().debug(
    "Lock '" + lockName + "' attempt to return by: "
        + Thread.currentThread().getName()
origin: quartz-scheduler/quartz

  public void afterCompletion(int status) {
    try {
      releaseLock(lockName, true);
    } catch (LockException e) {
      // Ignore as can't be thrown with fromSynchronization set to true
    }
  }
}
origin: quartz/quartz-all

Log log = getLog();
if (!isLockOwner(conn, lockName)) {
  if(log.isDebugEnabled()) {
    log.debug(
  Transaction t = getTransaction();
  if (t != null) {
    try {
  getThreadLocks().add(lockName);
  locks.add(lockName);
} else if(log.isDebugEnabled()) {
origin: com.opensymphony.quartz/com.springsource.org.quartz

  public void afterCompletion(int status) {
    try {
      releaseLock(lockName, true);
    } catch (LockException e) {
      // Ignore as can't be thrown with fromSynchronization set to true
    }
  }
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

Log log = getLog();
if (!isLockOwner(conn, lockName)) {
  if(log.isDebugEnabled()) {
    log.debug(
  Transaction t = getTransaction();
  if (t != null) {
    try {
  getThreadLocks().add(lockName);
  locks.add(lockName);
} else if(log.isDebugEnabled()) {
origin: quartz/quartz-all

/**
 * Release the lock on the identified resource if it is held by the calling
 * thread, unless currently in a JTA transaction.
 */
public synchronized void releaseLock(Connection conn, String lockName) throws LockException {
  releaseLock(lockName, false);
}

origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * Release the lock on the identified resource if it is held by the calling
 * thread, unless currently in a JTA transaction.
 */
public synchronized void releaseLock(Connection conn, String lockName) throws LockException {
  releaseLock(lockName, false);
}

origin: quartz/quartz-all

  public void afterCompletion(int status) {
    try {
      releaseLock(lockName, true);
    } catch (LockException e) {
      // Ignore as can't be thrown with fromSynchronization set to true
    }
  }
}
org.quartz.impl.jdbcjobstoreJTANonClusteredSemaphore

Javadoc

Provides in memory thread/resource locking that is JTA javax.transaction.Transaction aware. It is most appropriate for use when using org.quartz.impl.jdbcjobstore.JobStoreCMT without clustering.

This Semaphore implementation is not Quartz cluster safe.

When a lock is obtained/released but there is no active JTA javax.transaction.Transaction, then this Semaphore operates just like org.quartz.impl.jdbcjobstore.SimpleSemaphore.

By default, this class looks for the javax.transaction.TransactionManager in JNDI under name "java:TransactionManager". If this is not where your Application Server registers it, you can modify the JNDI lookup location using the "transactionManagerJNDIName" property.

IMPORTANT: This Semaphore implementation is currently experimental. It has been tested a limited amount on JBoss 4.0.3SP1. If you do choose to use it, any feedback would be most appreciated!

Most used methods

  • getLog
  • getThreadLocks
  • getTransaction
    Helper method to get the current javax.transaction.Transaction from the javax.transaction.Transacti
  • isLockOwner
    Determine whether the calling thread owns a lock on the identified resource.
  • releaseLock
    Release the lock on the identified resource if it is held by the calling thread, unless currently in

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • setScale (BigDecimal)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now