Codota Logo
DBSemaphore
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: quartz-scheduler/quartz

        + Thread.currentThread().getName());
if (!isLockOwner(lockName)) {
  executeSQL(conn, lockName, expandedSQL, expandedInsertSQL);
          + Thread.currentThread().getName());
  getThreadLocks().add(lockName);
origin: quartz-scheduler/quartz

/**
 * Release the lock on the identified resource if it is held by the calling
 * thread.
 */
public void releaseLock(String lockName) {
  if (isLockOwner(lockName)) {
    if(getLog().isDebugEnabled()) {
      getLog().debug(
        "Lock '" + lockName + "' returned by: "
            + Thread.currentThread().getName());
    }
    getThreadLocks().remove(lockName);
    //getThreadLocksObtainer().remove(lockName);
  } else if (getLog().isDebugEnabled()) {
    getLog().warn(
      "Lock '" + lockName + "' attempt to return by: "
          + Thread.currentThread().getName()
          + " -- but not owner!",
      new Exception("stack-trace of wrongful returner"));
  }
}
origin: quartz-scheduler/quartz

private void setExpandedSQL() {
  if (getTablePrefix() != null && getSchedName() != null && sql != null && insertSql != null) {
    expandedSQL = Util.rtp(this.sql, getTablePrefix(), getSchedulerNameLiteral());
    expandedInsertSQL = Util.rtp(this.insertSql, getTablePrefix(), getSchedulerNameLiteral());
  }
}

origin: quartz-scheduler/quartz

public DBSemaphore(String tablePrefix, String schedName, String defaultSQL, String defaultInsertSQL) {
  this.tablePrefix = tablePrefix;
  this.schedName = schedName;
  setSQL(defaultSQL);
  setInsertSQL(defaultInsertSQL);
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

Log log = getLog();
        + Thread.currentThread().getName());
if (!isLockOwner(conn, lockName)) {
  executeSQL(conn, lockName, expandedSQL);
          + Thread.currentThread().getName());
  getThreadLocks().add(lockName);
origin: quartz-scheduler/quartz

  public void setTablePrefix(String tablePrefix) {
    this.tablePrefix = tablePrefix;
    
    setExpandedSQL();
  }
}
origin: quartz-scheduler/quartz

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

private void setExpandedSQL() {
  if (getTablePrefix() != null) {
    expandedSQL = Util.rtp(this.sql, getTablePrefix());
  }
}

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

public DBSemaphore(String tablePrefix, String sql, String defaultSQL) {
  this.sql = defaultSQL;
  this.tablePrefix = tablePrefix;
  setSQL(sql);
}
origin: quartz/quartz-all

Log log = getLog();
        + Thread.currentThread().getName());
if (!isLockOwner(conn, lockName)) {
  executeSQL(conn, lockName, expandedSQL);
          + Thread.currentThread().getName());
  getThreadLocks().add(lockName);
origin: quartz-scheduler/quartz

  public void setTablePrefix(String tablePrefix) {
    this.tablePrefix = tablePrefix;
    
    setExpandedSQL();
  }
}
origin: quartz-scheduler/quartz

public DBSemaphore(String tablePrefix, String schedName, String defaultSQL, String defaultInsertSQL) {
  this.tablePrefix = tablePrefix;
  this.schedName = schedName;
  setSQL(defaultSQL);
  setInsertSQL(defaultInsertSQL);
}
origin: quartz-scheduler/quartz

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

private void setExpandedSQL() {
  if (getTablePrefix() != null) {
    expandedSQL = Util.rtp(this.sql, getTablePrefix());
  }
}

origin: quartz/quartz-all

public DBSemaphore(String tablePrefix, String sql, String defaultSQL) {
  this.sql = defaultSQL;
  this.tablePrefix = tablePrefix;
  setSQL(sql);
}
origin: quartz-scheduler/quartz

/**
 * Release the lock on the identified resource if it is held by the calling
 * thread.
 */
public void releaseLock(String lockName) {
  if (isLockOwner(lockName)) {
    if(getLog().isDebugEnabled()) {
      getLog().debug(
        "Lock '" + lockName + "' returned by: "
            + Thread.currentThread().getName());
    }
    getThreadLocks().remove(lockName);
    //getThreadLocksObtainer().remove(lockName);
  } else if (getLog().isDebugEnabled()) {
    getLog().warn(
      "Lock '" + lockName + "' attempt to return by: "
          + Thread.currentThread().getName()
          + " -- but not owner!",
      new Exception("stack-trace of wrongful returner"));
  }
}
origin: quartz-scheduler/quartz

        + Thread.currentThread().getName());
if (!isLockOwner(lockName)) {
  executeSQL(conn, lockName, expandedSQL, expandedInsertSQL);
          + Thread.currentThread().getName());
  getThreadLocks().add(lockName);
origin: quartz-scheduler/quartz

public void setSchedName(String schedName) {
  this.schedName = schedName;
  
  setExpandedSQL();
}

origin: quartz-scheduler/quartz

private void setExpandedSQL() {
  if (getTablePrefix() != null && getSchedName() != null && sql != null && insertSql != null) {
    expandedSQL = Util.rtp(this.sql, getTablePrefix(), getSchedulerNameLiteral());
    expandedInsertSQL = Util.rtp(this.insertSql, getTablePrefix(), getSchedulerNameLiteral());
  }
}

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

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

Javadoc

Base class for database based lock handlers for providing thread/resource locking in order to protect resources from being altered by multiple threads at the same time.

Most used methods

  • executeSQL
    Execute the SQL that will lock the proper database row.
  • getLog
  • getTablePrefix
  • getThreadLocks
  • isLockOwner
    Determine whether the calling thread owns a lock on the identified resource.
  • setExpandedSQL
  • setSQL
  • getSchedName
  • getSchedulerNameLiteral
  • setInsertSQL

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • runOnUiThread (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now