db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r165585 [14/42] - in /incubator/derby/code/trunk/java/client/org/apache/derby: client/ client/am/ client/net/ client/resources/ jdbc/
Date Mon, 02 May 2005 06:26:03 GMT
Modified: incubator/derby/code/trunk/java/client/org/apache/derby/client/am/GetResourceInputStreamAction.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/GetResourceInputStreamAction.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/client/org/apache/derby/client/am/GetResourceInputStreamAction.java
(original)
+++ incubator/derby/code/trunk/java/client/org/apache/derby/client/am/GetResourceInputStreamAction.java
Sun May  1 23:25:59 2005
@@ -21,80 +21,72 @@
 package org.apache.derby.client.am;
 
 /**
- * Java 2 PrivilegedAction encapsulation of attempting to acquire driver-general
- * properties as a System resource.
+ * Java 2 PrivilegedAction encapsulation of attempting to acquire driver-general properties
as a System resource.
  */
-public class GetResourceInputStreamAction implements java.security.PrivilegedAction
-{
-  // Name for loading the resource.
-  private String resourceName_ = null;
-  // Path of the resource being loaded.
-  private String resourcePath_ = null;
-  // Class loader being used to load the resource.
-  private String resourceLoaderId_ = null;
-
-  //-------------------- Constructors --------------------
-  
-  public GetResourceInputStreamAction (String resourceName)
-  {
-    resourceName_ = resourceName;
-  }
-
-  //-------------------- methods --------------------
-
-  public Object run()
-  {
-    try {
-      ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
-      if (contextLoader != null) {
-        java.net.URL resourceUrl = contextLoader.getResource (resourceName_);
-        if (resourceUrl != null) {
-          resourcePath_ = resourceUrl.getPath();
-          resourceLoaderId_ = "Context ClassLoader: " + contextLoader;
-          return contextLoader.getResourceAsStream (resourceName_);
-        }
-      }
-      ClassLoader thisLoader = getClass().getClassLoader();
-      if (thisLoader != contextLoader) {
-        java.net.URL resourceUrl = thisLoader.getResource (resourceName_);
-        if (resourceUrl != null) {
-          resourcePath_ = resourceUrl.getPath();
-          resourceLoaderId_ = "Driver ClassLoader: " + thisLoader;
-          return thisLoader.getResourceAsStream (resourceName_);
-        }
-      }
-      ClassLoader systemLoader = ClassLoader.getSystemClassLoader();
-      if (systemLoader != contextLoader &&
-          systemLoader != thisLoader) {
-        java.net.URL resourceUrl = systemLoader.getResource (resourceName_);
-        if (resourceUrl != null) {
-          resourcePath_ = resourceUrl.getPath();
-          resourceLoaderId_ = "System ClassLoader: " + systemLoader;
-          return systemLoader.getResourceAsStream (resourceName_);
+public class GetResourceInputStreamAction implements java.security.PrivilegedAction {
+    // Name for loading the resource.
+    private String resourceName_ = null;
+    // Path of the resource being loaded.
+    private String resourcePath_ = null;
+    // Class loader being used to load the resource.
+    private String resourceLoaderId_ = null;
+
+    //-------------------- Constructors --------------------
+
+    public GetResourceInputStreamAction(String resourceName) {
+        resourceName_ = resourceName;
+    }
+
+    //-------------------- methods --------------------
+
+    public Object run() {
+        try {
+            ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
+            if (contextLoader != null) {
+                java.net.URL resourceUrl = contextLoader.getResource(resourceName_);
+                if (resourceUrl != null) {
+                    resourcePath_ = resourceUrl.getPath();
+                    resourceLoaderId_ = "Context ClassLoader: " + contextLoader;
+                    return contextLoader.getResourceAsStream(resourceName_);
+                }
+            }
+            ClassLoader thisLoader = getClass().getClassLoader();
+            if (thisLoader != contextLoader) {
+                java.net.URL resourceUrl = thisLoader.getResource(resourceName_);
+                if (resourceUrl != null) {
+                    resourcePath_ = resourceUrl.getPath();
+                    resourceLoaderId_ = "Driver ClassLoader: " + thisLoader;
+                    return thisLoader.getResourceAsStream(resourceName_);
+                }
+            }
+            ClassLoader systemLoader = ClassLoader.getSystemClassLoader();
+            if (systemLoader != contextLoader &&
+                    systemLoader != thisLoader) {
+                java.net.URL resourceUrl = systemLoader.getResource(resourceName_);
+                if (resourceUrl != null) {
+                    resourcePath_ = resourceUrl.getPath();
+                    resourceLoaderId_ = "System ClassLoader: " + systemLoader;
+                    return systemLoader.getResourceAsStream(resourceName_);
+                }
+            }
+            return null;
+        } catch (java.security.AccessControlException ace) {
+            // This happens in an Applet environment,
+            // so return with null.
+            return null;
         }
-      }
-      return null;
     }
-    catch (java.security.AccessControlException ace) {
-      // This happens in an Applet environment,
-      // so return with null.
-      return null;
+
+    public void setResourceName(String resourceName) {
+        resourceName_ = resourceName;
+    }
+
+    public String getResourcePath() {
+        return resourcePath_;
+    }
+
+    public String getResourceLoaderId() {
+        return resourceLoaderId_;
     }
-  }
-  
-  public void setResourceName (String resourceName)
-  {
-    resourceName_ = resourceName;
-  }
-  
-  public String getResourcePath()
-  {
-    return resourcePath_;
-  }
-  
-  public String getResourceLoaderId()
-  {
-    return resourceLoaderId_;
-  }
 
 }

Modified: incubator/derby/code/trunk/java/client/org/apache/derby/client/am/GetSystemPropertiesAction.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/GetSystemPropertiesAction.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/client/org/apache/derby/client/am/GetSystemPropertiesAction.java
(original)
+++ incubator/derby/code/trunk/java/client/org/apache/derby/client/am/GetSystemPropertiesAction.java
Sun May  1 23:25:59 2005
@@ -24,34 +24,31 @@
 /**
  * Java 2 PrivilegedAction encapsulation of System getProperties processing
  */
-public class GetSystemPropertiesAction implements java.security.PrivilegedAction
-{
-  // System properties values, i.e. output from System.getProperties()
-  private java.util.Properties systemProperties_ = null;
+public class GetSystemPropertiesAction implements java.security.PrivilegedAction {
+    // System properties values, i.e. output from System.getProperties()
+    private java.util.Properties systemProperties_ = null;
 
-  //============================== Constructor ==============================
+    //============================== Constructor ==============================
 
-  //-------------------- GetSystemPropertiesAction --------------------
-  /**
-   * Constructor.
-   */
-  public GetSystemPropertiesAction ()
-  {}
+    //-------------------- GetSystemPropertiesAction --------------------
+    /**
+     * Constructor.
+     */
+    public GetSystemPropertiesAction() {
+    }
 
-  /**
-   * Performs the privileged action of System.getProperties()
-   */
-  public Object run()
-  {
-    this.systemProperties_ = System.getProperties();
-    return this.systemProperties_;
-  }
+    /**
+     * Performs the privileged action of System.getProperties()
+     */
+    public Object run() {
+        this.systemProperties_ = System.getProperties();
+        return this.systemProperties_;
+    }
 
-  /**
-   * Accessor for system properties (used after run() method invocation)
-   */
-  public java.util.Properties getSystemProperties()
-  {
-    return this.systemProperties_;
-  }
+    /**
+     * Accessor for system properties (used after run() method invocation)
+     */
+    public java.util.Properties getSystemProperties() {
+        return this.systemProperties_;
+    }
 }

Modified: incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Lob.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Lob.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Lob.java (original)
+++ incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Lob.java Sun May  1
23:25:59 2005
@@ -20,83 +20,81 @@
 
 package org.apache.derby.client.am;
 
-public abstract class Lob implements UnitOfWorkListener
-{
-  // The following flags specify the data type(s) a LOB instance currently contains
-  public static final int STRING = 2;
-  public static final int ASCII_STREAM = 4;
-  public static final int UNICODE_STREAM = 8;
-  public static final int CHARACTER_STREAM = 16;
-  public static final int BINARY_STREAM = 32;
-  public static final int BINARY_STRING = 64;
-
-  //---------------------navigational members-----------------------------------
-  protected Agent agent_;
-
-  //-----------------------------state------------------------------------------
-  protected int dataType_ = 0;      // data type(s) the LOB instance currently contains
-
-  protected long sqlLength_;      // length of the LOB value, as defined by the server
-  protected boolean lengthObtained_;
-
-  //---------------------constructors/finalizer---------------------------------
-  protected Lob (Agent agent)
-  {
-    agent_ = agent;
-    lengthObtained_ = false;
-  }
+public abstract class Lob implements UnitOfWorkListener {
+    // The following flags specify the data type(s) a LOB instance currently contains
+    public static final int STRING = 2;
+    public static final int ASCII_STREAM = 4;
+    public static final int UNICODE_STREAM = 8;
+    public static final int CHARACTER_STREAM = 16;
+    public static final int BINARY_STREAM = 32;
+    public static final int BINARY_STRING = 64;
+
+    //---------------------navigational members-----------------------------------
+    protected Agent agent_;
+
+    //-----------------------------state------------------------------------------
+    protected int dataType_ = 0;      // data type(s) the LOB instance currently contains
+
+    protected long sqlLength_;      // length of the LOB value, as defined by the server
+    protected boolean lengthObtained_;
+
+    //---------------------constructors/finalizer---------------------------------
+    protected Lob(Agent agent) {
+        agent_ = agent;
+        lengthObtained_ = false;
+    }
 
-  protected void finalize () throws java.lang.Throwable
-  {
-    super.finalize();
-  }
+    protected void finalize() throws java.lang.Throwable {
+        super.finalize();
+    }
 
-  // ---------------------------jdbc 2------------------------------------------
+    // ---------------------------jdbc 2------------------------------------------
 
-  // should only be called by a synchronized method.
+    // should only be called by a synchronized method.
 
 
-  // should only be called by a synchronized method.
-  public long sqlLength () throws SqlException
-  {
-    checkForClosedConnection ();
+    // should only be called by a synchronized method.
+    public long sqlLength() throws SqlException {
+        checkForClosedConnection();
 
-    return sqlLength_;
-  }
+        return sqlLength_;
+    }
 
 
-  //-----------------------event callback methods-------------------------------
+    //-----------------------event callback methods-------------------------------
 
-  public void listenToUnitOfWork()
-  {
-    agent_.connection_.CommitAndRollbackListeners_.add (this);
-  }
+    public void listenToUnitOfWork() {
+        agent_.connection_.CommitAndRollbackListeners_.add(this);
+    }
 
-  public void completeLocalCommit (java.util.Iterator listenerIterator)
-  {
-    listenerIterator.remove();
-  }
+    public void completeLocalCommit(java.util.Iterator listenerIterator) {
+        listenerIterator.remove();
+    }
 
-  public void completeLocalRollback (java.util.Iterator listenerIterator)
-  {
-    listenerIterator.remove();
-  }
+    public void completeLocalRollback(java.util.Iterator listenerIterator) {
+        listenerIterator.remove();
+    }
 
-  //----------------------------helper methods----------------------------------
+    //----------------------------helper methods----------------------------------
 
-  public Agent getAgent () { return agent_; }
+    public Agent getAgent() {
+        return agent_;
+    }
 
-  void checkForClosedConnection () throws SqlException
-  {
-    if (agent_.connection_.isClosedX()) {
-      agent_.checkForDeferredExceptions();
-      throw new SqlException (agent_.logWriter_, "Lob method called after connection was
closed");
+    void checkForClosedConnection() throws SqlException {
+        if (agent_.connection_.isClosedX()) {
+            agent_.checkForDeferredExceptions();
+            throw new SqlException(agent_.logWriter_, "Lob method called after connection
was closed");
+        } else {
+            agent_.checkForDeferredExceptions();
+        }
     }
-    else {
-      agent_.checkForDeferredExceptions();
+
+    void completeLocalRollback() {
+        ;
     }
-  }
 
-  void completeLocalRollback() { ; }
-  void completeLocalCommit() { ; }
+    void completeLocalCommit() {
+        ;
+    }
 }



Mime
View raw message