Revision: 5808
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5808&view=rev
Author: manningr
Date: 2010-08-21 17:36:13 +0000 (Sat, 21 Aug 2010)
Log Message:
-----------
Initial changes to convert from Ant build to Maven build
Added Paths:
-----------
trunk/sql12/plugins/cache/pom.xml
trunk/sql12/plugins/cache/src/main/
trunk/sql12/plugins/cache/src/main/java/
trunk/sql12/plugins/cache/src/main/java/com/
trunk/sql12/plugins/cache/src/main/java/com/intersys/
trunk/sql12/plugins/cache/src/main/java/com/intersys/classes/
trunk/sql12/plugins/cache/src/main/java/com/intersys/classes/SYSTEM/
trunk/sql12/plugins/cache/src/main/java/com/intersys/classes/SYSTEM/Process.java
trunk/sql12/plugins/cache/src/main/java/de/
trunk/sql12/plugins/cache/src/main/java/de/ixdb/
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/CachePlugin.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/CachePluginResources.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/CdlAccessor.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrl.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrlListener.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/NamespaceDlg.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ProcessData.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ProcessListPanel.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ProcessListTab.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ProcessListTabListener.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/QueryPlanPanel.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/QueryPlanTab.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/QueryPlanTabListener.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ScriptCdlAction.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ScriptCdlCommand.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ScriptFunctionAction.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ScriptFunctionCommand.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ScriptViewAction.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ScriptViewCommand.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ShowNamespacesAction.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ShowNamespacesCommand.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ShowProcessesAction.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ShowProcessesCommand.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ShowQueryPlanAction.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/ShowQueryPlanCommand.java
trunk/sql12/plugins/cache/src/main/java/de/ixdb/squirrel_sql/plugins/cache/VersionInfo.java
trunk/sql12/plugins/cache/src/main/resources/
trunk/sql12/plugins/cache/src/main/resources/de/
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/squirrel_sql/
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/squirrel_sql/plugins/
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/squirrel_sql/plugins/cache/
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/squirrel_sql/plugins/cache/I18NStrings.properties
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/squirrel_sql/plugins/cache/cache.properties
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/squirrel_sql/plugins/cache/images/
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/squirrel_sql/plugins/cache/images/namespaces.gif
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/squirrel_sql/plugins/cache/images/processinfo.gif
trunk/sql12/plugins/cache/src/main/resources/de/ixdb/squirrel_sql/plugins/cache/images/showexecplan.gif
trunk/sql12/plugins/cache/src/main/resources/doc/
Removed Paths:
-------------
trunk/sql12/plugins/cache/doc/
trunk/sql12/plugins/cache/plugin_build.xml
trunk/sql12/plugins/cache/src/com/intersys/classes/SYSTEM/Process.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CachePlugin.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CachePluginResources.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CdlAccessor.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/I18NStrings.properties
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrl.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrlListener.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceDlg.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessData.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessListPanel.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessListTab.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessListTabListener.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/QueryPlanPanel.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/QueryPlanTab.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/QueryPlanTabListener.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ScriptCdlAction.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ScriptCdlCommand.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ScriptFunctionAction.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ScriptFunctionCommand.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ScriptViewAction.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ScriptViewCommand.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ShowNamespacesAction.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ShowNamespacesCommand.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ShowProcessesAction.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ShowProcessesCommand.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ShowQueryPlanAction.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ShowQueryPlanCommand.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/VersionInfo.java
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/cache.properties
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/images/namespaces.gif
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/images/processinfo.gif
trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/images/showexecplan.gif
Property Changed:
----------------
trunk/sql12/plugins/cache/
Property changes on: trunk/sql12/plugins/cache
___________________________________________________________________
Added: svn:ignore
+ target
.settings
.project
.classpath
Deleted: trunk/sql12/plugins/cache/plugin_build.xml
===================================================================
--- trunk/sql12/plugins/cache/plugin_build.xml 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/plugin_build.xml 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,120 +0,0 @@
-<?xml version="1.0"?>
-<!--
- This is an Apache Ant build file to build the Cache plugin
- for distribution.
--->
-<project name="plugin-cache" default="build" basedir=".">
- <target name="init">
- <tstamp/>
- <property name="internal_name" value="cache"/>
- <property name="version" value="0.11"/>
-
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="on"/>
- <property name="targetVM" value="1.6"/>
-
- <!-- adapt these lines to your need -->
- <!--
- <property name="p_plugin.work_dir" value="/home/gerd/work/java/squirrel1_2/squirrel-sql-dist/squirrel-sql/cache"/>
- <property name="p_plugin.core_libs_dir" value="/home/gerd/work/java/squirrel1_2/squirrel-sql-dist/squirrel-sql/core/dist/lib"/>
- <property name="p_plugin.dist_dir" value="/home/gerd/work/java/squirrel1_2/squirrel-sql-dist/squirrel-sql/core/dist/plugins"/>
- -->
- <echo message="---------------- ${internal_name} ${version} ----------------"/>
-
- <property environment="env"/>
- </target>
-
- <target name="initdirs" unless="p_plugin.work_dir">
- <property name="dist_dir" value="../../../squirrel-sql-dist/squirrel-sql"/>
- <property name="plugins_dist_dir" value="${dist_dir}/plugins"/>
- <property name="p_plugin.work_dir" value="${plugins_dist_dir}/${internal_name}/work"/>
- <property name="p_plugin.core_libs_dir" value="${dist_dir}/core/dist/lib"/>
- <property name="p_plugin.dist_dir" value="${dist_dir}/core/dist/plugins"/>
- </target>
-
-
- <!--
- ==================================================================
- Compile the plugin.
- No parameters.
- ==================================================================
- -->
- <target name="build" depends="init, initdirs">
- <property name="obj_dir" value="${p_plugin.work_dir}/obj"/>
-
- <mkdir dir="${obj_dir}"/>
-
-
- <javac srcdir="src"
- destdir="${obj_dir}"
- deprecation="${deprecation}"
- debug="${debug}"
- optimize="${optimize}"
- includeJavaRuntime="yes"
- source="${targetVM}"
- target="${targetVM}">
- <classpath>
- <fileset dir="lib">
- <include name="**/*.*"/>
- </fileset>
- <fileset dir="${p_plugin.core_libs_dir}">
- <include name="**/*.*"/>
- </fileset>
- </classpath>
- </javac>
- <copy todir="${obj_dir}" >
- <fileset dir="src" >
- <include name="**/*.gif"/>
- <include name="**/*.jpg"/>
- <include name="**/*.jpeg"/>
- <include name="**/*.xml"/>
- <include name="**/*.xsl"/>
- <include name="**/*.properties"/>
- </fileset>
- </copy>
-
- <jar jarfile="${p_plugin.dist_dir}/${internal_name}.jar" compress="false">
- <fileset dir="${obj_dir}">
- <include name="**/*.*"/>
- </fileset>
- </jar>
-
- <copy todir="${p_plugin.dist_dir}/${internal_name}" >
- <fileset dir="doc" >
- <include name="*.*"/>
- </fileset>
- </copy>
-
-
- <!--**********************************************************************-->
- <!-- What happens here sure is filthy because we copy plugin stuff to -->
- <!-- the core applications lib dir. It is necesary though since Cache -->
- <!-- uses the class loader.-->
-
-
- <copy todir="${p_plugin.core_libs_dir}" >
- <fileset dir="lib" >
- <include name="*.*"/>
- </fileset>
- </copy>
-
- <copy todir="${p_plugin.core_libs_dir}" >
- <fileset dir="${p_plugin.dist_dir}" >
- <include name="${internal_name}.jar"/>
- </fileset>
- </copy>
-
- <!-- -->
- <!--**********************************************************************-->
-
- <jar jarfile="${p_plugin.dist_dir}/${internal_name}/src.jar" compress="false">
- <fileset dir=".">
- <include name="src/**/*.*"/>
- <include name="plugin_build.xml"/>
- </fileset>
- </jar>
- </target>
-
-</project>
-
Added: trunk/sql12/plugins/cache/pom.xml
===================================================================
--- trunk/sql12/plugins/cache/pom.xml (rev 0)
+++ trunk/sql12/plugins/cache/pom.xml 2010-08-21 17:36:13 UTC (rev 5808)
@@ -0,0 +1,140 @@
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sf.squirrel-sql.plugins</groupId>
+ <artifactId>squirrelsql-plugins-parent-pom</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.squirrel-sql.plugins</groupId>
+ <artifactId>cache</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Cache Plugin</name>
+ <description>Cache Plugin</description>
+ <inceptionYear>2001</inceptionYear>
+ <developers>
+ <developer>
+ <name>Gerd Wagner</name>
+ <roles>
+ <role>Administrator</role>
+ <role>Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Rob Manning</name>
+ <roles>
+ <role>Developer</role>
+ <role>Release Manager</role>
+ </roles>
+ </developer>
+ </developers>
+ <licenses>
+ <license>
+ <name>GNU Lesser General Public License</name>
+ <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <url>http://www.squirrelsql.org/</url>
+ <scm>
+ <connection>scm:svn:https://squirrel-sql.svn.sourceforge.net/svnroot/squirrel-sql/trunk/sql12/</connection>
+ <developerConnection>scm:svn:http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</developerConnection>
+ <url>http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</url>
+ </scm>
+ <issueManagement>
+ <system>SourceForge Tracker</system>
+ <url>http://sourceforge.net/tracker/?group_id=28383%26atid=393414</url>
+ </issueManagement>
+ <ciManagement>
+ <system>Hudson</system>
+ <url>https://www.squirrel-sql.org/hudson/</url>
+ </ciManagement>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>fw</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrel-sql</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrel-sql</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrelsql-test-utils</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql.thirdparty-non-maven</groupId>
+ <artifactId>CacheDB</artifactId>
+ <version>2008.2.0.526.0</version>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>${source-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire-plugin-version}</version>
+ <configuration>
+ <parallel>${surefire-parallel-type}</parallel>
+ <threadCount>${surefire-thread-count}</threadCount>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>${jar-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${assembly-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>${findbugs-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <version>${pmd-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>${checkstyle-plugin-version}</version>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <!--
+ Since generating javadoc can be time-consuming, this is not done unless a "javadoc" profile is activated.
+ -->
+ <profile>
+ <id>javadoc</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${javadoc-plugin-version}</version>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
Deleted: trunk/sql12/plugins/cache/src/com/intersys/classes/SYSTEM/Process.java
===================================================================
--- trunk/sql12/plugins/cache/src/com/intersys/classes/SYSTEM/Process.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/com/intersys/classes/SYSTEM/Process.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,79 +0,0 @@
-package com.intersys.classes.SYSTEM;
-
-import com.intersys.classes.Persistent;
-import com.intersys.classes.RegisteredObject;
-import com.intersys.objects.Database;
-import com.intersys.objects.CacheException;
-import com.intersys.objects.Id;
-import com.intersys.cache.CacheObject;
-import com.intersys.cache.SysDatabase;
-import com.intersys.cache.Dataholder;
-
-
-public class Process extends Persistent
-{
- private static String CACHE_CLASS_NAME = "%SYSTEM.Process";
-
- /**
- * NB: DO NOT USE IN APPLICATION!
- * Use <code>Person._open</code> instead.
- * <p/>
- * Used to construct a Java object, corresponding to existing object
- * in Cache database.
- *
- * @see #_open(com.intersys.objects.Database, com.intersys.objects.Oid)
- * @see #_open(com.intersys.objects.Database, com.intersys.objects.Id)
- */
- public Process(CacheObject ref) throws CacheException
- {
- super(ref);
- }
-
- /**
- * Creates a new instance of object "<CacheClassName>" in Cache
- * database and corresponding object of class
- * <code>Person</code>.
- *
- * @param _db <code>Database</code> object used for connection with
- * Cache database.
- * @throws CacheException in case of error.
- * @see #_open(com.intersys.objects.Database, com.intersys.objects.Oid)
- * @see #_open(com.intersys.objects.Database, com.intersys.objects.Id)
- */
- public Process(Database db) throws CacheException
- {
- super(((SysDatabase) db).newCacheObject(CACHE_CLASS_NAME));
- }
-
- /**
- * Runs method <code> %OpenId </code> in Cache to open an object
- * from Cache database and creates corresponding object of class
- * <code>Person</code>.
- *
- * @param _db <code>Database</code> object used for connection with
- * Cache database.
- * @param id ID as specified in Cache represented as
- * <code>Id</code>.
- * @return <code> RegisteredObject </code>, corresponding to opened
- * object. This object may be of <code>Person</code> or of
- * any of its subclasses. Cast to <code>Person</code> is
- * guaranteed to pass without <code>ClassCastException</code> exception.
- * @throws CacheException in case of error.
- * @see java.lang.ClassCastException
- * @see #_open(com.intersys.objects.Database, com.intersys.objects.Oid)
- * @see #Person
- */
- public static RegisteredObject _open(Database db, Id id) throws CacheException
- {
- CacheObject cobj = (((SysDatabase) db).openCacheObject(CACHE_CLASS_NAME, id.toString()));
- return (RegisteredObject) (cobj.newJavaInstance());
- }
-
- public Dataholder terminate() throws CacheException
- {
- Dataholder[] args = new Dataholder[0];
- Dataholder res=mInternal.runInstanceMethod("Terminate",args,Database.RET_PRIM);
- return res;
-
- }
-}
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CachePlugin.java
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CachePlugin.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CachePlugin.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,247 +0,0 @@
-package de.ixdb.squirrel_sql.plugins.cache;
-
-import net.sourceforge.squirrel_sql.client.IApplication;
-import net.sourceforge.squirrel_sql.client.gui.session.SQLInternalFrame;
-import net.sourceforge.squirrel_sql.client.gui.session.ObjectTreeInternalFrame;
-import net.sourceforge.squirrel_sql.client.action.ActionCollection;
-import net.sourceforge.squirrel_sql.client.plugin.*;
-import net.sourceforge.squirrel_sql.client.preferences.IGlobalPreferencesPanel;
-import net.sourceforge.squirrel_sql.client.session.IObjectTreeAPI;
-import net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI;
-import net.sourceforge.squirrel_sql.client.session.ISession;
-import net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectType;
-import net.sourceforge.squirrel_sql.fw.util.log.ILogger;
-import net.sourceforge.squirrel_sql.fw.util.log.LoggerController;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * The SQL Script plugin class.
- */
-public class CachePlugin extends DefaultSessionPlugin
-{
-
- /** Logger for this class. */
- private static ILogger s_log = LoggerController.createLogger(CachePlugin.class);
-
- /** The app folder for this plugin. */
- private File _pluginAppFolder;
-
- private PluginResources _resources;
-
- /** Folder to store user settings in. */
- private File _userSettingsFolder;
-
- /**
- * Return the internal name of this plugin.
- *
- * @return the internal name of this plugin.
- */
- public String getInternalName()
- {
- return "cache";
- }
-
- /**
- * Return the descriptive name of this plugin.
- *
- * @return the descriptive name of this plugin.
- */
- public String getDescriptiveName()
- {
- return "Plugin for the Intersystems Cache DB";
- }
-
- /**
- * Returns the current version of this plugin.
- *
- * @return the current version of this plugin.
- */
- public String getVersion()
- {
- return "0.01";
- }
-
- /**
- * Returns the authors name.
- *
- * @return the authors name.
- */
- public String getAuthor()
- {
- return "Gerd Wagner";
- }
-
- /**
- * Returns the name of the change log for the plugin. This should
- * be a text or HTML file residing in the <TT>getPluginAppSettingsFolder</TT>
- * directory.
- *
- * @return the changelog file name or <TT>null</TT> if plugin doesn't have
- * a change log.
- */
- public String getChangeLogFileName()
- {
- return "changes.txt";
- }
-
- /**
- * Returns the name of the Help file for the plugin. This should
- * be a text or HTML file residing in the <TT>getPluginAppSettingsFolder</TT>
- * directory.
- *
- * @return the Help file name or <TT>null</TT> if plugin doesn't have
- * a help file.
- */
- public String getHelpFileName()
- {
- return "readme.txt";
- }
-
- /**
- * Returns the name of the Licence file for the plugin. This should
- * be a text or HTML file residing in the <TT>getPluginAppSettingsFolder</TT>
- * directory.
- *
- * @return the Licence file name or <TT>null</TT> if plugin doesn't have
- * a licence file.
- */
- public String getLicenceFileName()
- {
- return "licence.txt";
- }
-
- /**
- * @return Comma separated list of contributors.
- */
- public String getContributors()
- {
- return "Andreas Schneider";
- }
-
- /**
- * Create preferences panel for the Global Preferences dialog.
- *
- * @return Preferences panel.
- */
- public IGlobalPreferencesPanel[] getGlobalPreferencePanels()
- {
- return new IGlobalPreferencesPanel[0];
- }
-
- /**
- * Initialize this plugin.
- */
- public synchronized void initialize() throws PluginException
- {
- super.initialize();
- IApplication app = getApplication();
-
-
- // Folder within plugins folder that belongs to this
- // plugin.
- try
- {
- _pluginAppFolder = getPluginAppSettingsFolder();
- }
- catch (IOException ex)
- {
- throw new PluginException(ex);
- }
-
- // Folder to store user settings.
- try
- {
- _userSettingsFolder = getPluginUserSettingsFolder();
- }
- catch (IOException ex)
- {
- throw new PluginException(ex);
- }
-
- _resources = new CachePluginResources("de.ixdb.squirrel_sql.plugins.cache.cache", this);
-
- // Load plugin preferences.
- ActionCollection coll = app.getActionCollection();
- coll.add(new ScriptViewAction(app, _resources, this));
- coll.add(new ScriptFunctionAction(app, _resources, this));
- coll.add(new ScriptCdlAction(app, _resources, this));
- coll.add(new ShowNamespacesAction(app, _resources, this));
- coll.add(new ShowQueryPlanAction(app, _resources, this));
- coll.add(new ShowProcessesAction(app, _resources, this));
-
-// coll.add(new ScriptProcedureAction(app, _resources, this, _userSettingsFolder));
-// coll.add(new RefreshRepositoryAction(app, _resources, this, _userSettingsFolder));
- }
-
- /**
- * Application is shutting down so save data.
- */
- public void unload()
- {
- super.unload();
- }
-
- /**
- * Called when a session started. Add commands to popup menu
- * in object tree.
- *
- * @param session The session that is starting.
- *
- * @return <TT>true</TT> to indicate that this plugin is
- * applicable to passed session.
- */
- public PluginSessionCallback sessionStarted(ISession session)
- {
- try
- {
- if(-1 != session.getSQLConnection().getConnection().getMetaData().getDriverName().toUpperCase().indexOf("CACHE"))
- {
- ActionCollection coll = getApplication().getActionCollection();
- IObjectTreeAPI otApi = session.getSessionInternalFrame().getObjectTreeAPI();
- otApi.addToPopup(DatabaseObjectType.VIEW, coll.get(ScriptViewAction.class));
- otApi.addToPopup(DatabaseObjectType.SESSION, coll.get(ShowNamespacesAction.class));
- otApi.addToPopup(DatabaseObjectType.SESSION, coll.get(ShowProcessesAction.class));
- otApi.addToPopup(DatabaseObjectType.PROCEDURE, coll.get(ScriptFunctionAction.class));
- otApi.addToPopup(DatabaseObjectType.PROCEDURE, coll.get(ScriptCdlAction.class));
- otApi.addToPopup(DatabaseObjectType.TABLE, coll.get(ScriptCdlAction.class));
- otApi.addToPopup(DatabaseObjectType.VIEW, coll.get(ScriptCdlAction.class));
-
-
- ISQLPanelAPI sqlApi = session.getSessionInternalFrame().getSQLPanelAPI();
- sqlApi.addToSQLEntryAreaMenu(coll.get(ShowQueryPlanAction.class));
-
- session.addSeparatorToToolbar();
- session.addToToolbar(coll.get(ShowNamespacesAction.class));
- session.addToToolbar(coll.get(ShowProcessesAction.class));
- session.addToToolbar(coll.get(ShowQueryPlanAction.class));
- session.getSessionInternalFrame().addToToolsPopUp("cachequeryplan", coll.get(ShowQueryPlanAction.class));
-
-
- return new PluginSessionCallback()
- {
- public void sqlInternalFrameOpened(SQLInternalFrame sqlInternalFrame, ISession sess)
- {
- //plugin supports only Session main window
- }
-
- public void objectTreeInternalFrameOpened(ObjectTreeInternalFrame objectTreeInternalFrame, ISession sess)
- {
- //plugin supports only Session main window
- }
- };
- }
- else
- {
- return null;
- }
- }
- catch(Exception e)
- {
- s_log.error("Could not get driver name", e);
- return null;
- }
- }
-
-}
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CachePluginResources.java
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CachePluginResources.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CachePluginResources.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,13 +0,0 @@
-package de.ixdb.squirrel_sql.plugins.cache;
-
-import net.sourceforge.squirrel_sql.client.plugin.IPlugin;
-import net.sourceforge.squirrel_sql.client.plugin.PluginResources;
-
-public final class CachePluginResources extends PluginResources
-{
- CachePluginResources(String rsrcBundleBaseName, IPlugin plugin)
- {
- super(rsrcBundleBaseName, plugin);
- }
-}
-
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CdlAccessor.java
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CdlAccessor.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/CdlAccessor.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,185 +0,0 @@
-package de.ixdb.squirrel_sql.plugins.cache;
-
-import org.xml.sax.InputSource;
-import org.w3c.dom.Document;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import java.lang.reflect.Method;
-import java.io.InputStream;
-import java.io.ByteArrayInputStream;
-import java.sql.Statement;
-import java.sql.Connection;
-
-import com.intersys.cache.Dataholder;
-import com.intersys.cache.CacheObject;
-import com.intersys.objects.Database;
-import com.intersys.objects.CacheDatabase;
-import com.intersys.objects.CacheException;
-import com.intersys.objects.CacheReader;
-import com.intersys.classes.CharacterStream;
-import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo;
-import net.sourceforge.squirrel_sql.fw.sql.IProcedureInfo;
-
-public class CdlAccessor
-{
- static org.w3c.dom.Document getDocument(InputStream istream)
- {
- try
- {
- InputSource is = new InputSource(istream);
-
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setValidating(false);
- dbf.setIgnoringElementContentWhitespace(true);
-
- dbf.setNamespaceAware(true);
- DocumentBuilder db = dbf.newDocumentBuilder();
- return db.parse(is);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
-
- static String getDefinition(String list, Connection con)
- {
- try
- {
- Dataholder[] argv = new Dataholder[1];
- argv[0] = Dataholder.create(list);
-
- Database conn = CacheDatabase.getDatabase(con);
-
- Dataholder res;
-
- try
- {
- res = conn.runClassMethod("CM.methgetClassDefinition", "getClassDefinition", argv, Database.RET_OBJECT);
- }
- catch (CacheException e)
- {
- Statement stat = con.createStatement();
- stat.executeUpdate
- (
-
- "CREATE METHOD CM.getClassDefinition(IN className %String)\n" +
- "RETURNS Integer\n" +
- "PROCEDURE\n" +
- "LANGUAGE COS\n" +
- "{\n" +
- " new id,oref,oFile,file\n" +
- " if $F($ZV,\"Linux\") \n" +
- " set file = \"$HOME/CacheTemp\"_$job_\".xml\"\n" +
- " else \n" +
- " set file = \"c:\\\\temp\\\\$CacheTemp\"_$job_\".xml\" \n" +
- " do $SYSTEM.OBJ.ExportCDL(className ,file, \"-d\")\n" +
- " set oFile = ##class(%FileBinaryStream).%New()\n" +
- " do oFile.LinkToFile(file)\n" +
- "\n" +
- " set outStream = ##class(%GlobalCharacterStream).%New()\n" +
- " do outStream.CopyFrom(oFile)\n" +
- " quit outStream\n" +
- "}"
- );
- stat.close();
-
- res = conn.runClassMethod("CM.methgetClassDefinition", "getClassDefinition", argv, Database.RET_OBJECT);
- }
-
-
- CacheObject cobj = res.getCacheObject();
- CharacterStream characterStream = (CharacterStream) (cobj.newJavaInstance());
-
- CacheReader reader = characterStream.getReader();
-
- StringBuffer sb = new StringBuffer();
- sb.append("");
-
-
- char[] buf = new char[50];
- int count = reader.read(buf);
- while(true)
- {
-
- for (int i = 0; i < count; i++)
- {
- sb.append(buf[i]);
- }
-
- if(count < 50)
- {
- break;
- }
-
- count = reader.read(buf);
- }
- return sb.toString();
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
-
- static org.w3c.dom.Document getDefinitionAsXmlDoc(String list, Connection connection)
- {
- String cdl = getDefinition(list, connection);
-
- ByteArrayInputStream bis = new ByteArrayInputStream(cdl.getBytes());
-
- return getDocument(bis);
- }
-
-
- static String getSearchStringForCdlAccess(IDatabaseObjectInfo[] dbObjs)
- {
- String ret = null;
-
- for (int i = 0; i < dbObjs.length; i++)
- {
- String prefix = "User.";
-
- if(false == "SQLUser".equalsIgnoreCase(dbObjs[i].getSchemaName()))
- {
- prefix = dbObjs[i].getSchemaName() + ".";
- }
-
-
-
- if (dbObjs[i] instanceof IProcedureInfo)
- {
- IProcedureInfo pi = (IProcedureInfo) dbObjs[i];
-
- if (null == ret)
- {
- ret = prefix + "func" + pi.getSimpleName();
- ret += "," + prefix + "meth" + pi.getSimpleName();
-
- }
- else
- {
- ret += "," + prefix + "func" + pi.getSimpleName();
- ret += "," + prefix + "meth" + pi.getSimpleName();
- }
- }
- else
- {
- if (null == ret)
- {
- ret = prefix + dbObjs[i].getSimpleName();
- }
- else
- {
- ret += "," + prefix + dbObjs[i].getSimpleName();
- }
- }
-
- }
- return ret;
- }
-
-}
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/I18NStrings.properties
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/I18NStrings.properties 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/I18NStrings.properties 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1 +0,0 @@
-cache.VersionInfo.unsupported=This function is not supported in Cache Version higher than 5
\ No newline at end of file
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrl.java
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrl.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrl.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,143 +0,0 @@
-package de.ixdb.squirrel_sql.plugins.cache;
-
-import net.sourceforge.squirrel_sql.fw.gui.GUIUtils;
-import net.sourceforge.squirrel_sql.client.session.ISession;
-import net.sourceforge.squirrel_sql.client.session.event.ISessionListener;
-import net.sourceforge.squirrel_sql.client.session.event.SessionEvent;
-import net.sourceforge.squirrel_sql.client.session.event.SessionAdapter;
-
-import javax.swing.*;
-import javax.swing.table.DefaultTableModel;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.prefs.Preferences;
-import java.util.Vector;
-import java.util.Arrays;
-
-
-public class NamespaceCtrl
-{
- private NamespaceDlg _dlg;
- private NamespaceCtrlListener _namespaceCtrlListener;
- private ISession _session;
-
- private String[] _cols = new String[]{"Namespace", "Associated aliases"};
-
- private static final String PREFS_KEY_ALIAS_NAME_TEMPLATE = "Squirrel.ixdb.aliasNameTemplate";
- private static final String ALIAS_NAME_TEMPLATE_DEFAULT = "Cache %server %namespace";
-
-
- public NamespaceCtrl(ISession session, String[][] nameSpacesAndAliases, NamespaceCtrlListener namespaceCtrlListener)
- {
- _session = session;
-
- _session.getApplication().getSessionManager().addSessionListener(new SessionAdapter()
- {
- public void sessionClosed(SessionEvent evt)
- {
- _dlg.setVisible(false);
- _dlg.dispose();
- }
- });
-
- _namespaceCtrlListener = namespaceCtrlListener;
- _dlg = new NamespaceDlg(session.getApplication().getMainFrame());
-
- DefaultTableModel dtm =
- new DefaultTableModel()
- {
- public boolean isCellEditable(int row, int column)
- {
- return false;
- }
- };
-
- dtm.setDataVector(nameSpacesAndAliases, _cols);
-
- _dlg.tblNamespaces.setModel(dtm);
-
- _dlg.tblNamespaces.addMouseListener(new MouseAdapter()
- {
- public void mouseClicked(MouseEvent e)
- {
- onMouseClicked(e);
- }
-
- });
-
- String aliasNameTemplate = Preferences.userRoot().get(PREFS_KEY_ALIAS_NAME_TEMPLATE, ALIAS_NAME_TEMPLATE_DEFAULT);
-
- _dlg.txtAliasNameTemplate.setText(aliasNameTemplate);
-
- _dlg.setSize(400, 400);
-
- GUIUtils.centerWithinParent(_dlg);
-
- _dlg.setVisible(true);
-
-
- }
-
- private void onMouseClicked(MouseEvent e)
- {
- if(1 < e.getClickCount())
- {
- int selRow =_dlg.tblNamespaces.getSelectedRow();
-
- if(-1 == selRow)
- {
- return;
- }
-
- DefaultTableModel dtm =(DefaultTableModel) _dlg.tblNamespaces.getModel();
-
- Vector dataVector = dtm.getDataVector();
-
- Vector rowVector = (Vector) dataVector.get(selRow);
- String[] selNamespaceAndAlias = (String[]) rowVector.toArray(new String[rowVector.size()]);
-
- if(0 < selNamespaceAndAlias[1].length())
- {
- String msg =
- "The selected namespace already has one or more aliases.\n" +
- "Do you want to create another alias for the selected namespace?.";
-
- if(JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(_dlg, msg, "Duplicate alias", JOptionPane.YES_NO_CANCEL_OPTION))
- {
- return;
- }
- }
-
- String aliasNameTemplate = _dlg.txtAliasNameTemplate.getText();
-
- if(null == aliasNameTemplate || 0 == aliasNameTemplate.trim().length())
- {
- aliasNameTemplate = ALIAS_NAME_TEMPLATE_DEFAULT;
- }
-
- Preferences.userRoot().put(PREFS_KEY_ALIAS_NAME_TEMPLATE, aliasNameTemplate);
-
-
- String newAliasName = _namespaceCtrlListener.nameSpaceSelected(_session, selNamespaceAndAlias[0], aliasNameTemplate);
-
- if(0 == selNamespaceAndAlias[1].length())
- {
- selNamespaceAndAlias[1] = newAliasName;
- }
- else
- {
- selNamespaceAndAlias[1] += ";" + newAliasName;
- }
-
- rowVector.remove(1);
- rowVector.add(selNamespaceAndAlias[1]);
-
- Vector colsVector = new Vector(Arrays.asList(_cols));
- dtm.setDataVector(dataVector, colsVector);
-
-
- _dlg.tblNamespaces.getSelectionModel().setSelectionInterval(selRow, selRow);
- }
- }
-
-}
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrlListener.java
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrlListener.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceCtrlListener.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,9 +0,0 @@
-package de.ixdb.squirrel_sql.plugins.cache;
-
-import net.sourceforge.squirrel_sql.client.session.ISession;
-
-
-public interface NamespaceCtrlListener
-{
- String nameSpaceSelected(ISession session, String nameSpace, String aliasNameTemplate);
-}
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceDlg.java
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceDlg.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/NamespaceDlg.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,43 +0,0 @@
-package de.ixdb.squirrel_sql.plugins.cache;
-
-import javax.swing.*;
-import java.awt.*;
-
-
-public class NamespaceDlg extends JDialog
-{
- JTextField txtAliasNameTemplate;
- JTable tblNamespaces;
-
- public NamespaceDlg(JFrame mainFrame)
- {
- super(mainFrame, "Create alias for namespace");
-
- getContentPane().setLayout(new BorderLayout(0,3));
-
- JPanel pnlContent = new JPanel(new BorderLayout(0,5));
-
-
-
- pnlContent.add(new JLabel("Double click namespace to create alias"), BorderLayout.NORTH);
-
- tblNamespaces = new JTable();
- tblNamespaces.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
- pnlContent.add(new JScrollPane(tblNamespaces), BorderLayout.CENTER);
-
- JPanel pnlBottom = new JPanel(new GridLayout(4,1));
- pnlBottom.add(new JLabel("Edit alias name template:"));
- pnlBottom.add(new JLabel("%server will be replaced by server name"));
- pnlBottom.add(new JLabel("%namespace will be replaced by namespace name"));
-
- txtAliasNameTemplate = new JTextField();
- pnlBottom.add(txtAliasNameTemplate);
- pnlContent.add(pnlBottom, BorderLayout.SOUTH);
-
-
- getContentPane().add(new JPanel(), BorderLayout.NORTH);
- getContentPane().add(pnlContent, BorderLayout.CENTER);
-
- }
-}
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessData.java
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessData.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessData.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,257 +0,0 @@
-package de.ixdb.squirrel_sql.plugins.cache;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.ArrayList;
-
-
-public class ProcessData
-{
- public int pid;
- public Integer blockedByPid;
- public String deadLockChain;
- public int lockCount;
- public String locks;
- public String nspace;
- public String routine;
- public long lines;
- public long globals;
- public String state;
- public String userName;
- public String clientName;
- public String exeName;
- public String ipAdress;
- public String device;
- public int job;
-
-
- public static String[] getColumns()
- {
- return new String[]
- {
- "Pid",
- "Blocked by Pid",
- "Deadlock chain (Pids)",
- "Lock count",
- "Locks",
- "Nspace",
- "Routine",
- "Lines",
- "Globals",
- "State",
- "Username",
- "Client Name",
- "EXE Name",
- "IP Address",
- "Device",
- "Job#"
- };
- }
-
-
-
- private ProcessData blockedBy;
-
- public ProcessData(ResultSet procList)
- {
- try
- {
- job = procList.getInt("Job#");
- pid = procList.getInt("Pid");
- device = procList.getString("Device");
- nspace = procList.getString("Nspace");
- routine = procList.getString("Routine");
- lines = procList.getLong("Lines");
- globals =procList.getLong("Globals");
- state = procList.getString("State");
- userName = procList.getString("Username");
- clientName = procList.getString("Client Name");
- exeName = procList.getString("EXE Name");
- ipAdress = procList.getString("IP Address");
- }
- catch (SQLException e)
- {
- throw new RuntimeException(e);
- }
-
-
- }
-
-
- public void fillBlocks(ProcessData[] allProcData)
- {
- int[] blockedPids = parseBlockedPidsFromLocks();
-
- for (int i = 0; i < allProcData.length; i++)
- {
- for (int j = 0; j < blockedPids.length; j++)
- {
- if(blockedPids[j] == allProcData[i].pid)
- {
- allProcData[i].blockedBy = this;
- allProcData[i].blockedByPid = new Integer(this.pid);
- }
- }
- }
- }
-
- private int[] parseBlockedPidsFromLocks()
- {
- // pid 25493, lock examples:
- // 5 [" /db1/shd_data_4_3/"]User.ygwaBvbPosKorrD(1) 25493 1D, 25499 X E
- // 5 [" /db1/shd_data_4_3/"]User.ygwaBvbPosKorrD(1) 25493 1D, 25499,25506 X,X E,E
- // 5 [" /db1/shd_data_4_3/"]User.ygwaBvbPosKorrD(1) 25493 1D, 25499,25506,25508 X,X,X E,E,E
- //
- // oder
- //
- //6 [" d:\db\shd_data_lov\"]User.WLagerartikelD(76) 5544 1D,
- //7 [" d:\db\shd_data_lov\"]User.WLagerartikelD(77) 5544 1D, 3804 S E
- //8 [" d:\db\shd_data_lov\"]User.WVorgangD(24) 5544 1D,
- //
- // oder fuer kein Lock:
- //
- //3 [" f:\db\shd_data\"]User.ygwaTestD(989) 3792 1D,
- //4 [" f:\db\shd_data\"]User.ygwaTestD(990) 3792 1D,
- //5 [" f:\db\shd_data\"]User.ygwaTestD(991) 3792 1D,
- //6 [" f:\db\shd_data\"]User.ygwaTestD(992) 3792 1D,
- //7 [" f:\db\shd_data\"]User.ygwaTestD(993) 3792 1D,
- //8 [" f:\db\shd_data\"]User.ygwaTestD(994) 3792 1D,
- //9 [" f:\db\shd_data\"]User.ygwaTestD(995) 3792 1D,
- //
- //
-
-
- if(null == locks)
- {
- return new int[0];
- }
-
- HashMap blockedPids = new HashMap();
- String[] splits = locks.split("\n");
-
-
-
-
- for (int i = 0; i < splits.length; i++)
- {
- String[] splits2 = splits[i].split(",");
-
- if(2 > splits2.length)
- {
- continue;
- }
-
- for (int j = 1; j < splits2.length; j++)
- {
- String[] splits3 = splits2[j].replaceAll("\t", " ").split(" ");
-
- for (int k = 0; k < splits3.length; k++)
- {
- String[] splits4 = splits3[k].split(",");
-
- for (int l = 0; l < splits4.length; l++)
- {
- try
- {
- Integer pidBuf = new Integer(splits4[l].trim());
-
- // Es mach nichts, wenn es die PID nicht g�be.
- // Sie wird dann einfach oben nicht zugeordnet.
- if(pidBuf.intValue() != pid)
- {
- blockedPids.put(pidBuf, pidBuf);
- }
- }
- catch (NumberFormatException e)
- {
- }
- }
-
- }
- }
-
-
- }
-
- Integer[] blockedPidsBuf = (Integer[]) blockedPids.keySet().toArray(new Integer[0]);
-
- int[] ret = new int[blockedPidsBuf.length];
-
- for (int i = 0; i < ret.length; i++)
- {
- ret[i] = blockedPidsBuf[i].intValue();
- }
-
- return ret;
- }
-
- public void fillDeadLockChain()
- {
-
- ProcessData blocker = blockedBy;
-
-
- ArrayList chain = new ArrayList();
-
- HashMap blockers = new HashMap();
-
- while(null != blocker)
- {
- chain.add(new Integer(blocker.pid));
-
- if(blocker.pid == pid)
- {
- deadLockChain = getChainAsSting(chain);
- break;
- }
-
- if(null != blockers.get(blocker))
- {
- // If we are blocked by a member of a deadlock chain
- // but do not belong to the deadlock chain ourselves
- // this prevents a forever loop.
- break;
- }
-
- blockers.put(blocker, blocker);
- blocker = blocker.blockedBy;
- }
- }
-
- private String getChainAsSting(ArrayList chain)
- {
- ///////////////////////////////////////////////////////////////////////////////
- // A deadlock chain is circular and does not have a defined beginning Pid.
- // In order to make the string representation of a deadlock chain unique
- // we put the smallest Pid at the beginning of the chain.
- Integer minPid = (Integer)chain.get(0);
- int ixOfMinPid = 0;
-
- for (int i = 0; i < chain.size(); i++)
- {
- Integer buf = ((Integer) chain.get(i));
- if(minPid.intValue() > buf.intValue())
- {
- minPid = buf;
- ixOfMinPid = i;
- }
- }
-
- for(int i =0; i < ixOfMinPid; ++i)
- {
- chain.add(chain.remove(0));
- }
- //
- /////////////////////////////////////////////////////////////////////////////
-
- String ret = "" + chain.get(0);
- for (int i = 1; i < chain.size(); i++)
- {
- ret += "-->" + chain.get(i);
- }
- ret += "-->" + chain.get(0);
-
- return ret;
- }
-}
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessListPanel.java
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessListPanel.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessListPanel.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,53 +0,0 @@
-package de.ixdb.squirrel_sql.plugins.cache;
-
-import net.sourceforge.squirrel_sql.fw.gui.SortableTable;
-import net.sourceforge.squirrel_sql.fw.gui.SortableTableModel;
-
-import javax.swing.*;
-import javax.swing.table.DefaultTableModel;
-import java.awt.*;
-
-public class ProcessListPanel extends JPanel
-{
- SortableTable tblProcessList;
- JButton btnRefresh;
- JButton btnTerminate;
- JButton btnClose;
-
- public ProcessListPanel()
- {
- setLayout(new BorderLayout());
-
-
- tblProcessList = new SortableTable(new SortableTableModel(null));
- tblProcessList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
- tblProcessList.getTableHeader().setResizingAllowed(true);
- tblProcessList.getTableHeader().setReorderingAllowed(true);
- tblProcessList.setAutoCreateColumnsFromModel(false);
- tblProcessList.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
-
- add(new JScrollPane(tblProcessList), BorderLayout.CENTER);
-
-
-
- JPanel pnlSouth = new JPanel();
- pnlSouth.setLayout(new GridBagLayout());
- GridBagConstraints gbc;
-
- btnRefresh = new JButton("Refresh list");
- btnTerminate = new JButton("Terminate selected Process");
- btnClose = new JButton("Close processes tab");
-
- gbc = new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5,5,0,5), 0,0);
- pnlSouth.add(btnRefresh, gbc);
-
- gbc = new GridBagConstraints(1,0,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0,0);
- pnlSouth.add(btnTerminate, gbc);
-
- gbc = new GridBagConstraints(2,0,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5,0,0,5), 0,0);
- pnlSouth.add(btnClose,gbc);
-
- add(pnlSouth, BorderLayout.SOUTH);
- }
-
-}
Deleted: trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessListTab.java
===================================================================
--- trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessListTab.java 2010-08-21 17:35:27 UTC (rev 5807)
+++ trunk/sql12/plugins/cache/src/de/ixdb/squirrel_sql/plugins/cache/ProcessListTab.java 2010-08-21 17:36:13 UTC (rev 5808)
@@ -1,277 +0,0 @@
-package de.ixdb.squirrel_sql.plugins.cache;
-
-import net.sourceforge.squirrel_sql.client.session.ISession;
-import net.sourceforge.squirrel_sql.client.session.mainpanel.IMainPanelTab;
-import net.sourceforge.squirrel_sql.fw.gui.ButtonTableHeader;
-import net.sourceforge.squirrel_sql.fw.gui.SortableTableModel;
-import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetViewerTablePanel;
-import net.sourceforge.squirrel_sql.fw.datasetviewer.ColumnDisplayDefinition;
-import net.sourceforge.squirrel_sql.fw.datasetviewer.CellDataPopup;
-
-import javax.swing.*;
-import javax.swing.table.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-
-
-public class ProcessListTab implements IMainPanelTab
-{
- ProcessListPanel _pnlProcessList;
- private ISession _session;
- private ProcessData[] _procData;
- private ProcessListTabListener _processListTabListener;
-
- public ProcessListTab(ProcessData[] procData, ProcessListTabListener processListTabListener)
- {
- _procData = procData;
-
-
- _processListTabListener = processListTabListener;
- _pnlProcessList = new ProcessListPanel();
-
- DefaultTableModel dtm =
- new DefaultTableModel()
- {
- public boolean isCellEditable(int row, int column)
- {
- return false;
- }
-
- public Object getValueAt(int row, int column)
- {
- return onGetValueAt(row, column);
- }
-
- public String getColumnName(int column)
- {
- return ProcessData.getColumns()[column];
- }
-
- public int getRowCount()
- {
- if(null == ProcessListTab.this)
- {
- // I have seen the reference to the outer class being null
- // when this method is called.
- // I have seen it only with the runtime jars
- // and on Linux.
- // I could not reproduce in my IDE.
- return 0;
- }
- else
- {
- return ProcessListTab.this._procData.length;
- }
- }
-
- public int getColumnCount()
- {
- return ProcessData.getColumns().length;
- }
-
- };
-
- SortableTableModel stm = (SortableTableModel) _pnlProcessList.tblProcessList.getModel();
- stm.setActualModel(dtm);
-
- DefaultTableCellRenderer dtcr =
- new DefaultTableCellRenderer()
- {
- public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
- {
- Component rend = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
- if(null != value && 0 < value.toString().indexOf('\n'))
- {
- rend.setBackground(Color.cyan);
- }
- else
- {
- if (isSelected)
- {
- setBackground(table.getSelectionBackground());
- }
- else
- {
- setBackground(table.getBackground());
- }
- }
- return rend;
- }
- };
-
-
- final TableColumnModel tcm = new DefaultTableColumnModel();
- for (int i = 0; i < ProcessData.getColumns().length; ++i)
- {
- final TableColumn col = new TableColumn(i);
- col.setHeaderValue(ProcessData.getColumns()[i]);
- col.setCellRenderer(dtcr);
- tcm.addColumn(col);
- }
-
-
- _pnlProcessList.tblProcessList.setColumnModel(tcm);
-
-
- _pnlProcessList.btnRefresh.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- onRefresh();
- }
- });
-
- _pnlProcessList.btnTerminate.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- onTerminate();
- }
- });
-
- _pnlProcessList.btnClose.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- onClose();
- }
- });
-
-
- _pnlProcessList.tblProcessList.addMouseListener(new MouseAdapter()
- {
- public void mousePressed(MouseEvent evt)
- {
- if (evt.getClickCount() == 2)
- {
- // figure out which column the user clicked on
- // so we can pass in the right column description
-
- Point pt = evt.getPoint();
- int col = _pnlProcessList.tblProcessList.columnAtPoint(pt);
- ColumnDisplayDefinition dumDef = new ColumnDisplayDefinition(50, "Detail");
- CellDataPopup.showDialog(_pnlProcessList.tblProcessList, dumDef, evt,false);
- }
- }
- });
- }
-
-
- private void onClose()
- {
- _processListTabListener.closeRequested(_session);
- }
-
- private void onTerminate()
- {
- int selectedRow = _pnlProcessList.tblProcessList.getSelectedRow();
- selectedRow = _pnlProcessList.tblProcessList.getSortableTableModel().transfromToModelRow(selectedRow);
-
- String msg;
- if(-1 == selectedRow)
- {
- msg = "No process selected.\nPlease select the Process you wish to terminate.";
- JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg);
- return;
- }
-
- msg = "Do you really wish to terminate the selected process?";
- if(JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(_session.getApplication().getMainFrame(), msg, "Terminate process", JOptionPane.YES_NO_CANCEL_OPTION))
- {
- return;
- }
-
- int termRet = _processListTabListener.terminateRequested(_session, _procData[selectedRow]);
-
- if(1 != termRet)
- {
- msg = "Terminate should return 1 but returned " + termRet + ".\nMaybe terminate didn't succeed.";
- JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg);
- return;
- }
- }
-
- private void onRefresh()
- {
- int selectedRow = _pnlProcessList.tblProcessList.getSelectedRow();
-
- ProcessData old = null;
- if(-1 != selectedRow)
- {
- old = _procData[selectedRow];
- }
-
- _procData = _processListTabListener.refreshRequested(_session);
-
- SortableTableModel stm = (SortableTableModel) _pnlProcessList.tblProcessList.getModel();
- ((DefaultTableModel)stm.getActualModel()).fireTableDataChanged();
- stm.fireTableDataChanged();
-
- ButtonTableHeader bth = (ButtonTableHeader) _pnlProcessList.tblProcessList.getTableHeader();
-
- if(-1 != bth.getCurrentlySortedColumnIdx())
- {
- stm.sortByColumn(bth.getCurrentlySortedColumnIdx(), bth.isAscending());
- }
-
-
- _pnlProcessList.tblProcessList.repaint();
-
- if(null != old)
- {
- for (int i = 0; i < _procData.length; i++)...
[truncated message content] |