Browse files

Merge branch 'master' of github.com:SpringSource/spring-insight-plugins

  • Loading branch information...
2 parents b999129 + 07fac8c commit 18e57a0d54f6c455164d3879b29f0b4971fbfd8b @talya talya committed Dec 23, 2012
Showing with 1,803 additions and 122 deletions.
  1. +15 −0 collection-plugins/akka/README.textile
  2. +27 −0 collection-plugins/akka/build.xml
  3. +66 −0 collection-plugins/akka/pom.xml
  4. +71 −0 ...gins/akka/src/main/java/com/springsource/insight/plugin/akka/ActorRefOperationCollectionAspect.aj
  5. +42 −0 collection-plugins/akka/src/main/java/com/springsource/insight/plugin/akka/AkkaDefinitions.java
  6. +54 −0 ...-plugins/akka/src/main/java/com/springsource/insight/plugin/akka/AkkaPluginRuntimeDescriptor.java
  7. +49 −0 ...ins/akka/src/main/java/com/springsource/insight/plugin/akka/AkkaUntypedActorEndPointAnalyzer.java
  8. +77 −0 .../akka/src/main/java/com/springsource/insight/plugin/akka/UntypedActorOperationCollectionAspect.aj
  9. +58 −0 ...tion-plugins/akka/src/main/java/com/springsource/insight/plugin/akka/actorref/ActorRefHelper.java
  10. +25 −0 ...s/akka/src/main/java/com/springsource/insight/plugin/akka/actorref/ActorRefPropertyExtractor.java
  11. +37 −0 ...src/main/java/com/springsource/insight/plugin/akka/actorref/PromiseActorRefPropertyExtractor.java
  12. +44 −0 .../src/main/java/com/springsource/insight/plugin/akka/actorref/RouterActorRefPropertyExtractor.java
  13. +63 −0 ...ugins/akka/src/main/java/com/springsource/insight/plugin/akka/routing/AkkaRouterConfigHelper.java
  14. +36 −0 ...kka/src/main/java/com/springsource/insight/plugin/akka/routing/RoundRobinRouterDataExtractor.java
  15. +27 −0 ...ns/akka/src/main/java/com/springsource/insight/plugin/akka/routing/RouterConfigDataExtractor.java
  16. +29 −0 collection-plugins/akka/src/main/resources/META-INF/insight-plugin-akka.xml
  17. +14 −0 collection-plugins/akka/src/main/resources/com/springsource/insight/plugin/akka/akka.ftl
  18. +77 −0 ...t/java/com/springsource/insight/plugin/akka/AbstractAkkaOperationCollectionAspectTestSupport.java
  19. +67 −0 ...src/test/java/com/springsource/insight/plugin/akka/UntypedActorOperationCollectionAspectTest.java
  20. +53 −0 ...test/java/com/springsource/insight/plugin/akka/actorref/PromiseActorRefPropertyExtractorTest.java
  21. +59 −0 .../test/java/com/springsource/insight/plugin/akka/actorref/RouterActorRefPropertyExtractorTest.java
  22. +97 −0 ...s/akka/src/test/java/com/springsource/insight/plugin/akka/routing/AkkaRouterConfigHelperTest.java
  23. +44 −0 ...src/test/java/com/springsource/insight/plugin/akka/routing/RoundRobinRouterDataExtractorTest.java
  24. +1 −0 collection-plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/cql.ftl
  25. +1 −0 collection-plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/get.ftl
  26. +2 −4 collection-plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/remove.ftl
  27. +2 −5 collection-plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/system.ftl
  28. +1 −4 collection-plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/update.ftl
  29. +6 −1 ...rc/test/java/com/springsource/insight/plugin/cassandra/AbstractOperationCollectionAspectTest.java
  30. +5 −1 ...plugins/cassandra/src/test/java/com/springsource/insight/plugin/cassandra/CassandraUnitTests.java
  31. +6 −6 collection-plugins/cassandra/src/test/resources/cassandra.yaml
  32. +1 −0 ...eclipse-persistence/src/main/resources/com/springsource/insight/plugin/eclipse/persistence/db.ftl
  33. +1 −0 ...ipse-persistence/src/main/resources/com/springsource/insight/plugin/eclipse/persistence/query.ftl
  34. +1 −0 ...eclipse-persistence/src/main/resources/com/springsource/insight/plugin/eclipse/persistence/tx.ftl
  35. +6 −0 collection-plugins/ehcache/src/main/resources/com/springsource/insight/plugin/ehcache/ehcache.ftl
  36. +1 −0 collection-plugins/ejb3/src/main/resources/com/springsource/insight/plugin/ejb3/ejb3.ftl
  37. +1 −0 .../files-tracker/src/main/resources/com/springsource/insight/plugin/files/tracker/files-tracker.ftl
  38. +1 −0 ...fire-light/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_query_operation.ftl
  39. +1 −0 ...ire-light/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_remote_operation.ftl
  40. +22 −13 ...ns/gemfire/src/main/java/com/springsource/insight/plugin/gemfire/GemFireRegionCollectionAspect.aj
  41. +1 −0 ...ns/gemfire/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_query_operation.ftl
  42. +1 −1 ...s/gemfire/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_region_operation.ftl
  43. +1 −0 ...s/gemfire/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_remote_operation.ftl
  44. +7 −0 collection-plugins/grails/pom.xml
  45. +1 −0 ...ins/grails/src/main/resources/com/springsource/insight/plugin/grails/grails_controller_method.ftl
  46. +6 −0 collection-plugins/hadoop/src/main/resources/com/springsource/insight/plugin/hadoop/job.ftl
  47. +1 −0 collection-plugins/hadoop/src/main/resources/com/springsource/insight/plugin/hadoop/mapper.ftl
  48. +1 −0 collection-plugins/hadoop/src/main/resources/com/springsource/insight/plugin/hadoop/reducer.ftl
  49. +3 −6 ...tion-plugins/hibernate/src/main/resources/com/springsource/insight/plugin/hibernate/hibernate.ftl
  50. +6 −0 ...on-plugins/httpclient3/src/main/resources/com/springsource/insight/plugin/apache/http/hc3/hc3.ftl
  51. +6 −0 ...on-plugins/httpclient4/src/main/resources/com/springsource/insight/plugin/apache/http/hc4/hc4.ftl
  52. +1 −0 collection-plugins/jax-rs/src/main/resources/com/springsource/insight/plugin/jaxrs/jax-rs.ftl
  53. +1 −1 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/get.ftl
  54. +1 −1 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/item.ftl
  55. +1 −1 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/login.ftl
  56. +2 −1 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/query.ftl
  57. +1 −1 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/workspace.ftl
  58. +2 −4 ...dbc/src/main/java/com/springsource/insight/plugin/jdbc/JdbcOperationExternalResourceAnalyzer.java
  59. +1 −1 .../main/java/com/springsource/insight/plugin/jdbc/JdbcPreparedStatementOperationCollectionAspect.aj
  60. +9 −4 ...jdbc/src/main/java/com/springsource/insight/plugin/jdbc/JdbcStatementOperationCollectionAspect.aj
  61. +1 −0 collection-plugins/jdbc/src/main/resources/com/springsource/insight/plugin/jdbc/jdbc-connect.ftl
  62. +1 −0 collection-plugins/jdbc/src/main/resources/com/springsource/insight/plugin/jdbc/jdbc.ftl
  63. +3 −4 .../jdbc/src/test/java/com/springsource/insight/plugin/jdbc/AbstractDatabaseJDBCURIAnalyzerTest.java
  64. +2 −0 ...src/test/java/com/springsource/insight/plugin/jdbc/JdbcOperationExternalResourceAnalyzerTest.java
  65. +13 −12 ...n-plugins/jdbc/src/test/java/com/springsource/insight/plugin/jdbc/JdbcOperationFinalizerTest.java
  66. +11 −3 ...java/com/springsource/insight/plugin/jdbc/JdbcPreparedStatementOperationCollectionAspectTest.java
  67. +7 −10 ...ection-plugins/jdbc/src/test/java/com/springsource/insight/plugin/jdbc/PoolingConnectionTest.java
  68. +22 −0 ...lugins/jdbc/src/test/java/com/springsource/insight/plugin/jdbc/helpers/jdk16/Jdk16Connection.java
  69. +10 −0 .../jdbc/src/test/java/com/springsource/insight/plugin/jdbc/helpers/jdk16/Jdk16DatabaseMetaData.java
  70. +18 −0 ...plugins/jdbc/src/test/java/com/springsource/insight/plugin/jdbc/helpers/jdk16/Jdk16Statement.java
  71. +6 −1 collection-plugins/jms/src/main/resources/com/springsource/insight/plugin/jms/jms.ftl
  72. +1 −0 ...ection-plugins/jndi/src/main/resources/com/springsource/insight/plugin/jndi/javax-naming-bind.ftl
  73. +1 −0 ...tion-plugins/jndi/src/main/resources/com/springsource/insight/plugin/jndi/javax-naming-lookup.ftl
  74. +1 −0 collection-plugins/jpa/src/main/resources/com/springsource/insight/plugin/jpa/entity-manager.ftl
  75. +1 −0 collection-plugins/jpa/src/main/resources/com/springsource/insight/plugin/jpa/tx-entity.ftl
  76. +1 −0 collection-plugins/jta/src/main/resources/com/springsource/insight/plugin/jta/jta.ftl
  77. +1 −0 collection-plugins/jws/src/main/resources/com/springsource/insight/plugin/jws/jws.ftl
  78. +1 −0 ...ection-plugins/ldap/src/main/resources/com/springsource/insight/plugin/ldap/javax-naming-ldap.ftl
  79. +1 −0 collection-plugins/logging/src/main/resources/com/springsource/insight/plugin/logging/logging.ftl
  80. +1 −0 collection-plugins/mail/src/main/resources/com/springsource/insight/plugin/mail/mail.ftl
  81. +1 −0 ...mongodb/src/main/resources/com/springsource/insight/plugin/mongodb/mongo_collection_operation.ftl
  82. +1 −0 ...ins/mongodb/src/main/resources/com/springsource/insight/plugin/mongodb/mongo_cursor_operation.ftl
  83. +1 −0 ...plugins/mongodb/src/main/resources/com/springsource/insight/plugin/mongodb/mongo_db_operation.ftl
  84. +1 −0 collection-plugins/pom.xml
  85. +6 −0 collection-plugins/portlet/src/main/resources/com/springsource/insight/plugin/portlet/action.ftl
  86. +7 −1 collection-plugins/portlet/src/main/resources/com/springsource/insight/plugin/portlet/event.ftl
  87. +7 −1 collection-plugins/portlet/src/main/resources/com/springsource/insight/plugin/portlet/render.ftl
  88. +7 −1 collection-plugins/portlet/src/main/resources/com/springsource/insight/plugin/portlet/resource.ftl
  89. +1 −0 ...s/quartz/src/main/resources/com/springsource/insight/plugin/quartz/scheduler/quartz-scheduler.ftl
  90. +7 −1 ...bitmq-client/src/main/resources/com/springsource/insight/plugin/rabbitmqClient/rabbitmqclient.ftl
  91. +1 −1 ...tion-plugins/redis/src/main/resources/com/springsource/insight/plugin/redis/redisClientMethod.ftl
  92. +10 −3 ...ection-plugins/redis/src/main/resources/com/springsource/insight/plugin/redis/redisCollection.ftl
  93. +6 −0 collection-plugins/redis/src/main/resources/com/springsource/insight/plugin/redis/redisMap.ftl
  94. +1 −0 collection-plugins/rmi/src/main/resources/com/springsource/insight/plugin/rmi/rmi-action.ftl
  95. +1 −0 collection-plugins/rmi/src/main/resources/com/springsource/insight/plugin/rmi/rmi-list.ftl
  96. +1 −0 ...ion-plugins/run-exec/src/main/resources/com/springsource/insight/plugin/runexec/exec-runnable.ftl
  97. +1 −0 ...tion-plugins/run-exec/src/main/resources/com/springsource/insight/plugin/runexec/run-runnable.ftl
  98. +6 −1 collection-plugins/servlet/src/main/resources/com/springsource/insight/plugin/servlet/http.ftl
  99. +7 −1 ...n-plugins/servlet/src/main/resources/com/springsource/insight/plugin/servlet/request-dispatch.ftl
  100. +6 −0 ...ion-plugins/servlet/src/main/resources/com/springsource/insight/plugin/servlet/servlet-filter.ftl
  101. +6 −0 ...n-plugins/servlet/src/main/resources/com/springsource/insight/plugin/servlet/servlet-listener.ftl
  102. +1 −0 collection-plugins/socket/src/main/resources/com/springsource/insight/plugin/socket/socket.ftl
  103. +1 −0 ...ugins/spring-batch/src/main/resources/com/springsource/insight/plugin/springbatch/springbatch.ftl
  104. +80 −4 .../src/main/java/com/springsource/insight/plugin/springcore/SpringEventReferenceCollectionAspect.aj
  105. +1 −0 ...spring-core/src/main/resources/com/springsource/insight/plugin/springcore/spring_app_listener.ftl
  106. +1 −0 ...ring-core/src/main/resources/com/springsource/insight/plugin/springcore/spring_bean_lifecycle.ftl
  107. +1 −0 ...ring-core/src/main/resources/com/springsource/insight/plugin/springcore/spring_classpath_scan.ftl
  108. +1 −0 ...pring-core/src/main/resources/com/springsource/insight/plugin/springcore/spring_event_publish.ftl
  109. +48 −1 collection-plugins/spring-core/src/test/java/com/foo/example/AbstractBean.java
  110. +5 −0 ...java/com/springsource/insight/plugin/springcore/ComponentMethodOperationCollectionAspectTest.java
  111. +5 −0 ...ava/com/springsource/insight/plugin/springcore/RepositoryMethodOperationCollectionAspectTest.java
  112. +5 −0 ...t/java/com/springsource/insight/plugin/springcore/ServiceMethodOperationCollectionAspectTest.java
  113. +94 −0 ...est/java/com/springsource/insight/plugin/springcore/SpringEventReferenceCollectionAspectTest.java
  114. +38 −0 ...va/com/springsource/insight/plugin/springcore/StereotypeOperationCollectionAspectTestSupport.java
  115. +1 −0 ...ing-data/src/main/resources/com/springsource/insight/plugin/springdata/spring-data-repository.ftl
  116. +5 −0 collection-plugins/spring-integration/pom.xml
  117. +1 −0 ...ntegration/src/main/resources/com/springsource/insight/plugin/integration/integration_adapter.ftl
  118. +1 −0 ...egration/src/main/resources/com/springsource/insight/plugin/integration/integration_operation.ftl
  119. +1 −0 ...ntegration/src/main/resources/com/springsource/insight/plugin/integration/integration_tcpconn.ftl
  120. +1 −1 collection-plugins/spring-neo4j/src/main/resources/com/springsource/insight/plugin/neo4j/find.ftl
  121. +1 −1 collection-plugins/spring-neo4j/src/main/resources/com/springsource/insight/plugin/neo4j/init.ftl
  122. +1 −1 collection-plugins/spring-neo4j/src/main/resources/com/springsource/insight/plugin/neo4j/lookup.ftl
  123. +1 −2 collection-plugins/spring-neo4j/src/main/resources/com/springsource/insight/plugin/neo4j/query.ftl
  124. +2 −4 ...ection-plugins/spring-neo4j/src/main/resources/com/springsource/insight/plugin/neo4j/traverse.ftl
  125. +1 −0 ...curity/src/main/resources/com/springsource/insight/plugin/spring/security/spring-authenticate.ftl
  126. +1 −0 ...ion-plugins/spring-tx/src/main/resources/com/springsource/insight/plugin/springtx/transaction.ftl
  127. +1 −0 ...ns/spring-web/src/main/resources/com/springsource/insight/plugin/springweb/binder/init_binder.ftl
  128. +1 −0 ...web/src/main/resources/com/springsource/insight/plugin/springweb/controller/controller_method.ftl
  129. +6 −0 ...g-web/src/main/resources/com/springsource/insight/plugin/springweb/http/spring_client_reqhttp.ftl
  130. +1 −0 ...web/src/main/resources/com/springsource/insight/plugin/springweb/http/spring_http_connfactory.ftl
  131. +1 −0 ...b/src/main/resources/com/springsource/insight/plugin/springweb/modelattribute/model_attribute.ftl
  132. +2 −1 ...spring-web/src/main/resources/com/springsource/insight/plugin/springweb/remoting/http_invoker.ftl
  133. +2 −1 ...s/spring-web/src/main/resources/com/springsource/insight/plugin/springweb/request/web_request.ftl
  134. +1 −0 ...ng-web/src/main/resources/com/springsource/insight/plugin/springweb/rest/spring_rest_template.ftl
  135. +1 −0 .../src/main/resources/com/springsource/insight/plugin/springweb/validation/controller_validator.ftl
  136. +1 −0 ...ring-web/src/main/resources/com/springsource/insight/plugin/springweb/view/render/view_render.ftl
  137. +1 −0 ...-web/src/main/resources/com/springsource/insight/plugin/springweb/view/resolver/view_resolver.ftl
  138. +18 −0 .../test/java/com/springsource/insight/plugin/springweb/rest/RestOperationCollectionTestSupport.java
  139. +1 −0 ...tion-plugins/spring-webflow/src/main/resources/com/springsource/insight/plugin/webflow/action.ftl
  140. +6 −0 ...ction-plugins/spring-webflow/src/main/resources/com/springsource/insight/plugin/webflow/start.ftl
  141. +5 −0 ...ction-plugins/spring-webflow/src/main/resources/com/springsource/insight/plugin/webflow/state.ftl
  142. +7 −1 ...-plugins/spring-webflow/src/main/resources/com/springsource/insight/plugin/webflow/transition.ftl
  143. +1 −0 collection-plugins/struts2/src/main/resources/com/springsource/insight/plugin/struts2/action.ftl
  144. +1 −0 collection-plugins/struts2/src/main/resources/com/springsource/insight/plugin/struts2/intercept.ftl
  145. +6 −0 collection-plugins/struts2/src/main/resources/com/springsource/insight/plugin/struts2/result.ftl
  146. +6 −0 collection-plugins/struts2/src/main/resources/com/springsource/insight/plugin/struts2/start.ftl
  147. +1 −0 ...ion-plugins/tomcat/src/main/resources/com/springsource/insight/plugin/tomcat/jsp/jsp-compiler.ftl
  148. +4 −10 parent/pom.xml
