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

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

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

origin: quartz-scheduler/quartz

/**
 * Wrap the given <code>Connection</code> in a Proxy such that attributes 
 * that might be set will be restored before the connection is closed 
 * (and potentially restored to a pool).
 */
protected Connection getAttributeRestoringConnection(Connection conn) {
  return (Connection)Proxy.newProxyInstance(
      Thread.currentThread().getContextClassLoader(),
      new Class[] { Connection.class },
      new AttributeRestoringConnectionInvocationHandler(conn));
}

origin: quartz-scheduler/quartz

public Object invoke(Object proxy, Method method, Object[] args)
  throws Throwable {
  if (method.getName().equals("setAutoCommit")) {
    setAutoCommit(((Boolean)args[0]).booleanValue());
  } else if (method.getName().equals("setTransactionIsolation")) {
    setTransactionIsolation(((Integer)args[0]).intValue());
  } else if (method.getName().equals("close")) {
    close();
  } else {
    try {
      return method.invoke(conn, args);
    }
    catch(InvocationTargetException ite) {
      throw (ite.getCause() != null ? ite.getCause() : ite);
    }
    
  }
  
  return null;
}
 
origin: quartz-scheduler/quartz

/**
 * Attempts to restore the auto commit and transaction isolation connection
 * attributes of the wrapped connection to their original values (if they
 * were overwritten).
 */
public void restoreOriginalAtributes() {
  try {
    if (overwroteOriginalAutoCommitValue) {
      conn.setAutoCommit(originalAutoCommitValue);
    }
  } catch (Throwable t) {
    getLog().warn("Failed restore connection's original auto commit setting.", t);
  }
  
  try {    
    if (overwroteOriginalTxIsolationValue) {
      conn.setTransactionIsolation(originalTxIsolationValue);
    }
  } catch (Throwable t) {
    getLog().warn("Failed restore connection's original transaction isolation setting.", t);
  }
}

origin: quartz-scheduler/quartz

  (AttributeRestoringConnectionInvocationHandler)invocationHandler;
connHandler.restoreOriginalAtributes();
closeConnection(connHandler.getWrappedConnection());
return;
origin: quartz-scheduler/quartz

  /**
   * Attempts to restore the auto commit and transaction isolation connection
   * attributes of the wrapped connection to their original values (if they
   * were overwritten), before finally actually closing the wrapped connection.
   */
  public void close() throws SQLException {
    restoreOriginalAtributes();
    
    conn.close();
  }
}
origin: quartz-scheduler/quartz

  (AttributeRestoringConnectionInvocationHandler)invocationHandler;
connHandler.restoreOriginalAtributes();
closeConnection(connHandler.getWrappedConnection());
return;
origin: quartz-scheduler/quartz

  /**
   * Attempts to restore the auto commit and transaction isolation connection
   * attributes of the wrapped connection to their original values (if they
   * were overwritten), before finally actually closing the wrapped connection.
   */
  public void close() throws SQLException {
    restoreOriginalAtributes();
    
    conn.close();
  }
}
origin: quartz-scheduler/quartz

public Object invoke(Object proxy, Method method, Object[] args)
  throws Throwable {
  if (method.getName().equals("setAutoCommit")) {
    setAutoCommit(((Boolean)args[0]).booleanValue());
  } else if (method.getName().equals("setTransactionIsolation")) {
    setTransactionIsolation(((Integer)args[0]).intValue());
  } else if (method.getName().equals("close")) {
    close();
  } else {
    try {
      return method.invoke(conn, args);
    }
    catch(InvocationTargetException ite) {
      throw (ite.getCause() != null ? ite.getCause() : ite);
    }
    
  }
  
  return null;
}
 
origin: com.opensymphony.quartz/com.springsource.org.quartz

  (AttributeRestoringConnectionInvocationHandler)invocationHandler;
connHandler.restoreOriginalAtributes();
closeConnection(connHandler.getWrappedConnection());
return;
origin: quartz/quartz-all

  /**
   * Attempts to restore the auto commit and transaction isolation connection
   * attributes of the wrapped connection to their original values (if they
   * were overwritten), before finally actually closing the wrapped connection.
   */
  public void close() throws SQLException {
    restoreOriginalAtributes();
    
    conn.close();
  }
}
origin: quartz-scheduler/quartz

/**
 * Wrap the given <code>Connection</code> in a Proxy such that attributes 
 * that might be set will be restored before the connection is closed 
 * (and potentially restored to a pool).
 */
protected Connection getAttributeRestoringConnection(Connection conn) {
  return (Connection)Proxy.newProxyInstance(
      Thread.currentThread().getContextClassLoader(),
      new Class[] { Connection.class },
      new AttributeRestoringConnectionInvocationHandler(conn));
}

origin: quartz-scheduler/quartz

/**
 * Attempts to restore the auto commit and transaction isolation connection
 * attributes of the wrapped connection to their original values (if they
 * were overwritten).
 */
