Author: ruschein Date: 2011-08-16 08:41:07 -0700 (Tue, 16 Aug 2011) New Revision: 26566
Added: core3/api/trunk/di-util-api/ core3/api/trunk/di-util-api/src/main/java/org/cytoscape/di/ core3/api/trunk/di-util-api/src/main/java/org/cytoscape/di/util/ core3/api/trunk/di-util-api/src/main/java/org/cytoscape/di/util/DIUtil.java Removed: core3/api/trunk/di-util-api/src/main/java/org/cytoscape/work/ core3/api/trunk/work-spring-api/ Modified: core3/api/trunk/di-util-api/pom.xml core3/api/trunk/pom.xml Log: Fixed some performance problems and replaced work-spring-api with di-util-api. Modified: core3/api/trunk/di-util-api/pom.xml =================================================================== --- core3/api/trunk/work-spring-api/pom.xml 2011-08-15 14:49:25 UTC (rev 26553) +++ core3/api/trunk/di-util-api/pom.xml 2011-08-16 15:41:07 UTC (rev 26566) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <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"> - <parent> <artifactId>api-parent</artifactId> <groupId>org.cytoscape</groupId> @@ -8,13 +7,13 @@ </parent> <properties> - <bundle.symbolicName>org.cytoscape.work-spring-api</bundle.symbolicName> - <bundle.namespace>org.cytoscape.work.spring</bundle.namespace> + <bundle.symbolicName>org.cytoscape.di-util-api</bundle.symbolicName> + <bundle.namespace>org.cytoscape.di.util</bundle.namespace> </properties> <modelVersion>4.0.0</modelVersion> <groupId>org.cytoscape</groupId> - <artifactId>work-spring-api</artifactId> + <artifactId>di-util-api</artifactId> <name>${bundle.symbolicName}</name> @@ -58,8 +57,7 @@ <instructions> <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName> <Bundle-Version>${project.version}</Bundle-Version> - <Export-Package>!${bundle.namespace}.internal.*,${bundle.namespace}.*;version="${project.version}"</Export-Package> - <Private-Package>${bundle.namespace}.internal.*</Private-Package> + <Export-Package>${bundle.namespace}.*;version="${project.version}"</Export-Package> </instructions> </configuration> </plugin> @@ -68,17 +66,10 @@ <dependencies> <dependency> - <groupId>org.cytoscape</groupId> - <artifactId>work-api</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> <scope>provided</scope> </dependency> </dependencies> - </project> Copied: core3/api/trunk/di-util-api/src/main/java/org/cytoscape/di/util/DIUtil.java (from rev 26553, core3/api/trunk/work-spring-api/src/main/java/org/cytoscape/work/spring/SpringTunableInterceptor.java) =================================================================== --- core3/api/trunk/di-util-api/src/main/java/org/cytoscape/di/util/DIUtil.java (rev 0) +++ core3/api/trunk/di-util-api/src/main/java/org/cytoscape/di/util/DIUtil.java 2011-08-16 15:41:07 UTC (rev 26566) @@ -0,0 +1,37 @@ +package org.cytoscape.di.util; + + +import org.springframework.core.InfrastructureProxy; + + +public final class DIUtil { + private DIUtil() { } + + /** This method is typically used for performance optimisations to remove the overhead of indirect + * method calls via infrastructure proxies. + * + * @param possibleProxy an object reference that may or may not be a proxied object + * @return If "possibleProxy" was a proxy, the underlying wrapped object otherwise "possibleProxy" itself. + */ + public static <T> T stripProxy(final T possibleProxy) { + if (possibleProxy instanceof InfrastructureProxy) + return (T)((InfrastructureProxy)possibleProxy).getWrappedObject(); + else + return possibleProxy; + } + + /** This method is typically used for performance optimisations to remove the overhead of indirect + * method calls via infrastructure proxies. + * + * @param possibleProxies one or more object references that may or may not be a proxied objects + * @return the unwrapped proxy objects if they were proxies otherwise the original objects + */ + public static <T> T[] stripProxies(final T... possibleProxies) { + final Object[] unwrappedObjs = new Object[possibleProxies.length]; + int i = 0; + for (final T possibleProxy : possibleProxies) + unwrappedObjs[i++] = stripProxy(possibleProxy); + + return (T[])unwrappedObjs; + } +} Modified: core3/api/trunk/pom.xml =================================================================== --- core3/api/trunk/pom.xml 2011-08-16 15:40:49 UTC (rev 26565) +++ core3/api/trunk/pom.xml 2011-08-16 15:41:07 UTC (rev 26566) @@ -38,6 +38,7 @@ <module>swing-util-api</module> <module>work-spring-api</module> <module>application-api</module> + <module>di-util-api</module> </modules> <dependencyManagement> @@ -71,4 +72,4 @@ <url>${scm.url.root}/api/trunk</url> </scm> -</project> \ No newline at end of file +</project> -- 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.