View
15 collection-plugins/akka/README.textile
@@ -0,0 +1,15 @@
+h1. Akka Plugin for Spring Insight
+
+This plugin supports the java client library provided by the Akka team.
+This plugin provides an endpoint for actors
+
+h2. Compatibility
+
+This plugin is compatible with the 1.9+ versions of insight.
+
+h2. Installation
+
+This is a core plugin of Insight 1.9+.
+
+For both the Dashboard and Insight Agent. You should see the
+plugin listed under the administration panel.
View
27 collection-plugins/akka/build.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="insight-plugin-akka" default="install">
+ <description>
+ Provides some useful ANT tasks involving the entire project
+ </description>
+
+ <dirname property="module.root.folder" file="${ant.file}" />
+ <dirname property="collection.plugins.folder" file="${module.root.folder}" />
+ <dirname property="insight.community.folder" file="${collection.plugins.folder}" />
+ <dirname property="insight.root.folder" file="${insight.community.folder}" />
+ <property name="insight.parent.folder" value="${insight.root.folder}${file.separator}parent" />
+ <property name="module.artifact.name" value="${ant.project.name}" />
+ <import file="${insight.parent.folder}${file.separator}build-insight.xml" />
+
+ <target name="compile" depends="run-module-mvn" description="Runs the mvn install command - including all the tests" />
+ <target name="uncompile" depends="clean-module-mvn" description="Runs the mvn clean command - including un-install the artifact from Maven local repository" />
+
+ <!-- ############### Generic targets ############## -->
+ <target name="install" depends="compile,copy-collection-plugin-artifact"
+ description="Compiles (including all the tests) and deploys the required artifacts" />
+
+ <target name="clean" depends="clean-module-mvn,clean-collection-plugin-artifact"
+ description="Runs the mvn clean command + undeploys the generated artifacts" />
+
+ <target name="re-install" depends="clean,install"
+ description="Cleans the artifacts and re-creates them from scratch (including all the tests)" />
+</project>
View
66 collection-plugins/akka/pom.xml
@@ -0,0 +1,66 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.springsource.insight.plugins</groupId>
+ <artifactId>insight-plugin-akka</artifactId>
+ <name>com.springsource.insight.plugins:akka</name>
+ <version>1.9.2-CI-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <parent>
+ <groupId>com.springsource.insight</groupId>
+ <artifactId>community-plugins</artifactId>
+ <version>1.9.2-CI-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <repositories>
+ <repository>
+ <id>typesafe</id>
+ <url>http://repo.typesafe.com/typesafe/releases/</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <!-- Provided dependencies (part of the user application) -->
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ <version>2.9.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-actor</artifactId>
+ <version>2.0.3</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Insight-Plugin-Descriptor>com.springsource.insight.plugin.akka.AkkaPluginRuntimeDescriptor</Insight-Plugin-Descriptor>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.mycila.maven-license-plugin</groupId>
+ <artifactId>maven-license-plugin</artifactId>
+ <configuration>
+ <header>../../aslHeader.txt</header>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
71 ...a/src/main/java/com/springsource/insight/plugin/akka/ActorRefOperationCollectionAspect.aj
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.springsource.insight.plugin.akka;
+
+import java.util.Map;
+
+import org.aspectj.lang.JoinPoint;
+
+import akka.actor.ActorRef;
+
+import com.springsource.insight.collection.method.MethodOperationCollectionAspect;
+import com.springsource.insight.intercept.operation.Operation;
+import com.springsource.insight.plugin.akka.actorref.ActorRefHelper;
+
+/**
+ *
+ */
+public aspect ActorRefOperationCollectionAspect extends MethodOperationCollectionAspect {
+ public ActorRefOperationCollectionAspect() {
+ super();
+ }
+
+ public pointcut collectionPoint() : execution(public void ActorRef+.tell(Object)) || execution(public void ActorRef+.tell(Object, ActorRef));
+
+ @Override
+ protected Operation createOperation(final JoinPoint jp) {
+ Object target = jp.getTarget();
+ ActorRef actorRef = (ActorRef) target;
+ Map<String, Object> additionalInfo = getAdditionalInfo(actorRef);
+ String path = String.valueOf(actorRef.path());
+ String actorRefType = target.getClass().getSimpleName();
+ Class<?> messageClass = jp.getArgs()[0].getClass();
+ return super.createOperation(jp)
+ .type(AkkaDefinitions.OperationTypes.AKKA_OP_ACTOR_REF)
+ .label(buildLabel(path, messageClass))
+ .put(AkkaDefinitions.Labels.PATH, path)
+ .put(AkkaDefinitions.Labels.MESSAGE, messageClass.getName())
+ .put(AkkaDefinitions.Labels.ACTOR_REF, actorRefType)
+ .putAnyAll(additionalInfo)
+ ;
+
+ }
+
+ private String buildLabel(String path, Class<?> messageClass) {
+ return "ActorRef#tell(" + messageClass.getSimpleName() + ") sent to " + path;
+ }
+
+ private Map<String, Object> getAdditionalInfo(ActorRef actorRef) {
+ return ActorRefHelper.getInstance().getActorRefProps(actorRef);
+ }
+
+ @Override
+ public String getPluginName() {
+ return AkkaPluginRuntimeDescriptor.PLUGIN_NAME;
+ }
+
+}
View
42 ...tion-plugins/akka/src/main/java/com/springsource/insight/plugin/akka/AkkaDefinitions.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.springsource.insight.plugin.akka;
+
+import com.springsource.insight.intercept.operation.OperationType;
+
+public class AkkaDefinitions {
+
+ public static final class OperationTypes {
+ public static final OperationType AKKA_OP_ACTOR_REF = OperationType.valueOf("akka_actor_ref");
+ public static final OperationType AKKA_OP_UNTYPED_ACTOR = OperationType.valueOf("akka_untyped_actor");
+ public static final OperationType AKKA_OP_TYPED_ACTOR = OperationType.valueOf("akka_typed_actor");
+ }
+
+ public static final class Labels {
+ public static final String AKKA = "Akka";
+ public static final String ACTOR = "Actor";
+ public static final String ACTOR_REF = "ActorRef";
+ public static final String MESSAGE = "MessageType";
+ public static final String PATH = "Path";
+ public static final String ROUTER = "Router";
+ public static final String SENDER = "Sender";
+ public static final String SYSTEM = "System";
+ public static final String TYPED_ACTOR = "Typed Actor";
+ public static final String UNTYPED_ACTOR = "Untyped Actor";
+ }
+
+}
View
54 .../akka/src/main/java/com/springsource/insight/plugin/akka/AkkaPluginRuntimeDescriptor.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.springsource.insight.plugin.akka;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import com.springsource.insight.intercept.endpoint.EndPointAnalyzer;
+import com.springsource.insight.intercept.plugin.PluginRuntimeDescriptor;
+
+/**
+ *
+ */
+public class AkkaPluginRuntimeDescriptor extends PluginRuntimeDescriptor {
+
+ public static final String PLUGIN_NAME = "akka";
+
+ private static final AkkaPluginRuntimeDescriptor INSTANCE = new AkkaPluginRuntimeDescriptor();
+ private Collection<? extends EndPointAnalyzer> analyzers = Collections
+ .singleton(AkkaUntypedActorEndPointAnalyzer.getInstance());
+
+ private AkkaPluginRuntimeDescriptor() {
+ super();
+ }
+
+ public static final AkkaPluginRuntimeDescriptor getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public String getPluginName() {
+ return PLUGIN_NAME;
+ }
+
+ @Override
+ public Collection<? extends EndPointAnalyzer> getEndPointAnalyzers() {
+ return analyzers;
+ }
+
+}
View
49 .../src/main/java/com/springsource/insight/plugin/akka/AkkaUntypedActorEndPointAnalyzer.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.springsource.insight.plugin.akka;
+
+import com.springsource.insight.intercept.endpoint.AbstractSingleTypeEndpointAnalyzer;
+import com.springsource.insight.intercept.endpoint.EndPointAnalysis;
+import com.springsource.insight.intercept.endpoint.EndPointName;
+import com.springsource.insight.intercept.operation.Operation;
+import com.springsource.insight.intercept.trace.Frame;
+
+public class AkkaUntypedActorEndPointAnalyzer extends AbstractSingleTypeEndpointAnalyzer {
+
+ private static final AkkaUntypedActorEndPointAnalyzer INSTANCE = new AkkaUntypedActorEndPointAnalyzer();
+
+ public static final AkkaUntypedActorEndPointAnalyzer getInstance() {
+ return INSTANCE;
+ }
+
+ protected AkkaUntypedActorEndPointAnalyzer() {
+ super(AkkaDefinitions.OperationTypes.AKKA_OP_UNTYPED_ACTOR);
+ }
+
+ @Override
+ protected EndPointAnalysis makeEndPoint(Frame frame, int depth) {
+ Operation operation = frame.getOperation();
+ EndPointName endPointName = EndPointName.valueOf(operation);
+ String example = createExample(operation);
+ return new EndPointAnalysis(endPointName, operation.getLabel(), example, getDefaultScore(depth));
+ }
+
+ private String createExample(Operation operation) {
+ return operation.get(AkkaDefinitions.Labels.ACTOR, String.class) + " received message of type "
+ + operation.get(AkkaDefinitions.Labels.MESSAGE, String.class);
+ }
+}
View
77 ...c/main/java/com/springsource/insight/plugin/akka/UntypedActorOperationCollectionAspect.aj
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.springsource.insight.plugin.akka;
+
+import org.aspectj.lang.JoinPoint;
+
+import akka.actor.ActorPath;
+import akka.actor.ActorRef;
+import akka.actor.UntypedActor;
+
+import com.springsource.insight.collection.method.MethodOperationCollectionAspect;
+import com.springsource.insight.intercept.operation.Operation;
+
+/**
+ *
+ */
+public aspect UntypedActorOperationCollectionAspect extends MethodOperationCollectionAspect {
+ public UntypedActorOperationCollectionAspect() {
+ super();
+ }
+
+ public pointcut collectionPoint() : execution(public void UntypedActor+.onReceive(Object));
+
+ @Override
+ protected Operation createOperation(final JoinPoint jp) {
+ Object target = jp.getTarget();
+ UntypedActor actor = (UntypedActor) target;
+ String actorType = target.getClass().getSimpleName();
+ String system = actor.getSelf().path().address().system();
+ ActorRef senderRef = actor.getSender();
+ String senderPath = buildPath(senderRef);
+ Class<?> messageClass = jp.getArgs()[0].getClass();
+ return super.createOperation(jp)
+ .type(AkkaDefinitions.OperationTypes.AKKA_OP_UNTYPED_ACTOR)
+ .label(buildLabel(actorType, messageClass))
+ .put(AkkaDefinitions.Labels.ACTOR + AkkaDefinitions.Labels.PATH, buildPath(actor.getSelf()))
+ .put(AkkaDefinitions.Labels.SYSTEM, system)
+ .put(AkkaDefinitions.Labels.SENDER + AkkaDefinitions.Labels.PATH, senderPath)
+ .put(AkkaDefinitions.Labels.MESSAGE, messageClass.getName())
+ .put(AkkaDefinitions.Labels.ACTOR, actorType)
+ ;
+ }
+
+ private String buildLabel(String actorType, Class<?> messageClass) {
+ return actorType + "#onReceive(" + messageClass.getSimpleName() + ")";
+ }
+
+ private String buildPath(ActorRef ref) {
+ ActorPath path = ref.path();
+ return String.valueOf(path);
+ }
+
+ @Override
+ public String getPluginName() {
+ return AkkaPluginRuntimeDescriptor.PLUGIN_NAME;
+ }
+
+ @Override
+ public boolean isEndpoint() {
+ return true;
+ }
+
+}
View
58 ...gins/akka/src/main/java/com/springsource/insight/plugin/akka/actorref/ActorRefHelper.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka.actorref;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import akka.actor.ActorRef;
+import akka.pattern.PromiseActorRef;
+import akka.routing.RoutedActorRef;
+
+public final class ActorRefHelper {
+
+ private static final ActorRefHelper INSTANCE = new ActorRefHelper();
+
+ public static ActorRefHelper getInstance() {
+ return INSTANCE;
+ }
+
+ private Map<Class<? extends ActorRef>, ActorRefPropertyExtractor> extractors = new HashMap<Class<? extends ActorRef>, ActorRefPropertyExtractor>();
+
+ private ActorRefHelper() {
+ extractors.put(RoutedActorRef.class, RouterActorRefPropertyExtractor.INSTANCE);
+ extractors.put(PromiseActorRef.class, PromiseActorRefPropertyExtractor.INSTANCE);
+ }
+
+ public Map<String, Object> getActorRefProps(ActorRef actorRef) {
+ return extract(actorRef);
+ }
+
+ private Map<String, Object> extract(ActorRef actorRef) {
+ Class<?> searchClass = actorRef.getClass();
+ while (!Object.class.equals(searchClass)) {
+ ActorRefPropertyExtractor extractor = extractors.get(searchClass);
+ if (extractor == null) {
+ searchClass = searchClass.getSuperclass();
+ } else {
+ return extractor.extractProperties(actorRef);
+ }
+ }
+ return Collections.emptyMap();
+ }
+
+}
View
25 ...rc/main/java/com/springsource/insight/plugin/akka/actorref/ActorRefPropertyExtractor.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka.actorref;
+
+import java.util.Map;
+
+import akka.actor.ActorRef;
+
+interface ActorRefPropertyExtractor {
+
+ Map<String, Object> extractProperties(ActorRef ref);
+}
View
37 .../java/com/springsource/insight/plugin/akka/actorref/PromiseActorRefPropertyExtractor.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka.actorref;
+
+import java.util.Collections;
+import java.util.Map;
+
+import akka.actor.ActorRef;
+import akka.pattern.PromiseActorRef;
+
+class PromiseActorRefPropertyExtractor implements ActorRefPropertyExtractor {
+
+ public static final PromiseActorRefPropertyExtractor INSTANCE = new PromiseActorRefPropertyExtractor();
+
+ private PromiseActorRefPropertyExtractor() {
+ super();
+ }
+
+ public Map<String, Object> extractProperties(ActorRef actorRef) {
+ PromiseActorRef ref = (PromiseActorRef) actorRef;
+ return Collections.<String, Object> singletonMap("local", Boolean.valueOf(ref.isLocal()));
+ }
+
+}
View
44 ...n/java/com/springsource/insight/plugin/akka/actorref/RouterActorRefPropertyExtractor.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka.actorref;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.springsource.insight.plugin.akka.routing.AkkaRouterConfigHelper;
+
+import akka.actor.ActorRef;
+import akka.routing.RoutedActorRef;
+import akka.routing.RouterConfig;
+
+class RouterActorRefPropertyExtractor implements ActorRefPropertyExtractor {
+
+ public static final RouterActorRefPropertyExtractor INSTANCE = new RouterActorRefPropertyExtractor();
+
+ private RouterActorRefPropertyExtractor() {
+ super();
+ }
+
+ public Map<String, Object> extractProperties(ActorRef actorRef) {
+ RoutedActorRef ref = (RoutedActorRef) actorRef;
+ Map<String, Object> result = new HashMap<String, Object>();
+ RouterConfig routerConfig = ref.routerConfig();
+ result.putAll(AkkaRouterConfigHelper.getInstance().getRouterConfigInformation(routerConfig));
+ result.put("local", Boolean.valueOf(ref.isLocal()));
+ return result;
+ }
+
+}
View
63 ...ka/src/main/java/com/springsource/insight/plugin/akka/routing/AkkaRouterConfigHelper.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.springsource.insight.plugin.akka.routing;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import akka.routing.RoundRobinRouter;
+import akka.routing.RouterConfig;
+
+public final class AkkaRouterConfigHelper {
+
+ private static final AkkaRouterConfigHelper INSTANCE = new AkkaRouterConfigHelper();
+
+ public static final AkkaRouterConfigHelper getInstance() {
+ return INSTANCE;
+ }
+
+ private Map<Class<? extends RouterConfig>, RouterConfigDataExtractor> routerConfigExtractors = new HashMap<Class<? extends RouterConfig>, RouterConfigDataExtractor>();
+
+ private AkkaRouterConfigHelper() {
+ routerConfigExtractors.put(RoundRobinRouter.class, RoundRobinRouterDataExtractor.INSTANCE);
+
+ }
+
+ public Map<String, String> getRouterConfigInformation(RouterConfig routerConfig) {
+ Map<String, String> result = new HashMap<String, String>();
+ result.put("Router", routerConfig.getClass().getSimpleName());
+ String routerDispatcher = routerConfig.routerDispatcher();
+ result.put("Router Dispatcher", routerDispatcher);
+ result.putAll(extract(routerConfig));
+ return result;
+ }
+
+ private Map<String, String> extract(RouterConfig routerConfig) {
+ Class<?> searchClass = routerConfig.getClass();
+ while (!Object.class.equals(searchClass)) {
+ RouterConfigDataExtractor extractor = routerConfigExtractors.get(searchClass);
+ if (extractor == null) {
+ searchClass = searchClass.getSuperclass();
+ } else {
+ return extractor.extract(routerConfig);
+ }
+ }
+ return Collections.emptyMap();
+ }
+
+}
View
36 ...main/java/com/springsource/insight/plugin/akka/routing/RoundRobinRouterDataExtractor.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.springsource.insight.plugin.akka.routing;
+
+import java.util.Collections;
+import java.util.Map;
+
+import akka.routing.RoundRobinRouter;
+import akka.routing.RouterConfig;
+
+public class RoundRobinRouterDataExtractor implements RouterConfigDataExtractor {
+
+ public static final RoundRobinRouterDataExtractor INSTANCE = new RoundRobinRouterDataExtractor();
+
+ private RoundRobinRouterDataExtractor() {
+ }
+
+ public Map<String, String> extract(RouterConfig routerConfig) {
+ RoundRobinRouter router = (RoundRobinRouter) routerConfig;
+ return Collections.singletonMap("Num of instances", String.valueOf(router.nrOfInstances()));
+ }
+}
View
27 ...src/main/java/com/springsource/insight/plugin/akka/routing/RouterConfigDataExtractor.java
@@ -0,0 +1,27 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.springsource.insight.plugin.akka.routing;
+
+import java.util.Map;
+
+import akka.routing.RouterConfig;
+
+interface RouterConfigDataExtractor {
+
+ Map<String, String> extract(RouterConfig routerConfig);
+
+}
View
29 collection-plugins/akka/src/main/resources/META-INF/insight-plugin-akka.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:insight="http://www.springframework.org/schema/insight-idk"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/insight-idk
+ http://www.springframework.org/schema/insight-idk/insight-idk-1.0.xsd">
+
+ <insight:plugin name="akka" version="${project.version}" publisher="SpringSource" />
+
+ <insight:operation-group operation="akka_actor_ref" group="Akka"/>
+ <insight:operation-group operation="akka_untyped_actor" group="Akka"/>
+
+ <insight:operation-view operation="akka_untyped_actor" template="com/springsource/insight/plugin/akka/akka.ftl"/>
+
+ <bean id="akkaPluginUntypedActorEndPointAnalyzer"
+ class="com.springsource.insight.plugin.akka.AkkaUntypedActorEndPointAnalyzer"
+ factory-method="getInstance"
+ lazy-init="true"
+ />
+
+ <bean id="akkaPluginRuntimeDescriptor"
+ class="com.springsource.insight.plugin.akka.AkkaPluginRuntimeDescriptor"
+ factory-method="getInstance"
+ lazy-init="true"
+ />
+</beans>
+
View
14 collection-plugins/akka/src/main/resources/com/springsource/insight/plugin/akka/akka.ftl
@@ -0,0 +1,14 @@
+<#ftl strip_whitespace=true>
+<#import "/insight-1.0.ftl" as insight />
+
+<@insight.group label="Akka UntypedActor Operation">
+ <@insight.entry name="Actor" value=operation.Actor />
+ <@insight.entry name="Actor Full Name" value=operation.className />
+ <@insight.entry name="Actor Path" value=operation.ActorPath />
+ <@insight.entry name="Message Type" value=operation.MessageType />
+ <@insight.entry name="Sender Path" value=operation.SenderPath />
+ <@insight.entry name="System" value=operation.System />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
+</@insight.group>
+
+<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
77 ...om/springsource/insight/plugin/akka/AbstractAkkaOperationCollectionAspectTestSupport.java
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka;
+
+import org.junit.After;
+import org.junit.Before;
+
+import akka.actor.Actor;
+import akka.actor.ActorRef;
+import akka.actor.ActorSystem;
+import akka.actor.Props;
+import akka.actor.UntypedActor;
+
+import com.springsource.insight.collection.test.OperationCollectionAspectTestSupport;
+
+public abstract class AbstractAkkaOperationCollectionAspectTestSupport extends OperationCollectionAspectTestSupport {
+
+ protected static final String AKKA_PREFIX = "akka://";
+ protected static final String TEST_SYSTEM_NAME = "test-system";
+ protected static final String TEST_ACTOR_NAME = "test-actor";
+ protected ActorSystem actorSystem;
+ protected ActorRef actorRef;
+
+ @Before
+ public final void initAkka() {
+ actorSystem = ActorSystem.create(TEST_SYSTEM_NAME);
+ }
+
+ @After
+ public final void closeAkka() {
+ actorSystem.shutdown();
+ }
+
+ protected final ActorRef createActorRef() {
+ actorRef = actorSystem.actorOf(new Props(SimpleUntypedActor.class), TEST_ACTOR_NAME);
+ return actorRef;
+ }
+
+ protected final Class<? extends Actor> getUntypedActorClass() {
+ return SimpleUntypedActor.class;
+ }
+
+ protected String getSystemPath() {
+ return AKKA_PREFIX + TEST_SYSTEM_NAME;
+ }
+
+ protected String getDeadLettersPath() {
+ return getSystemPath() + "/deadLetters";
+ }
+
+ protected String getActorRefPath() {
+ return getSystemPath() + "/user/" + TEST_ACTOR_NAME;
+ }
+
+ public static final class SimpleUntypedActor extends UntypedActor {
+
+ @Override
+ public void onReceive(Object o) throws Exception {
+ // do nothing
+ }
+
+ }
+
+}
View
67 .../java/com/springsource/insight/plugin/akka/UntypedActorOperationCollectionAspectTest.java
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka;
+
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.junit.Test;
+
+import akka.actor.ActorRef;
+
+import com.springsource.insight.collection.OperationCollectionAspectSupport;
+import com.springsource.insight.intercept.operation.Operation;
+
+public class UntypedActorOperationCollectionAspectTest extends AbstractAkkaOperationCollectionAspectTestSupport {
+ public UntypedActorOperationCollectionAspectTest() {
+ super();
+ }
+
+ @Test
+ public void testCreateOperation() throws Exception {
+ ActorRef ref = createActorRef();
+ ref.tell(getClass());
+
+ Thread.sleep(1000);
+
+ Operation operation = getLastEntered();
+ Operation expected = new Operation().type(AkkaDefinitions.OperationTypes.AKKA_OP_UNTYPED_ACTOR)
+ .put(AkkaDefinitions.Labels.MESSAGE, Class.class.getName())
+ .label(getUntypedActorClass().getSimpleName() + "#onReceive(" + Class.class.getSimpleName() + ")")
+ .put(AkkaDefinitions.Labels.SYSTEM, actorSystem.name())
+ .put(AkkaDefinitions.Labels.ACTOR, getUntypedActorClass().getSimpleName())
+ .put(AkkaDefinitions.Labels.ACTOR + AkkaDefinitions.Labels.PATH, getActorRefPath())
+ .put(AkkaDefinitions.Labels.SENDER + AkkaDefinitions.Labels.PATH, getDeadLettersPath());
+ assertUntypedActorOperation(expected, operation);
+ }
+
+ @Override
+ public OperationCollectionAspectSupport getAspect() {
+ return UntypedActorOperationCollectionAspect.aspectOf();
+ }
+
+ private void assertUntypedActorOperation(Operation expected, Operation operation) {
+ Map<String, Object> map = operation.asMap();
+ for (Entry<String, Object> expectedEntry : expected.asMap().entrySet()) {
+ String key = expectedEntry.getKey();
+ Object resultValue = map.get(key);
+ if (resultValue == null || !expectedEntry.getValue().equals(resultValue)) {
+ fail("expcted key-value '" + expectedEntry + "' but got '" + key + "=" + resultValue + "'");
+ }
+ }
+ }
+
+}
View
53 ...a/com/springsource/insight/plugin/akka/actorref/PromiseActorRefPropertyExtractorTest.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka.actorref;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.RETURNS_DEFAULTS;
+import static org.mockito.Mockito.RETURNS_SMART_NULLS;
+import static org.mockito.Mockito.mock;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.junit.Test;
+
+import akka.actor.ActorRefProvider;
+import akka.dispatch.Promise;
+import akka.pattern.PromiseActorRef;
+
+public class PromiseActorRefPropertyExtractorTest {
+ public PromiseActorRefPropertyExtractorTest() {
+ super();
+ }
+
+ @Test
+ public void testExtractProperties() {
+ PromiseActorRef ref = createActorRef();
+ Map<String, Object> result = PromiseActorRefPropertyExtractor.INSTANCE.extractProperties(ref);
+ assertEquals("not the expected result", Collections.singletonMap("local", Boolean.TRUE), result);
+ }
+
+ private PromiseActorRef createActorRef() {
+ ActorRefProvider refProvider = mock(ActorRefProvider.class, RETURNS_DEFAULTS);
+ @SuppressWarnings("unchecked")
+ Promise<Object> promise = mock(Promise.class, RETURNS_SMART_NULLS);
+
+ PromiseActorRef ref = new PromiseActorRef(refProvider, promise);
+ return ref;
+ }
+
+}
View
59 ...va/com/springsource/insight/plugin/akka/actorref/RouterActorRefPropertyExtractorTest.java
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka.actorref;
+
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import akka.routing.RoutedActorRef;
+
+public class RouterActorRefPropertyExtractorTest {
+
+ private RoutedActorRef tested;
+ public RouterActorRefPropertyExtractorTest() {
+ super();
+ }
+
+ @Before
+ public void setUp() {
+ tested = mock(RoutedActorRef.class, Mockito.RETURNS_MOCKS);
+ }
+
+ @Test
+ public void testExtractProperties() {
+ Map<String, Object> result = RouterActorRefPropertyExtractor.INSTANCE.extractProperties(tested);
+ assertKeysExist(Arrays.asList("local", "Router Dispatcher", "Router"), result.keySet());
+ }
+
+ private void assertKeysExist(List<String> expectedKeys, Collection<String> keys) {
+
+ for (String key : expectedKeys) {
+ if (!keys.contains(key)) {
+ fail("key '" + key + "' doesn't exist in result " + keys);
+ }
+ }
+ }
+
+}
View
97 ...rc/test/java/com/springsource/insight/plugin/akka/routing/AkkaRouterConfigHelperTest.java
@@ -0,0 +1,97 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka.routing;
+
+import static org.junit.Assert.assertEquals;
+
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import akka.actor.Props;
+import akka.actor.SupervisorStrategy;
+import akka.routing.CustomRoute;
+import akka.routing.CustomRouterConfig;
+import akka.routing.RouteeProvider;
+import akka.routing.RouterConfig;
+
+import com.springsource.insight.util.ExtraReflectionUtils;
+import com.springsource.insight.util.ReflectionUtils;
+
+public class AkkaRouterConfigHelperTest {
+
+ private static final String TEST_DISPATCHER = "test-dispatcher";
+ private static final Map<String, String> ROUTER_CONFIG_KEY_VALUE = Collections.singletonMap("test-key",
+ "test-value");
+ private AkkaRouterConfigHelper tested;
+
+ public AkkaRouterConfigHelperTest() {
+ super();
+ }
+
+ @Before
+ public void setUp() {
+ tested = AkkaRouterConfigHelper.getInstance();
+ Field field = ExtraReflectionUtils.getAccessibleField(AkkaRouterConfigHelper.class, "routerConfigExtractors");
+ ReflectionUtils.setField(field, tested,
+ Collections.singletonMap(CustomRouterConfig.class, new RouterConfigDataExtractor() {
+
+ @SuppressWarnings("synthetic-access")
+ public Map<String, String> extract(RouterConfig routerConfig) {
+ return ROUTER_CONFIG_KEY_VALUE;
+ }
+ }));
+ }
+
+ @Test
+ public void testGetRouterConfigInformation() {
+ Map<String, String> result = tested.getRouterConfigInformation(new TestCustomRouterConfig());
+ Map<String, String> expected = createdExpected();
+ assertEquals("extracted values", expected, result);
+ }
+
+ private Map<String, String> createdExpected() {
+ Map<String, String> expected = new HashMap<String, String>();
+ expected.put("Router", TestCustomRouterConfig.class.getSimpleName());
+ expected.put("Router Dispatcher", TEST_DISPATCHER);
+ expected.putAll(ROUTER_CONFIG_KEY_VALUE);
+ return expected;
+ }
+
+ private static final class TestCustomRouterConfig extends CustomRouterConfig {
+ public TestCustomRouterConfig() {
+ super();
+ }
+
+ public SupervisorStrategy supervisorStrategy() {
+ return null;
+ }
+
+ public String routerDispatcher() {
+ return TEST_DISPATCHER;
+ }
+
+ @Override
+ public CustomRoute createCustomRoute(Props arg0, RouteeProvider arg1) {
+ return null;
+ }
+ }
+
+}
View
44 .../java/com/springsource/insight/plugin/akka/routing/RoundRobinRouterDataExtractorTest.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2009-2011 VMware, Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.springsource.insight.plugin.akka.routing;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.junit.Test;
+
+import akka.routing.RoundRobinRouter;
+
+public class RoundRobinRouterDataExtractorTest {
+ public RoundRobinRouterDataExtractorTest() {
+ super();
+ }
+
+ @Test
+ public void testExtract() {
+ RoundRobinRouter roundRobinRouter = new RoundRobinRouter(5);
+ RoundRobinRouterDataExtractor extractor = RoundRobinRouterDataExtractor.INSTANCE;
+
+ Map<String, String> extracted = extractor.extract(roundRobinRouter);
+ Map<String, String> expected = Collections.singletonMap("Num of instances", String.valueOf(5));
+
+ assertEquals("extracted property maps" , expected, extracted);
+
+ }
+
+}
View
1 ...on-plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/cql.ftl
@@ -11,6 +11,7 @@
<@insight.entry name="Parameters" if=operation.params?has_content>
<@insight.list type="ordered" collection=operation.params />
</@insight.entry>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 ...on-plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/get.ftl
@@ -36,6 +36,7 @@
</@insight.entry>
<@insight.entry name="Consistency Level" value=operation.consistLevel />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
6 ...plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/remove.ftl
@@ -2,16 +2,14 @@
<#import "/insight-1.0.ftl" as insight />
<@insight.group label="Details">
- <@insight.entry name="Server" value=operation.server />
-
+ <@insight.entry name="Server" value=operation.server />
<@insight.entry name="Key" value=operation.key />
<@insight.entry name="ColumnFamily" value=operation.columnFamily />
<@insight.entry name="SuperColumn" value=operation.superColumn />
<@insight.entry name="Column Name" value=operation.colName />
-
<@insight.entry name="Timestamp" value=operation.timestamp />
-
<@insight.entry name="Consistency Level" value=operation.consistLevel />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
7 ...plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/system.ftl
@@ -2,27 +2,24 @@
<#import "/insight-1.0.ftl" as insight />
<@insight.group label="Details">
- <@insight.entry name="Server" value=operation.server />
-
+ <@insight.entry name="Server" value=operation.server />
<@insight.entry name="Keyspace" value=operation.keyspace />
<@insight.entry name="Strategy Class" value=operation.class />
<@insight.entry name="ColumnFamily" value=operation.columnFamily />
-
<#if operation.columnFamilyDef?has_content>
<@insight.group label="ColumnFamily Definition" collection=operation.columnFamilyDef?keys ; k>
<@insight.entry name=k value=operation.columnFamilyDef[k] />
</@insight.group>
</#if>
-
<@insight.entry name="Columns Definition" if=operation.columnsDef?has_content>
<@insight.list type="ordered" collection=operation.columnsDef />
</@insight.entry>
-
<#if operation.credentials?has_content>
<@insight.group label="Credentials" collection=operation.credentials?keys ; k>
<@insight.entry name=k value=operation.credentials[k] />
</@insight.group>
</#if>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
5 ...plugins/cassandra/src/main/resources/com/springsource/insight/plugin/cassandra/update.ftl
@@ -3,22 +3,19 @@
<@insight.group label="Details">
<@insight.entry name="Server" value=operation.server />
-
<@insight.entry name="Key" value=operation.key />
<@insight.entry name="ColumnFamily" value=operation.columnFamily />
<@insight.entry name="SuperColumn" value=operation.superColumn />
-
<@insight.entry name="Column Name" value=operation.colName />
<@insight.entry name="Column Value" value=operation.colValue />
<@insight.entry name="Column Timestamp" value=operation.colTimestamp />
-
<#if operation.tables?has_content>
<@insight.group label="Tables" collection=operation.tables?keys ; k>
<@insight.entry name=k value=operation.tables[k] />
</@insight.group>
</#if>
-
<@insight.entry name="Consistency Level" value=operation.consistLevel />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
7 ...java/com/springsource/insight/plugin/cassandra/AbstractOperationCollectionAspectTest.java
@@ -25,6 +25,11 @@
import com.springsource.insight.intercept.operation.OperationType;
public abstract class AbstractOperationCollectionAspectTest extends OperationCollectionAspectTestSupport {
+
+ protected AbstractOperationCollectionAspectTest() {
+ super();
+ }
+
public void validate(OperationType opType, String... p_params) throws Exception {
// Step 2: Get the Operation that was just created by our aspect
Operation op = getLastEntered();
@@ -36,7 +41,7 @@ public void validate(OperationType opType, String... p_params) throws Exception
// prepare parameters
List<String> params=new ArrayList<String>();
Collections.addAll(params, p_params);
- params.add("server = localhost:9160");
+ params.add("server = " + CassandraUnitTests.TEST_HOST + ":" + CassandraUnitTests.RPC_PORT);
// Step 4: Validate parameters
for (String def: params) {
String[] param=null;
View
6 ...cassandra/src/test/java/com/springsource/insight/plugin/cassandra/CassandraUnitTests.java
@@ -39,6 +39,10 @@
import com.springsource.insight.plugin.cassandra.embeded.EmbeddedCassandraService;
public class CassandraUnitTests {
+ // NOTE !!! must match the values in the yaml file
+ public static final String TEST_HOST="127.0.0.1";
+ public static final int RPC_PORT=7365;
+
private static EmbeddedCassandraService cassandra;
private static CassandraUnitTests instance;
private static Cassandra.Client lastClient;
@@ -59,7 +63,7 @@ public static CassandraUnitTests getInstance() throws Exception {
private Cassandra.Client getClient() throws TTransportException {
if (lastClient==null) {
- TTransport tr = new TFramedTransport(new TSocket("localhost", 9160));
+ TTransport tr = new TFramedTransport(new TSocket(TEST_HOST, RPC_PORT));
lastClient=new Cassandra.Client(new TBinaryProtocol(tr));
tr.open();
}
View
12 collection-plugins/cassandra/src/test/resources/cassandra.yaml
@@ -2,14 +2,14 @@ cluster_name: 'Test Cluster'
initial_token: 0
data_file_directories:
- - /tmp/cassandra/data
-commitlog_directory: /tmp/cassandra/commitlog
-saved_caches_directory: /tmp/cassandra/saved_caches
+ - ./target/cassandra/data
+commitlog_directory: ./target/cassandra/commitlog
+saved_caches_directory: ./target/cassandra/saved_caches
-listen_address: localhost
+listen_address: 127.0.0.1
storage_port: 7000
-rpc_address: localhost
-rpc_port: 9160
+rpc_address: 127.0.0.1
+rpc_port: 7365
commitlog_sync: periodic
commitlog_sync_period_in_ms: 10000
View
1 ...persistence/src/main/resources/com/springsource/insight/plugin/eclipse/persistence/db.ftl
@@ -3,6 +3,7 @@
<@insight.group label="Eclipse Persistence Session">
<@insight.entry name="Action" value=operation.action />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 ...sistence/src/main/resources/com/springsource/insight/plugin/eclipse/persistence/query.ftl
@@ -3,6 +3,7 @@
<@insight.group label="Eclipse Persistence Query">
<@insight.entry name="Query name" value=operation.action />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 ...persistence/src/main/resources/com/springsource/insight/plugin/eclipse/persistence/tx.ftl
@@ -3,6 +3,7 @@
<@insight.group label="Eclipse Persistence Transaction">
<@insight.entry name="Action" value=operation.action />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
6 ...on-plugins/ehcache/src/main/resources/com/springsource/insight/plugin/ehcache/ehcache.ftl
@@ -22,4 +22,10 @@
</@insight.group>
</#if>
+<#if operation.exception??>
+ <@insight.group label="Exception details">
+ <@insight.entry name="Exception" value=operation.exception/>
+ </@insight.group>
+</#if>
+
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 collection-plugins/ejb3/src/main/resources/com/springsource/insight/plugin/ejb3/ejb3.ftl
@@ -3,6 +3,7 @@
<@insight.group label="EJB3 Call">
<@insight.entry name="Label" value=operation.label />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 ...racker/src/main/resources/com/springsource/insight/plugin/files/tracker/files-tracker.ftl
@@ -3,6 +3,7 @@
<@insight.group label="File Operation">
<@insight.entry name="File Operation" value=operation.label />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 ...ht/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_query_operation.ftl
@@ -11,6 +11,7 @@
<@insight.entry name="Query">
${operation.query?html}
</@insight.entry>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 ...t/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_remote_operation.ftl
@@ -11,6 +11,7 @@
<@insight.entry name="Port">
${operation.port?html}
</@insight.entry>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
35 ...re/src/main/java/com/springsource/insight/plugin/gemfire/GemFireRegionCollectionAspect.aj
@@ -22,23 +22,32 @@ import com.gemstone.gemfire.cache.Region;
import com.springsource.insight.intercept.operation.Operation;
public aspect GemFireRegionCollectionAspect extends AbstractGemFireCollectionAspect {
-
- public pointcut readWriteFlow () : execution(* Region.get(..)) || execution(* Region.getAll(..)) || execution(* Region.getEntry(..)) || execution(* Region.selectValue(..)) || execution(* Region.values())
- || execution(* Region.put(..)) || execution(* Region.putAll(..)) || execution(* Region.putIfAbsent(..)) || execution(* Region.query(..))
- || execution(* Region.remove(..)) || execution(* Region.replace(..));
-
- public pointcut otherFlow () : execution(* Region.clear()) || execution(* Region.containsKey*(..)) || execution(* Region.containsValue*(..))
- || execution(* Region.create*(..)) || execution(* Region.destroy*(..))
- || execution(* Region.entr*(..)) || execution(* Region.existsValue(..)) || execution(* Region.isEmpty())
- || execution(* Region.invalidate*(..)) || execution(* Region.key*(..))
- || execution(* Region.loadSnapshot*(..)) || execution(* Region.local*(..)) || execution(* Region.saveSnapshot*(..));
-
- public pointcut collectionPoint () : (readWriteFlow() || otherFlow()) && !cflowbelow(readWriteFlow());
-
public GemFireRegionCollectionAspect() {
super(GemFireDefenitions.TYPE_REGION);
}
+ public pointcut readWriteFlow ()
+ : execution(* Region.get(..)) || execution(* Region.getAll(..)) || execution(* Region.getEntry(..))
+ || execution(* Region.selectValue(..)) || execution(* Region.values())
+ || execution(* Region.put(..)) || execution(* Region.putAll(..)) || execution(* Region.putIfAbsent(..))
+ || execution(* Region.query(..))
+ || execution(* Region.remove(..))
+ || execution(* Region.replace(..))
+ ;
+
+ public pointcut otherFlow ()
+ : execution(* Region.clear())
+ || execution(* Region.containsKey*(..)) || execution(* Region.containsValue*(..))
+ || execution(* Region.create*(..)) || execution(* Region.destroy*(..))
+ || execution(* Region.entr*(..)) || execution(* Region.existsValue(..)) || execution(* Region.isEmpty())
+ || execution(* Region.invalidate*(..)) || execution(* Region.key*(..))
+ || execution(* Region.loadSnapshot*(..)) || execution(* Region.local*(..)) || execution(* Region.saveSnapshot*(..))
+ ;
+
+ public pointcut regionFlow() : readWriteFlow() || otherFlow();
+
+ public pointcut collectionPoint () : regionFlow() && !cflowbelow(regionFlow());
+
@Override
protected Operation createOperation(final JoinPoint jp) {
Operation op = createBasicOperation(jp);
View
1 ...re/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_query_operation.ftl
@@ -11,6 +11,7 @@
<@insight.entry name="Query">
${operation.query?html}
</@insight.entry>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
2 ...e/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_region_operation.ftl
@@ -14,7 +14,7 @@
<@insight.entry name="Server" if=operation.servers?has_content>
<@insight.list type="ordered" collection=operation.servers />
</@insight.entry>
-
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 ...e/src/main/resources/com/springsource/insight/plugin/gemfire/gemfire_remote_operation.ftl
@@ -11,6 +11,7 @@
<@insight.entry name="Port">
${operation.port?html}
</@insight.entry>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
7 collection-plugins/grails/pom.xml
@@ -25,6 +25,13 @@
<artifactId>grails-web</artifactId>
<version>${grails.version}</version>
<scope>provided</scope>
+ <exclusions>
+ <!-- as of spring 3.2 it is inside the core -->
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
View
1 ...ls/src/main/resources/com/springsource/insight/plugin/grails/grails_controller_method.ftl
@@ -14,4 +14,5 @@
<em>empty</em>
</#if>
</@insight.entry>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
View
6 collection-plugins/hadoop/src/main/resources/com/springsource/insight/plugin/hadoop/job.ftl
@@ -38,4 +38,10 @@
<@insight.entry name="Output Value Class" value=operation.reducerOutValue />
</@insight.group>
+<#if operation.exception??>
+ <@insight.group label="Exception Details">
+ <@insight.entry name="Exception" value=operation.exception/>
+ </@insight.group>
+</#if>
+
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 ...ction-plugins/hadoop/src/main/resources/com/springsource/insight/plugin/hadoop/mapper.ftl
@@ -4,6 +4,7 @@
<@insight.group label="Input">
<@insight.entry name="Key" value=operation.key />
<@insight.entry name="Value" value=operation.value />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
1 ...tion-plugins/hadoop/src/main/resources/com/springsource/insight/plugin/hadoop/reducer.ftl
@@ -6,6 +6,7 @@
<@insight.entry name="Values" if=operation.values?has_content>
<@insight.list type="ordered" collection=operation.values />
</@insight.entry>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
9 ...gins/hibernate/src/main/resources/com/springsource/insight/plugin/hibernate/hibernate.ftl
@@ -2,11 +2,8 @@
<#import "/insight-1.0.ftl" as insight />
<@insight.group label="Hibernate ${operation.method?html} Operation">
- <#if operation.entityCount??>
- <@insight.entry name="Entities managed by current session" value=operation.entityCount />
- </#if>
- <#if operation.collectionCount??>
- <@insight.entry name="Collections managed by current session" value=operation.collectionCount />
- </#if>
+ <@insight.entry name="Entities managed by current session" value=operation.entityCount if=operation.entityCount?? />
+ <@insight.entry name="Collections managed by current session" value=operation.collectionCount if=operation.collectionCount?? />
<@insight.entry name="Flush mode" value=operation.flushMode />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
View
6 ...ns/httpclient3/src/main/resources/com/springsource/insight/plugin/apache/http/hc3/hc3.ftl
@@ -15,3 +15,9 @@
<@insight.group label="Response Headers" if=response.headers?has_content collection=response.headers ; h>
<@insight.entry name=h.name value=h.value required="true" />
</@insight.group>
+
+<#if operation.exception??>
+ <@insight.group label="Exception Details">
+ <@insight.entry name="Exception" value=operation.exception/>
+ </@insight.group>
+</#if>
View
6 ...ns/httpclient4/src/main/resources/com/springsource/insight/plugin/apache/http/hc4/hc4.ftl
@@ -15,3 +15,9 @@
<@insight.group label="Response Headers" if=response.headers?has_content collection=response.headers ; h>
<@insight.entry name=h.name value=h.value required="true" />
</@insight.group>
+
+<#if operation.exception??>
+ <@insight.group label="Exception Details">
+ <@insight.entry name="Exception" value=operation.exception/>
+ </@insight.group>
+</#if>
View
1 ...ection-plugins/jax-rs/src/main/resources/com/springsource/insight/plugin/jaxrs/jax-rs.ftl
@@ -3,6 +3,7 @@
<@insight.group label="REST Call">
<@insight.entry name="REST" value=operation.label />
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
2 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/get.ftl
@@ -4,10 +4,10 @@
<@insight.group label="Details">
<@insight.entry name="Workspace" value=operation.workspace/>
<@insight.entry name="Path" value=operation.path/>
-
<@insight.entry name="Relative Path" value=operation.relPath/>
<@insight.entry name="Absolute Path" value=operation.absPath/>
<@insight.entry name="Name Pattern" value=operation.namePattern/>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
2 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/item.ftl
@@ -5,9 +5,9 @@
<@insight.entry name="Repository" value=operation.repository/>
<@insight.entry name="Workspace" value=operation.workspace/>
<@insight.entry name="Path" value=operation.path/>
-
<@insight.entry name="Source Workspace" value=operation.srcWorkspace/>
<@insight.entry name="Relative Path" value=operation.relPath/>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
2 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/login.ftl
@@ -3,9 +3,9 @@
<@insight.group label="Details">
<@insight.entry name="Workspace" value=operation.workspace/>
-
<@insight.entry name="Username" value=operation.user/>
<@insight.entry name="Password" value=operation.pass/>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
3 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/query.ftl
@@ -3,6 +3,7 @@
<@insight.group label="Details">
<@insight.entry name="Statement" value=operation.statement/>
-</@insight.group>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
+</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
2 collection-plugins/jcr/src/main/resources/com/springsource/insight/plugin/jcr/workspace.ftl
@@ -6,9 +6,9 @@
<@insight.entry name="Destination Absolute Path" value=operation.destAbsPath/>
<@insight.entry name="Source Workspace" value=operation.srcWorkspace/>
<@insight.entry name="Source Absolute Path" value=operation.srcAbsPath/>
-
<@insight.entry name="Overwrite" value=operation.removeExisting/>
<@insight.entry name="Save and Refresh" value=operation.keepChanges/>
+ <@insight.entry name="Exception" value=operation.exception if=operation.exception?? />
</@insight.group>
<@insight.sourceCodeLocation location=operation.sourceCodeLocation />
View
6 ...main/java/com/springsource/insight/plugin/jdbc/JdbcOperationExternalResourceAnalyzer.java
@@ -53,9 +53,7 @@
public static final String APP_KEY_NAME = APP_CS_NAME.getKey() + ".";
- private static final class LazyFieldHolder {
- static final JdbcOperationExternalResourceAnalyzer INSTANCE = new JdbcOperationExternalResourceAnalyzer();
- }
+ private static final JdbcOperationExternalResourceAnalyzer INSTANCE = new JdbcOperationExternalResourceAnalyzer();
private final CollectionSettingsRegistry registry;
private final Collection<ApplicationName> disabledApps;
@@ -97,7 +95,7 @@ private void initListener() {
}
public static final JdbcOperationExternalResourceAnalyzer getInstance() {
- return LazyFieldHolder.INSTANCE;
+ return INSTANCE;
}
@Override
View
2 ...va/com/springsource/insight/plugin/jdbc/JdbcPreparedStatementOperationCollectionAspect.aj
@@ -165,7 +165,7 @@ public aspect JdbcPreparedStatementOperationCollectionAspect
Connection connection = statement.getConnection();
DatabaseMetaData metaData = connection.getMetaData();
- operation.put(OperationFields.CONNECTION_URL, metaData.getURL());
+ operation.putAnyNonEmpty(OperationFields.CONNECTION_URL, metaData.getURL());
} catch(SQLException e) {
// ignore, possibly expected
} catch (Throwable t) {
View
13 .../main/java/com/springsource/insight/plugin/jdbc/JdbcStatementOperationCollectionAspect.aj
@@ -25,6 +25,8 @@ import org.aspectj.lang.JoinPoint;
import com.springsource.insight.collection.AbstractOperationCollectionAspect;
import com.springsource.insight.intercept.operation.Operation;
import com.springsource.insight.intercept.operation.OperationFields;
+import com.springsource.insight.util.ArrayUtil;
+import com.springsource.insight.util.StringUtil;
public aspect JdbcStatementOperationCollectionAspect extends AbstractOperationCollectionAspect {
public JdbcStatementOperationCollectionAspect () {
@@ -44,16 +46,19 @@ public aspect JdbcStatementOperationCollectionAspect extends AbstractOperationCo
@Override
protected Operation createOperation(JoinPoint jp) {
- Operation operation = new Operation()
+ Object[] args=jp.getArgs();