Author: ruschein
Date: 2011-08-16 08:40:49 -0700 (Tue, 16 Aug 2011)
New Revision: 26565
Modified:
core3/impl/trunk/command-executor-impl/pom.xml
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/tunables/CommandTunableInterceptorImpl.java
core3/impl/trunk/io-impl/pom.xml
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArraySubGraph.java
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
core3/impl/trunk/model-impl/pom.xml
core3/impl/trunk/plugin-impl/pom.xml
core3/impl/trunk/plugin-impl/src/main/java/org/cytoscape/plugin/internal/CyPluginAdapterImpl.java
core3/impl/trunk/pom.xml
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/GUITunableInterceptorImpl.java
core3/impl/trunk/work-swing-impl/pom.xml
Log:
Fixed some performance problems and replaced work-spring-api with di-util-api.
Modified: core3/impl/trunk/command-executor-impl/pom.xml
===================================================================
--- core3/impl/trunk/command-executor-impl/pom.xml 2011-08-16 15:34:52 UTC
(rev 26564)
+++ core3/impl/trunk/command-executor-impl/pom.xml 2011-08-16 15:40:49 UTC
(rev 26565)
@@ -19,32 +19,32 @@
<packaging>bundle</packaging>
- <repositories>
- <!-- bootstrap for cytoscape dependencies, namely the parent POM
snapshots -->
- <repository>
- <id>cytoscape_snapshots</id>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- <name>Cytoscape Snapshots</name>
-
<url>http://cytoscape.wodaklab.org/nexus/content/repositories/snapshots/</url>
- </repository>
- <!-- bootstrap for cytoscape dependencies, namely the parent POM
releases -->
- <repository>
- <id>cytoscape_releases</id>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- <name>Cytoscape Releases</name>
-
<url>http://cytoscape.wodaklab.org/nexus/content/repositories/releases/</url>
- </repository>
- </repositories>
+ <repositories>
+ <!-- bootstrap for cytoscape dependencies, namely the parent
POM snapshots -->
+ <repository>
+ <id>cytoscape_snapshots</id>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <name>Cytoscape Snapshots</name>
+
<url>http://cytoscape.wodaklab.org/nexus/content/repositories/snapshots/</url>
+ </repository>
+ <!-- bootstrap for cytoscape dependencies, namely the parent
POM releases -->
+ <repository>
+ <id>cytoscape_releases</id>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <name>Cytoscape Releases</name>
+
<url>http://cytoscape.wodaklab.org/nexus/content/repositories/releases/</url>
+ </repository>
+ </repositories>
<build>
<plugins>
@@ -66,7 +66,18 @@
</build>
<dependencies>
+ <dependency>
+ <groupId>org.cytoscape</groupId>
+ <artifactId>di-util-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.cytoscape</groupId>
<artifactId>core-task-api</artifactId>
</dependency>
@@ -74,10 +85,5 @@
<groupId>org.cytoscape</groupId>
<artifactId>work-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.cytoscape</groupId>
- <artifactId>work-spring-api</artifactId>
- </dependency>
</dependencies>
-
</project>
Modified:
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/tunables/CommandTunableInterceptorImpl.java
===================================================================
---
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/tunables/CommandTunableInterceptorImpl.java
2011-08-16 15:34:52 UTC (rev 26564)
+++
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/tunables/CommandTunableInterceptorImpl.java
2011-08-16 15:40:49 UTC (rev 26565)
@@ -3,35 +3,47 @@
import java.util.Map;
-import org.cytoscape.work.spring.SpringTunableInterceptor;
+import org.cytoscape.di.util.DIUtil;
+import org.cytoscape.work.AbstractTunableInterceptor;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class CommandTunableInterceptorImpl extends
SpringTunableInterceptor<StringTunableHandler> {
+
+public class CommandTunableInterceptorImpl extends
AbstractTunableInterceptor<StringTunableHandler> {
private static final Logger logger =
LoggerFactory.getLogger(CommandTunableInterceptorImpl.class);
private String args;
- public boolean execUI(Object... objs) {
+ public boolean execUI(Object... objs) {
return validateAndWriteBackTunables(objs);
}
public void setArgString(String args) {
this.args = args;
}
-
- public boolean validateAndWriteBackTunables(Object... objs) {
+
+ /**
+ * This method calls {@link AbstractTunableInterceptor.loadTunables}
with the
+ * unwrapped object instead of the Spring proxy object, which is
provided as
+ * an argument.
+ * @param obj The Spring proxy object from which we'd like the raw
object.
+ */
+ public void loadTunables(final Object obj) {
+ super.loadTunables(DIUtil.stripProxy(obj));
+ }
+
+ public boolean validateAndWriteBackTunables(Object... objs) {
try {
+ // The objects here are task objects. Generally there
is only one.
+ for ( Object o : objs ) {
- // The objects here are task objects. Generally there
is only one.
- for ( Object o : objs ) {
-
// Get the handlers for the tunables in the
Task. The
// key is the name of the tunable and the value
is the handler
// for that tunable.
Map<String,StringTunableHandler> handlers =
getHandlers(o);
for ( StringTunableHandler h :
handlers.values() ) {
-
- // Give the handler the arg string and
let it do its thing,
+
+ // Give the handler the arg string and
let it do its thing,
// which will hopefully be: set the
tunable value based on
// information parsed from the arg
string.
h.processArgString(args);
Modified: core3/impl/trunk/io-impl/pom.xml
===================================================================
--- core3/impl/trunk/io-impl/pom.xml 2011-08-16 15:34:52 UTC (rev 26564)
+++ core3/impl/trunk/io-impl/pom.xml 2011-08-16 15:40:49 UTC (rev 26565)
@@ -105,6 +105,16 @@
<dependencies>
<dependency>
<groupId>org.cytoscape</groupId>
+ <artifactId>di-util-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.cytoscape</groupId>
<artifactId>equations-api</artifactId>
</dependency>
<dependency>
Modified:
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArraySubGraph.java
===================================================================
---
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArraySubGraph.java
2011-08-16 15:34:52 UTC (rev 26564)
+++
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/ArraySubGraph.java
2011-08-16 15:40:49 UTC (rev 26565)
@@ -1,14 +1,6 @@
-
/*
- Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2008, 2011, The Cytoscape Consortium (www.cytoscape.org)
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
@@ -38,6 +30,7 @@
import org.cytoscape.event.CyEventHelper;
+import org.cytoscape.di.util.DIUtil;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyTable;
import org.cytoscape.model.CyEdge;
@@ -59,6 +52,7 @@
import java.util.Map;
import java.util.Set;
+
/**
* An implementation of CySubNetwork that is largely a passthrough to
* {@link ArrayGraph}.
@@ -74,11 +68,11 @@
private Set<CyNode> nodeSet;
private Set<CyEdge> edgeSet;
- ArraySubGraph(final ArrayGraph par, final int inId, final CyEventHelper
eh) {
- assert(par!=null);
+ ArraySubGraph(final ArrayGraph par, final int inId, final CyEventHelper
eventHelper) {
+ assert(par != null);
parent = par;
internalId = inId;
- eventHelper = eh;
+ this.eventHelper = DIUtil.stripProxy(eventHelper);
internalSUID = SUIDFactory.getNextSUID();
Modified:
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
===================================================================
---
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
2011-08-16 15:34:52 UTC (rev 26564)
+++
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableImpl.java
2011-08-16 15:40:49 UTC (rev 26565)
@@ -36,6 +36,7 @@
import java.util.Map;
import java.util.Set;
+import org.cytoscape.di.util.DIUtil;
import org.cytoscape.equations.Equation;
import org.cytoscape.equations.Interpreter;
import org.cytoscape.event.CyEventHelper;
@@ -100,7 +101,7 @@
this.pub = pub;
this.isImmutable = !isMutable;
this.suid = SUIDFactory.getNextSUID();
- this.eventHelper = eventHelper;
+ this.eventHelper = DIUtil.stripProxy(eventHelper);
this.interpreter = interpreter;
this.savePolicy = savePolicy;
Modified: core3/impl/trunk/model-impl/pom.xml
===================================================================
--- core3/impl/trunk/model-impl/pom.xml 2011-08-16 15:34:52 UTC (rev 26564)
+++ core3/impl/trunk/model-impl/pom.xml 2011-08-16 15:40:49 UTC (rev 26565)
@@ -67,7 +67,18 @@
should be kept in the it/pom.xml
-->
<dependencies>
+ <dependency>
+ <groupId>org.cytoscape</groupId>
+ <artifactId>di-util-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.cytoscape</groupId>
<artifactId>model-api</artifactId>
<scope>provided</scope>
Modified: core3/impl/trunk/plugin-impl/pom.xml
===================================================================
--- core3/impl/trunk/plugin-impl/pom.xml 2011-08-16 15:34:52 UTC (rev
26564)
+++ core3/impl/trunk/plugin-impl/pom.xml 2011-08-16 15:40:49 UTC (rev
26565)
@@ -101,7 +101,6 @@
</repositories>
<dependencies>
-
<!-- dependencies needed to implement this code -->
<dependency>
<groupId>org.cytoscape</groupId>
@@ -148,11 +147,6 @@
<dependency>
<groupId>org.cytoscape</groupId>
- <artifactId>work-spring-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.cytoscape</groupId>
<artifactId>equations-api</artifactId>
</dependency>
Modified:
core3/impl/trunk/plugin-impl/src/main/java/org/cytoscape/plugin/internal/CyPluginAdapterImpl.java
===================================================================
---
core3/impl/trunk/plugin-impl/src/main/java/org/cytoscape/plugin/internal/CyPluginAdapterImpl.java
2011-08-16 15:34:52 UTC (rev 26564)
+++
core3/impl/trunk/plugin-impl/src/main/java/org/cytoscape/plugin/internal/CyPluginAdapterImpl.java
2011-08-16 15:40:49 UTC (rev 26565)
@@ -1,6 +1,6 @@
-
package org.cytoscape.plugin.internal;
+
import java.util.Properties;
import org.cytoscape.application.CyApplicationManager;
@@ -60,7 +60,6 @@
import org.cytoscape.view.vizmap.gui.util.ContinuousMappingGenerator;
import org.cytoscape.work.Task;
import org.cytoscape.work.TaskManager;
-import org.cytoscape.work.spring.SpringTunableInterceptor;
import org.cytoscape.work.swing.AbstractGUITunableHandler;
import org.cytoscape.work.swing.GUITaskManager;
import org.cytoscape.work.undo.UndoSupport;
@@ -138,7 +137,6 @@
private StreamUtil streamUtil;
private CyNetworkViewWriterFactory cyNetworkViewWriterFactory;
private AbstractGUITunableHandler abstractGUITunableHandler;
- private SpringTunableInterceptor springTunableInterceptor;
private AbstractLayoutAlgorithm abstractLayout;
private AbstractFunction abstractFunction;
private AbstractVisualPropertyDependency
abstractVisualPropertyDependency;
Modified: core3/impl/trunk/pom.xml
===================================================================
--- core3/impl/trunk/pom.xml 2011-08-16 15:34:52 UTC (rev 26564)
+++ core3/impl/trunk/pom.xml 2011-08-16 15:40:49 UTC (rev 26565)
@@ -187,6 +187,11 @@
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
+ <artifactId>di-util-api</artifactId>
+ <version>${cytoscape.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.cytoscape</groupId>
<artifactId>core-task-api</artifactId>
<version>${cytoscape.api.version}</version>
<type>test-jar</type>
@@ -290,4 +295,4 @@
</pluginManagement>
</build>
-</project>
\ No newline at end of file
+</project>
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
===================================================================
---
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
2011-08-16 15:34:52 UTC (rev 26564)
+++
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
2011-08-16 15:40:49 UTC (rev 26565)
@@ -165,7 +165,7 @@
}
// create the task thread
- final Runnable tasks = new TaskThread(first, taskMonitor,
taskIterator);
+ final Runnable tasks = new TaskThread(first, taskMonitor,
taskIterator, factory);
// submit the task thread for execution
final Future<?> executorFuture =
taskExecutorService.submit(tasks);
@@ -190,18 +190,20 @@
}
private class TaskThread implements Runnable {
-
private final SwingTaskMonitor taskMonitor;
private final TaskIterator taskIterator;
private final Task first;
+ private final TaskFactory factory;
- TaskThread(final Task first, final SwingTaskMonitor tm, final
TaskIterator ti) {
+ TaskThread(final Task first, final SwingTaskMonitor tm, final
TaskIterator ti, final TaskFactory factory) {
this.first = first;
this.taskMonitor = tm;
this.taskIterator = ti;
+ this.factory = factory;
}
public void run() {
+ final long startTime = System.currentTimeMillis();
try {
// actually run the first task
// don't dispaly the tunables here - they were
handled above.
@@ -227,12 +229,17 @@
} catch (Exception exception) {
logger.warn("Caught exception executing task.
", exception);
taskMonitor.showException(exception);
+ } finally {
+ final long endTime = System.currentTimeMillis();
+System.err.println("+++ Factory " + factory + ": " + (endTime-startTime) +
"ms");
}
// clean up the task monitor
if (taskMonitor.isOpened() &&
!taskMonitor.isShowingException())
taskMonitor.close();
+final long endTime2 = System.currentTimeMillis();
+System.err.println("+++ Factory " + factory + ": " + (endTime2-startTime) +
"ms (2)");
}
}
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/GUITunableInterceptorImpl.java
===================================================================
---
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/GUITunableInterceptorImpl.java
2011-08-16 15:34:52 UTC (rev 26564)
+++
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/GUITunableInterceptorImpl.java
2011-08-16 15:40:49 UTC (rev 26565)
@@ -16,12 +16,13 @@
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
+import org.cytoscape.di.util.DIUtil;
+import org.cytoscape.work.AbstractTunableInterceptor;
import org.cytoscape.work.TaskFactory;
import org.cytoscape.work.TunableValidator;
import org.cytoscape.work.TunableValidator.ValidationState;
import org.cytoscape.work.internal.tunables.utils.CollapsablePanel;
import org.cytoscape.work.internal.tunables.utils.XorPanel;
-import org.cytoscape.work.spring.SpringTunableInterceptor;
import org.cytoscape.work.swing.GUITunableHandler;
import org.cytoscape.work.swing.GUITunableInterceptor;
import org.cytoscape.work.swing.TunableDialog;
@@ -50,9 +51,7 @@
*
* @author pasteur
*/
-public class GUITunableInterceptorImpl extends
SpringTunableInterceptor<GUITunableHandler> implements
GUITunableInterceptor<GUITunableHandler> {
-
-
+public class GUITunableInterceptorImpl extends
AbstractTunableInterceptor<GUITunableHandler> implements
GUITunableInterceptor<GUITunableHandler> {
private Map<List<GUITunableHandler>, JPanel> panelMap;
private boolean newValuesSet;
@@ -93,7 +92,7 @@
/** {@inheritDoc} */
final public JPanel getUI(final Object... proxyObjs) {
- this.objectsWithTunables = convertSpringProxyObjs(proxyObjs);
+ this.objectsWithTunables = DIUtil.stripProxies(proxyObjs);
handlers = new ArrayList<GUITunableHandler>();
return constructUI();
}
@@ -118,16 +117,25 @@
/** {@inheritDoc} */
final public boolean hasTunables(final Object o) {
- return super.hasTunables(convertSpringProxyObj(o));
+ return super.hasTunables(DIUtil.stripProxy(o));
}
+ /**
+ * This method calls {@link AbstractTunableInterceptor.loadTunables}
with the
+ * unwrapped object instead of the Spring proxy object, which is
provided as
+ * an argument.
+ * @param obj The Spring proxy object from which we'd like the raw
object.
+ */
+ final public void loadTunables(final Object obj) {
+ super.loadTunables(DIUtil.stripProxy(obj));
+ }
+
/** This implements the final action in execUI() and executes the UI.
* @param optionPanel the panel containing the various UI elements
corresponding to individual tunables
* @param proxyObjs represents the objects annotated with tunables
*/
private boolean displayGUI(final JPanel optionPanel, Object...
proxyObjs) {
-
tunnableDialog = new TunableDialog(parent);
tunnableDialog.setLocationRelativeTo(parent);
tunnableDialog.setTitle("Set Parameters");
@@ -429,7 +437,7 @@
* @return success or not of the <code>TunableValidator</code> validate
method
*/
final public boolean validateAndWriteBackTunables(Object... proxyObjs) {
- final Object objectsWithTunables[] =
convertSpringProxyObjs(proxyObjs);
+ final Object objectsWithTunables[] =
DIUtil.stripProxies(proxyObjs);
// Update handler list:
if (handlers == null)
Modified: core3/impl/trunk/work-swing-impl/pom.xml
===================================================================
--- core3/impl/trunk/work-swing-impl/pom.xml 2011-08-16 15:34:52 UTC (rev
26564)
+++ core3/impl/trunk/work-swing-impl/pom.xml 2011-08-16 15:40:49 UTC (rev
26565)
@@ -16,24 +16,23 @@
<module>it</module>
</modules>
+ <build>
+ <plugins>
+ <plugin>
+ <inherited>false</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+
<version>${maven-release-plugin.version}</version>
+ <configuration>
+
<autoVersionSubmodules>true</autoVersionSubmodules>
+ <goals>deploy</goals>
+ <!-- so that impl bundles with modules
will build correctly -->
+ <preparationGoals>clean
install</preparationGoals>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <build>
- <plugins>
- <plugin>
- <inherited>false</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>${maven-release-plugin.version}</version>
- <configuration>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- <goals>deploy</goals>
- <!-- so that impl bundles with modules will build
correctly -->
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<repositories>
<repository>
<id>cytoscape_snapshots</id>
@@ -59,14 +58,24 @@
</repository>
</repositories>
-
<!--
Dependencies included here should *ONLY* be for the impl bundle.
All additional dependencies necessary for the integration tests (it)
should be kept in the it/pom.xml
-->
<dependencies>
+ <dependency>
+ <groupId>org.cytoscape</groupId>
+ <artifactId>di-util-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.cytoscape</groupId>
<artifactId>swing-util-api</artifactId>
<scope>provided</scope>
@@ -83,11 +92,6 @@
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
- <artifactId>work-spring-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.cytoscape</groupId>
<artifactId>property-api</artifactId>
<scope>provided</scope>
</dependency>
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.