Codota Logo
AttributeRestoringConnectionInvocationHandler
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
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-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/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

/**
 * 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

/**
 * 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), before finally actually closing the wrapped connection.
   */
  public void close() throws SQLException {
    restoreOriginalAtributes();
    
    conn.close();
  }
}
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

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
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