public void restoreOriginalAtributes() {
  try {
    if (overwroteOriginalAutoCommitValue) {
      conn.setAutoCommit(originalAutoCommitValue);
    }
  } catch (Throwable t) {
    getLog().warn("Failed restore connection's original auto commit setting.", t);
  }
  
  try {    
    if (overwroteOriginalTxIsolationValue) {
      conn.setTransactionIsolation(originalTxIsolationValue);
    }
  } catch (Throwable t) {
    getLog().warn("Failed restore connection's original transaction isolation setting.", t);
  }
}

origin: quartz/quartz-all

public Object invoke(Object proxy, Method method, Object[] args)
  throws Throwable {
  if (method.getName().equals("setAutoCommit")) {
    setAutoCommit(((Boolean)args[0]).booleanValue());
  } else if (method.getName().equals("setTransactionIsolation")) {
    setTransactionIsolation(((Integer)args[0]).intValue());
  } else if (method.getName().equals("close")) {
    close();
  } else {
    return method.invoke(conn, args);
  }
  
  return null;
}
 
origin: quartz/quartz-all

  (AttributeRestoringConnectionInvocationHandler)invocationHandler;
connHandler.restoreOriginalAtributes();
closeConnection(connHandler.getWrappedConnection());
return;
origin: com.opensymphony.quartz/com.springsource.org.quartz

  /**
   * Attempts to restore the auto commit and transaction isolation connection
   * attributes of the wrapped connection to their original values (if they
   * were overwritten), before finally actually closing the wrapped connection.
   */
  public void close() throws SQLException {
    restoreOriginalAtributes();
    
    conn.close();
  }
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * Wrap the given <code>Connection</code> in a Proxy such that attributes 
 * that might be set will be restored before the connection is closed 
 * (and potentially restored to a pool).
 */
protected Connection getAttributeRestoringConnection(Connection conn) {
  return (Connection)Proxy.newProxyInstance(
      Thread.currentThread().getContextClassLoader(),
      new Class[] { Connection.class },
      new AttributeRestoringConnectionInvocationHandler(conn));
}
 
origin: quartz/quartz-all

/**
 * Attempts to restore the auto commit and transaction isolation connection
 * attributes of the wrapped connection to their original values (if they
 * were overwritten).
 */
public void restoreOriginalAtributes() {
  try {
    if (overwroteOriginalAutoCommitValue) {
      conn.setAutoCommit(originalAutoCommitValue);
    }
  } catch (Throwable t) {
    getLog().warn("Failed restore connection's original auto commit setting.", t);
  }
  
  try {    
    if (overwroteOriginalTxIsolationValue) {
      conn.setTransactionIsolation(originalTxIsolationValue);
    }
  } catch (Throwable t) {
    getLog().warn("Failed restore connection's original transaction isolation setting.", t);
  }
}

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

public Object invoke(Object proxy, Method method, Object[] args)
  throws Throwable {
  if (method.getName().equals("setAutoCommit")) {
    setAutoCommit(((Boolean)args[0]).booleanValue());
  } else if (method.getName().equals("setTransactionIsolation")) {
    setTransactionIsolation(((Integer)args[0]).intValue());
  } else if (method.getName().equals("close")) {
    close();
  } else {
    return method.invoke(conn, args);
  }
  
  return null;
}
 
origin: quartz/quartz-all

/**
 * Wrap the given <code>Connection</code> in a Proxy such that attributes 
 * that might be set will be restored before the connection is closed 
 * (and potentially restored to a pool).
 */
protected Connection getAttributeRestoringConnection(Connection conn) {
  return (Connection)Proxy.newProxyInstance(
      Thread.currentThread().getContextClassLoader(),
      new Class[] { Connection.class },
      new AttributeRestoringConnectionInvocationHandler(conn));
}

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

/**
 * Attempts to restore the auto commit and transaction isolation connection
 * attributes of the wrapped connection to their original values (if they
 * were overwritten).
 */
public void restoreOriginalAtributes() {
  try {
    if (overwroteOriginalAutoCommitValue) {
      conn.setAutoCommit(originalAutoCommitValue);
    }
  } catch (Throwable t) {
    getLog().warn("Failed restore connection's original auto commit setting.", t);
  }
  
  try {    
    if (overwroteOriginalTxIsolationValue) {
      conn.setTransactionIsolation(originalTxIsolationValue);
    }
  } catch (Throwable t) {
    getLog().warn("Failed restore connection's original transaction isolation setting.", t);
  }
}
 
org.quartz.impl.jdbcjobstoreAttributeRestoringConnectionInvocationHandler

Javadoc

Protects a java.sql.Connection's attributes from being permanently modfied.

Wraps a provided java.sql.Connection such that its auto commit and transaction isolation attributes can be overwritten, but will automatically restored to their original values when the connection is actually closed (and potentially returned to a pool for reuse).

Most used methods

  • <init>
  • close
    Attempts to restore the auto commit and transaction isolation connection attributes of the wrapped c
  • getLog
  • getWrappedConnection
    Gets the underlying connection to which all operations ultimately defer. This is provided in case a
  • restoreOriginalAtributes
    Attempts to restore the auto commit and transaction isolation connection attributes of the wrapped c
  • setAutoCommit
    Sets this connection's auto-commit mode to the given state, saving the original mode. The connection
  • setTransactionIsolation
    Attempts to change the transaction isolation level to the given level, saving the original level. Th

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JButton (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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