Author: heiko.braun(a)jboss.com
Date: 2008-06-30 05:52:26 -0400 (Mon, 30 Jun 2008)
New Revision: 83
Added:
sam/trunk/SAM.ipr
sam/trunk/SAM.iws
sam/trunk/doc/
sam/trunk/doc/ESPER-NOTES.txt
sam/trunk/pom.xml
sam/trunk/sam-trunk.iml
sam/trunk/src/
sam/trunk/src/main/
sam/trunk/src/main/java/
sam/trunk/src/main/java/org/
sam/trunk/src/main/java/org/jboss/
sam/trunk/src/main/java/org/jboss/sam/
sam/trunk/src/main/java/org/jboss/sam/EventMessage.java
sam/trunk/src/main/java/org/jboss/sam/EventProcessor.java
sam/trunk/src/main/java/org/jboss/sam/EventProcessorFactory.java
sam/trunk/src/main/java/org/jboss/sam/Statement.java
sam/trunk/src/main/java/org/jboss/sam/StreamInput.java
sam/trunk/src/main/java/org/jboss/sam/StreamInputCallback.java
sam/trunk/src/main/java/org/jboss/sam/StreamOutput.java
sam/trunk/src/main/java/org/jboss/sam/chart/
sam/trunk/src/main/java/org/jboss/sam/chart/Chart.java
sam/trunk/src/main/java/org/jboss/sam/chart/ChartBuilder.java
sam/trunk/src/main/java/org/jboss/sam/chart/ChartMapping.java
sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistry.java
sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistryFactory.java
sam/trunk/src/main/java/org/jboss/sam/chart/ChartMetadata.java
sam/trunk/src/main/java/org/jboss/sam/chart/ChartServer.java
sam/trunk/src/main/java/org/jboss/sam/chart/ChartServerFactory.java
sam/trunk/src/main/java/org/jboss/sam/chart/PropertyMapping.java
sam/trunk/src/main/java/org/jboss/sam/chart/internal/
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/BarChartBuilder.java
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/JFreeChartImpl.java
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/LineChartBuilder.java
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/PieChartBuilder.java
sam/trunk/src/main/java/org/jboss/sam/internal/
sam/trunk/src/main/java/org/jboss/sam/internal/esper/
sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperRuntimeImpl.java
sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperStatement.java
sam/trunk/src/main/java/org/jboss/sam/internal/esper/EventAdapter.java
sam/trunk/src/main/java/org/jboss/sam/internal/esper/StreamOutputAdapter.java
sam/trunk/src/main/java/org/jboss/sam/internal/stream/
sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMDispatcher.java
sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamInput.java
sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamRegistry.java
sam/trunk/src/main/resources/
sam/trunk/src/test/
sam/trunk/src/test/etc/
sam/trunk/src/test/etc/tst.policy
sam/trunk/src/test/java/
sam/trunk/src/test/java/org/
sam/trunk/src/test/java/org/jboss/
sam/trunk/src/test/java/org/jboss/test/
sam/trunk/src/test/java/org/jboss/test/sam/
sam/trunk/src/test/java/org/jboss/test/sam/BufferedStreamOutput.java
sam/trunk/src/test/java/org/jboss/test/sam/InMemoryDatabase.java
sam/trunk/src/test/java/org/jboss/test/sam/JFreeChartViewer.java
sam/trunk/src/test/java/org/jboss/test/sam/MapEventMessage.java
sam/trunk/src/test/java/org/jboss/test/sam/SamTestSetup.java
sam/trunk/src/test/java/org/jboss/test/sam/adapter/
sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/
sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/Alert.java
sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/InVMAdapterTestCase.java
sam/trunk/src/test/java/org/jboss/test/sam/chart/
sam/trunk/src/test/java/org/jboss/test/sam/chart/BarChartRunner.java
sam/trunk/src/test/java/org/jboss/test/sam/chart/LineChartRunner.java
sam/trunk/src/test/java/org/jboss/test/sam/chart/PieChartRunner.java
sam/trunk/src/test/java/org/jboss/test/sam/database/
sam/trunk/src/test/java/org/jboss/test/sam/database/DatabaseTestCase.java
sam/trunk/src/test/java/org/jboss/test/sam/database/Query.java
sam/trunk/src/test/java/org/jboss/test/sam/sim/
sam/trunk/src/test/java/org/jboss/test/sam/sim/EventProcessorEntity.java
sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSink.java
sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSourceEntity.java
sam/trunk/src/test/java/org/jboss/test/sam/sim/SensorEventMessage.java
sam/trunk/src/test/java/org/jboss/test/sam/sim/SimulationMain.java
sam/trunk/src/test/resources/
sam/trunk/src/test/resources/adapter/
sam/trunk/src/test/resources/adapter/invm/
sam/trunk/src/test/resources/adapter/invm/esper-cfg.xml
sam/trunk/src/test/resources/database/
sam/trunk/src/test/resources/database/esper-cfg.xml
sam/trunk/src/test/resources/sim/
sam/trunk/src/test/resources/sim/esper-cfg.xml
sam/trunk/src/test/resources/viz/
sam/trunk/src/test/resources/viz/esper-cfg.xml
Log:
SAM API first cut
Added: sam/trunk/SAM.ipr
===================================================================
--- sam/trunk/SAM.ipr (rev 0)
+++ sam/trunk/SAM.ipr 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4" relativePaths="false">
+ <component name="AntConfiguration">
+ <defaultAnt bundledAnt="true" />
+ </component>
+ <component name="BuildJarProjectSettings">
+ <option name="BUILD_JARS_ON_MAKE" value="false" />
+ </component>
+ <component name="CodeStyleProjectProfileManger">
+ <option name="PROJECT_PROFILE" />
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+ </component>
+ <component name="CodeStyleSettingsManager">
+ <option name="PER_PROJECT_SETTINGS" />
+ <option name="USE_PER_PROJECT_SETTINGS" value="false" />
+ </component>
+ <component name="CompilerConfiguration">
+ <option name="DEFAULT_COMPILER" value="Javac" />
+ <option name="DEPLOY_AFTER_MAKE" value="0" />
+ <resourceExtensions>
+ <entry name=".+\.(properties|xml|html|dtd|tld)" />
+ <entry name=".+\.(gif|png|jpeg|jpg)" />
+ </resourceExtensions>
+ <wildcardResourcePatterns>
+ <entry name="?*.properties" />
+ <entry name="?*.xml" />
+ <entry name="?*.gif" />
+ <entry name="?*.png" />
+ <entry name="?*.jpeg" />
+ <entry name="?*.jpg" />
+ <entry name="?*.html" />
+ <entry name="?*.dtd" />
+ <entry name="?*.tld" />
+ </wildcardResourcePatterns>
+ </component>
+ <component name="DataSourceManagerImpl" />
+ <component name="DependenciesAnalyzeManager">
+ <option name="myForwardDirection" value="false" />
+ </component>
+ <component name="DependencyValidationManager" />
+ <component name="EclipseCompilerSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="true" />
+ <option name="DEPRECATION" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="EclipseEmbeddedCompilerSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="true" />
+ <option name="DEPRECATION" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="EntryPointsManager">
+ <entry_points />
+ </component>
+ <component name="ExportToHTMLSettings">
+ <option name="PRINT_LINE_NUMBERS" value="false" />
+ <option name="OPEN_IN_BROWSER" value="false" />
+ <option name="OUTPUT_DIRECTORY" />
+ </component>
+ <component name="GUI Designer component loader factory" />
+ <component name="IdProvider"
IDEtalkID="130CB95840D679D1651689A38EB02B70" />
+ <component name="InspectionProjectProfileManager">
+ <option name="PROJECT_PROFILE" value="Project Default" />
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+ <scopes />
+ <profiles>
+ <profile version="1.0" is_locked="false">
+ <option name="myName" value="Project Default" />
+ <option name="myLocal" value="false" />
+ <used_levels>
+ <error>
+ <option name="myName" value="ERROR" />
+ <option name="myVal" value="400" />
+ </error>
+ <warning>
+ <option name="myName" value="WARNING" />
+ <option name="myVal" value="300" />
+ </warning>
+ <information>
+ <option name="myName" value="INFO" />
+ <option name="myVal" value="200" />
+ </information>
+ <server>
+ <option name="myName" value="SERVER PROBLEM" />
+ <option name="myVal" value="100" />
+ </server>
+ </used_levels>
+ </profile>
+ </profiles>
+ </component>
+ <component name="JavacSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="DEPRECATION" value="true" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="JavadocGenerationManager">
+ <option name="OUTPUT_DIRECTORY" />
+ <option name="OPTION_SCOPE" value="protected" />
+ <option name="OPTION_HIERARCHY" value="true" />
+ <option name="OPTION_NAVIGATOR" value="true" />
+ <option name="OPTION_INDEX" value="true" />
+ <option name="OPTION_SEPARATE_INDEX" value="true" />
+ <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_VERSION" value="false"
/>
+ <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true"
/>
+ <option name="OPTION_DEPRECATED_LIST" value="true" />
+ <option name="OTHER_OPTIONS" value="" />
+ <option name="HEAP_SIZE" />
+ <option name="LOCALE" />
+ <option name="OPEN_IN_BROWSER" value="true" />
+ </component>
+ <component name="JikesSettings">
+ <option name="JIKES_PATH" value="" />
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="DEPRECATION" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="IS_EMACS_ERRORS_MODE" value="true" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ </component>
+ <component name="LogConsolePreferences">
+ <option name="FILTER_ERRORS" value="false" />
+ <option name="FILTER_WARNINGS" value="false" />
+ <option name="FILTER_INFO" value="true" />
+ <option name="CUSTOM_FILTER" />
+ </component>
+ <component name="Maven Reloaded">
+ <option name="config">
+ <value>
+ <option name="pluginEnabled" value="true" />
+ <option name="offlineModeEnabled" value="false" />
+ <option name="updateClasspathsEnabled" value="true" />
+ <option name="sortDependenciesEnabled" value="false"
/>
+ <option name="removeDuplicateDependenciesEnabled"
value="false" />
+ <option name="respondToPomChangesEnabled" value="true"
/>
+ <option name="manageSourceRootsEnabled" value="true"
/>
+ <option name="manageModuleInterdependenciesEnabled"
value="false" />
+ <option name="downloadSourcesEnabled" value="false" />
+ <option name="downloadJavadocEnabled" value="false" />
+ <option name="generateSourcesEnabled" value="false" />
+ <option name="settingsPath"
value="/home/hbraun/.m2/settings.xml" />
+ <option name="searchFilter" value="" />
+ <option name="disabledPoms">
+ <value>
+ <collection type="java.util.TreeSet" />
+ </value>
+ </option>
+ <option name="moduleInterDependencies">
+ <value>
+ <map type="java.util.TreeMap">
+ <entry>
+ <value>
+ <collection type="java.util.TreeSet">
+ <entry type="java.lang.String"
value="esper-2.1.0-src" />
+ </collection>
+ </value>
+ <key type="java.lang.String" value="sam-trunk"
/>
+ </entry>
+ </map>
+ </value>
+ </option>
+ <option name="logLevel" value="1" />
+ </value>
+ </option>
+ </component>
+ <component name="Palette2">
+ <group name="Swing">
+ <item class="com.intellij.uiDesigner.HSpacer"
tooltip-text="Horizontal Spacer"
icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="1" hsize-policy="6"
anchor="0" fill="1" />
+ </item>
+ <item class="com.intellij.uiDesigner.VSpacer"
tooltip-text="Vertical Spacer"
icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="1"
anchor="0" fill="2" />
+ </item>
+ <item class="javax.swing.JPanel"
icon="/com/intellij/uiDesigner/icons/panel.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3"
anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JScrollPane"
icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false"
auto-create-binding="false" can-attach-label="true">
+ <default-constraints vsize-policy="7" hsize-policy="7"
anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JButton"
icon="/com/intellij/uiDesigner/icons/button.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3"
anchor="0" fill="1" />
+ <initial-values>
+ <property name="text" value="Button" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JRadioButton"
icon="/com/intellij/uiDesigner/icons/radioButton.png"
removable="false" auto-create-binding="true"
can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3"
anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="RadioButton" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JCheckBox"
icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3"
anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="CheckBox" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JLabel"
icon="/com/intellij/uiDesigner/icons/label.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0"
anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="Label" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JTextField"
icon="/com/intellij/uiDesigner/icons/textField.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JPasswordField"
icon="/com/intellij/uiDesigner/icons/passwordField.png"
removable="false" auto-create-binding="true"
can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JFormattedTextField"
icon="/com/intellij/uiDesigner/icons/formattedTextField.png"
removable="false" auto-create-binding="true"
can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextArea"
icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextPane"
icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JEditorPane"
icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JComboBox"
icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="2"
anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JTable"
icon="/com/intellij/uiDesigner/icons/table.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JList"
icon="/com/intellij/uiDesigner/icons/list.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="2"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTree"
icon="/com/intellij/uiDesigner/icons/tree.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTabbedPane"
icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3"
anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSplitPane"
icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3"
anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSpinner"
icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSlider"
icon="/com/intellij/uiDesigner/icons/slider.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSeparator"
icon="/com/intellij/uiDesigner/icons/separator.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JProgressBar"
icon="/com/intellij/uiDesigner/icons/progressbar.png"
removable="false" auto-create-binding="true"
can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JToolBar"
icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="0" fill="1">
+ <preferred-size width="-1" height="20" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JToolBar$Separator"
icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png"
removable="false" auto-create-binding="false"
can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0"
anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JScrollBar"
icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="0"
anchor="0" fill="2" />
+ </item>
+ </group>
+ </component>
+ <component name="ProjectModuleManager">
+ <modules>
+ <module
fileurl="file:///home/hbraun/dev/prj/esper-2.1.0-src/trunk/esper/esper-2.1.0-src.iml"
filepath="/home/hbraun/dev/prj/esper-2.1.0-src/trunk/esper/esper-2.1.0-src.iml"
/>
+ <module
fileurl="file:///home/hbraun/dev/env/JavaSim/core/javasim-core.iml"
filepath="/home/hbraun/dev/env/JavaSim/core/javasim-core.iml"
group="javasim" />
+ <module
fileurl="file:///home/hbraun/dev/env/JavaSim/samples/javasim-samples.iml"
filepath="/home/hbraun/dev/env/JavaSim/samples/javasim-samples.iml"
group="javasim" />
+ <module fileurl="file://$PROJECT_DIR$/sam-trunk.iml"
filepath="$PROJECT_DIR$/sam-trunk.iml" />
+ </modules>
+ </component>
+ <component name="ProjectRootManager" version="2"
assert-keyword="true" jdk-15="true" project-jdk-name="1.5"
project-jdk-type="JavaSDK">
+ <output url="file://$PROJECT_DIR$/classes" />
+ </component>
+ <component name="ProjectRunConfigurationManager" />
+ <component name="RmicSettings">
+ <option name="IS_EANABLED" value="false" />
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="GENERATE_IIOP_STUBS" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ </component>
+ <component name="StarteamVcsAdapter" />
+ <component name="VssVcs" />
+ <component name="com.intellij.jsf.UserDefinedFacesConfigs">
+ <option name="USER_DEFINED_CONFIGS">
+ <value>
+ <list size="0" />
+ </value>
+ </option>
+ </component>
+ <component name="libraryTable" />
+ <component name="uidesigner-configuration">
+ <option name="INSTRUMENT_CLASSES" value="true" />
+ <option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true"
/>
+ <option name="DEFAULT_LAYOUT_MANAGER"
value="GridLayoutManager" />
+ </component>
+ <UsedPathMacros />
+</project>
+
Added: sam/trunk/SAM.iws
===================================================================
--- sam/trunk/SAM.iws (rev 0)
+++ sam/trunk/SAM.iws 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,888 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4" relativePaths="false">
+ <component name="BookmarkManager" />
+ <component name="ChangeBrowserSettings">
+ <option name="MAIN_SPLITTER_PROPORTION" value="0.3" />
+ <option name="MESSAGES_SPLITTER_PROPORTION" value="0.8" />
+ <option name="USE_DATE_BEFORE_FILTER" value="false" />
+ <option name="USE_DATE_AFTER_FILTER" value="false" />
+ <option name="USE_CHANGE_BEFORE_FILTER" value="false" />
+ <option name="USE_CHANGE_AFTER_FILTER" value="false" />
+ <option name="DATE_BEFORE" value="" />
+ <option name="DATE_AFTER" value="" />
+ <option name="CHANGE_BEFORE" value="" />
+ <option name="CHANGE_AFTER" value="" />
+ <option name="USE_USER_FILTER" value="false" />
+ <option name="USER" value="" />
+ </component>
+ <component name="ChangeListManager">
+ <list default="true" name="Default" comment=""
/>
+ </component>
+ <component name="ChangeListSynchronizer" />
+ <component name="ChangesViewManager" flattened_view="true"
/>
+ <component name="CheckinPanelState" />
+ <component name="Commander">
+ <leftPanel />
+ <rightPanel />
+ <splitter proportion="0.5" />
+ </component>
+ <component name="CompilerWorkspaceConfiguration">
+ <option name="COMPILE_IN_BACKGROUND" value="false" />
+ <option name="AUTO_SHOW_ERRORS_IN_EDITOR" value="true" />
+ <option name="CLOSE_MESSAGE_VIEW_IF_SUCCESS" value="true"
/>
+ <option name="COMPILE_DEPENDENT_FILES" value="false" />
+ <option name="CLEAR_OUTPUT_DIRECTORY" value="false" />
+ <option name="ASSERT_NOT_NULL" value="true" />
+ </component>
+ <component name="CoverageDataManager" />
+ <component name="Cvs2Configuration">
+ <option name="PRUNE_EMPTY_DIRECTORIES" value="true" />
+ <option name="MERGING_MODE" value="0" />
+ <option name="MERGE_WITH_BRANCH1_NAME" value="HEAD" />
+ <option name="MERGE_WITH_BRANCH2_NAME" value="HEAD" />
+ <option name="RESET_STICKY" value="false" />
+ <option name="CREATE_NEW_DIRECTORIES" value="true" />
+ <option name="DEFAULT_TEXT_FILE_SUBSTITUTION" value="kv"
/>
+ <option name="PROCESS_UNKNOWN_FILES" value="false" />
+ <option name="PROCESS_DELETED_FILES" value="false" />
+ <option name="PROCESS_IGNORED_FILES" value="false" />
+ <option name="RESERVED_EDIT" value="false" />
+ <option name="CHECKOUT_DATE_OR_REVISION_SETTINGS">
+ <value>
+ <option name="BRANCH" value="" />
+ <option name="DATE" value="" />
+ <option name="USE_BRANCH" value="false" />
+ <option name="USE_DATE" value="false" />
+ </value>
+ </option>
+ <option name="UPDATE_DATE_OR_REVISION_SETTINGS">
+ <value>
+ <option name="BRANCH" value="" />
+ <option name="DATE" value="" />
+ <option name="USE_BRANCH" value="false" />
+ <option name="USE_DATE" value="false" />
+ </value>
+ </option>
+ <option name="SHOW_CHANGES_REVISION_SETTINGS">
+ <value>
+ <option name="BRANCH" value="" />
+ <option name="DATE" value="" />
+ <option name="USE_BRANCH" value="false" />
+ <option name="USE_DATE" value="false" />
+ </value>
+ </option>
+ <option name="SHOW_OUTPUT" value="false" />
+ <option name="ADD_WATCH_INDEX" value="0" />
+ <option name="REMOVE_WATCH_INDEX" value="0" />
+ <option name="UPDATE_KEYWORD_SUBSTITUTION" />
+ <option name="MAKE_NEW_FILES_READONLY" value="false" />
+ <option name="SHOW_CORRUPTED_PROJECT_FILES" value="0" />
+ <option name="TAG_AFTER_PROJECT_COMMIT" value="false" />
+ <option name="OVERRIDE_EXISTING_TAG_FOR_PROJECT" value="true"
/>
+ <option name="TAG_AFTER_PROJECT_COMMIT_NAME" value="" />
+ <option name="CLEAN_COPY" value="false" />
+ </component>
+ <component name="DaemonCodeAnalyzer">
+ <disable_hints />
+ </component>
+ <component name="DebuggerManager">
+ <line_breakpoints>
+ <breakpoint
url="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/internal/esper/StreamOutputAdapter.java"
line="50" class="org.jboss.sam.internal.esper.StreamOutputAdapter"
package="org.jboss.sam.internal.esper">
+ <option name="ENABLED" value="true" />
+ <option name="SUSPEND_POLICY" value="SuspendAll" />
+ <option name="LOG_ENABLED" value="false" />
+ <option name="LOG_EXPRESSION_ENABLED" value="false" />
+ <option name="COUNT_FILTER_ENABLED" value="false" />
+ <option name="COUNT_FILTER" value="0" />
+ <option name="CONDITION_ENABLED" value="false" />
+ <option name="CLASS_FILTERS_ENABLED" value="false" />
+ <option name="INSTANCE_FILTERS_ENABLED" value="false"
/>
+ <option name="CONDITION" value="" />
+ <option name="LOG_MESSAGE" value="" />
+ </breakpoint>
+ </line_breakpoints>
+ <breakpoint_any>
+ <breakpoint>
+ <option name="NOTIFY_CAUGHT" value="true" />
+ <option name="NOTIFY_UNCAUGHT" value="true" />
+ <option name="ENABLED" value="false" />
+ <option name="SUSPEND_POLICY" value="SuspendAll" />
+ <option name="LOG_ENABLED" value="false" />
+ <option name="LOG_EXPRESSION_ENABLED" value="false" />
+ <option name="COUNT_FILTER_ENABLED" value="false" />
+ <option name="COUNT_FILTER" value="0" />
+ <option name="CONDITION_ENABLED" value="false" />
+ <option name="CLASS_FILTERS_ENABLED" value="false" />
+ <option name="INSTANCE_FILTERS_ENABLED" value="false"
/>
+ <option name="CONDITION" value="" />
+ <option name="LOG_MESSAGE" value="" />
+ </breakpoint>
+ <breakpoint>
+ <option name="NOTIFY_CAUGHT" value="true" />
+ <option name="NOTIFY_UNCAUGHT" value="true" />
+ <option name="ENABLED" value="false" />
+ <option name="SUSPEND_POLICY" value="SuspendAll" />
+ <option name="LOG_ENABLED" value="false" />
+ <option name="LOG_EXPRESSION_ENABLED" value="false" />
+ <option name="COUNT_FILTER_ENABLED" value="false" />
+ <option name="COUNT_FILTER" value="0" />
+ <option name="CONDITION_ENABLED" value="false" />
+ <option name="CLASS_FILTERS_ENABLED" value="false" />
+ <option name="INSTANCE_FILTERS_ENABLED" value="false"
/>
+ <option name="CONDITION" value="" />
+ <option name="LOG_MESSAGE" value="" />
+ </breakpoint>
+ </breakpoint_any>
+ <breakpoint_rules />
+ <ui_properties>
+ <property name="line_breakpoints_groupByMethods"
value="false" />
+ <property name="line_breakpoints_viewId" value="TABLE"
/>
+ <property name="exception_breakpoints_flattenPackages"
value="true" />
+ <property name="method_breakpoints_flattenPackages"
value="true" />
+ <property name="field_breakpoints_flattenPackages"
value="true" />
+ <property name="exception_breakpoints_groupByMethods"
value="false" />
+ <property name="line_breakpoints_groupByClasses"
value="true" />
+ <property name="method_breakpoints_viewId" value="TABLE"
/>
+ <property name="field_breakpoints_groupByMethods"
value="false" />
+ <property name="line_breakpoints_flattenPackages"
value="true" />
+ <property name="field_breakpoints_groupByClasses"
value="true" />
+ <property name="method_breakpoints_groupByClasses"
value="true" />
+ <property name="exception_breakpoints_viewId" value="TABLE"
/>
+ <property name="exception_breakpoints_groupByClasses"
value="true" />
+ <property name="field_breakpoints_viewId" value="TABLE"
/>
+ <property name="method_breakpoints_groupByMethods"
value="false" />
+ </ui_properties>
+ </component>
+ <component name="ErrorTreeViewConfiguration">
+ <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
+ <option name="HIDE_WARNINGS" value="false" />
+ </component>
+ <component name="FavoritesManager">
+ <favorites_list name="SAM" />
+ </component>
+ <component name="FavoritesProjectViewPane">
+ <subPane subId="SAM">
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" />
+ <option name="myItemType"
value="com.intellij.ide.favoritesTreeView.FavoritesTreeNodeDescriptor" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </component>
+ <component name="FileEditorManager">
+ <leaf>
+ <file leaf-file-name="SimulationMain.java" pinned="false"
current="false" current-in-tab="false">
+ <entry
file="file://$PROJECT_DIR$/src/test/java/org/jboss/test/sam/sim/SimulationMain.java">
+ <provider selected="true"
editor-type-id="text-editor">
+ <state line="30" column="13"
selection-start="1274" selection-end="1274"
vertical-scroll-proportion="0.1794569">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="EventProcessorEntity.java"
pinned="false" current="false" current-in-tab="false">
+ <entry
file="file://$PROJECT_DIR$/src/test/java/org/jboss/test/sam/sim/EventProcessorEntity.java">
+ <provider selected="true"
editor-type-id="text-editor">
+ <state line="37" column="13"
selection-start="1593" selection-end="1593"
vertical-scroll-proportion="-0.022432113">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="EventSink.java" pinned="false"
current="true" current-in-tab="true">
+ <entry
file="file://$PROJECT_DIR$/src/test/java/org/jboss/test/sam/sim/EventSink.java">
+ <provider selected="true"
editor-type-id="text-editor">
+ <state line="38" column="13"
selection-start="1528" selection-end="1528"
vertical-scroll-proportion="-0.5608028">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ </leaf>
+ </component>
+ <component name="FindManager">
+ <FindUsagesManager>
+ <setting name="OPEN_NEW_TAB" value="false" />
+ </FindUsagesManager>
+ </component>
+ <component name="HierarchyBrowserManager">
+ <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
+ <option name="SORT_ALPHABETICALLY" value="false" />
+ <option name="HIDE_CLASSES_WHERE_METHOD_NOT_IMPLEMENTED"
value="false" />
+ </component>
+ <component name="InspectionManager">
+ <option name="AUTOSCROLL_TO_SOURCE" value="false" />
+ <option name="SPLITTER_PROPORTION" value="0.5" />
+ <option name="GROUP_BY_SEVERITY" value="false" />
+ <option name="FILTER_RESOLVED_ITEMS" value="true" />
+ <option name="ANALYZE_TEST_SOURCES" value="true" />
+ <option name="SHOW_DIFF_WITH_PREVIOUS_RUN" value="false"
/>
+ <option name="SCOPE_TYPE" value="1" />
+ <option name="CUSTOM_SCOPE_NAME" value="" />
+ <option name="SHOW_ONLY_DIFF" value="false" />
+ <option name="myCurrentProfileName" value="Default" />
+ </component>
+ <component name="J2EEProjectPane" />
+ <component name="JspContextManager" />
+ <component name="ModuleEditorState">
+ <option name="LAST_EDITED_MODULE_NAME" />
+ <option name="LAST_EDITED_TAB_NAME" />
+ </component>
+ <component name="NamedScopeManager" />
+ <component name="PackagesPane">
+ <subPane>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="SAM.ipr" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </component>
+ <component name="PerforceChangeBrowserSettings">
+ <option name="USE_CLIENT_FILTER" value="true" />
+ <option name="CLIENT" value="" />
+ </component>
+ <component name="PerforceDirect.Settings">
+ <option name="useP4CONFIG" value="true" />
+ <option name="port"
value="<perforce_server>:1666" />
+ <option name="client" value="" />
+ <option name="user" value="" />
+ <option name="passwd" value="" />
+ <option name="showCmds" value="false" />
+ <option name="useNativeApi" value="false" />
+ <option name="pathToExec" value="p4" />
+ <option name="useCustomPathToExec" value="false" />
+ <option name="SYNC_FORCE" value="false" />
+ <option name="SYNC_RUN_RESOLVE" value="true" />
+ <option name="REVERT_UNCHANGED_FILES" value="true" />
+ <option name="CHARSET" value="none" />
+ <option name="SHOW_BRANCHES_HISTORY" value="true" />
+ <option name="ENABLED" value="true" />
+ <option name="USE_LOGIN" value="false" />
+ <option name="LOGIN_SILENTLY" value="false" />
+ <option name="INTEGRATE_RUN_RESOLVE" value="true" />
+ <option name="INTEGRATE_REVERT_UNCHANGED" value="true" />
+ <option name="SERVER_TIMEOUT" value="20000" />
+ </component>
+ <component name="ProjectLevelVcsManager">
+ <OptionsSetting value="true" id="Add" />
+ <OptionsSetting value="true" id="Remove" />
+ <OptionsSetting value="true" id="Checkin" />
+ <OptionsSetting value="true" id="Checkout" />
+ <OptionsSetting value="true" id="Update" />
+ <OptionsSetting value="true" id="Status" />
+ <OptionsSetting value="true" id="Edit" />
+ <OptionsSetting value="true" id="Undo Check Out" />
+ <OptionsSetting value="true" id="Compare with SourceSafe
Version" />
+ <OptionsSetting value="true" id="Get Latest Version" />
+ <ConfirmationsSetting value="0" id="Add" />
+ <ConfirmationsSetting value="0" id="Remove" />
+ </component>
+ <component name="ProjectPane">
+ <subPane>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="SAM.ipr" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sam-trunk" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="SAM.ipr" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sam-trunk" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="SAM.ipr" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sam-trunk" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/test" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="SAM.ipr" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sam-trunk" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/test" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/test/java" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/test/java/org/jboss/test/sam" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="SAM.ipr" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sam-trunk" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/test" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/test/java" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/test/java/org/jboss/test/sam" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/test/java/org/jboss/test/sam/sim" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="SAM.ipr" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sam-trunk" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/main" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="SAM.ipr" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sam-trunk" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/main" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/main/java" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/src/main/java/org/jboss/sam" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="SAM.ipr" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </component>
+ <component name="ProjectReloadState">
+ <option name="STATE" value="0" />
+ </component>
+ <component name="ProjectView">
+ <navigator currentView="ProjectPane" proportions="0.16666667"
version="1" splitterProportion="0.5">
+ <flattenPackages />
+ <showMembers />
+ <showModules />
+ <showLibraryContents />
+ <hideEmptyPackages />
+ <abbreviatePackageNames />
+ <showStructure Favorites="false" PackagesPane="false"
Scope="false" ProjectPane="false" />
+ <autoscrollToSource />
+ <autoscrollFromSource />
+ <sortByType />
+ </navigator>
+ </component>
+ <component name="PropertiesComponent">
+ <property name="GenerateAntBuildDialog.enableUiFormCompile"
value="true" />
+ <property name="GoToFile.includeJavaFiles" value="false"
/>
+ <property name="GoToClass.toSaveIncludeLibraries"
value="false" />
+ <property name="RunManagerConfig.compileBeforeRunning"
value="false" />
+ <property name="RunManagerConfig.showSettingsBeforeRunnig"
value="false" />
+ <property name="GenerateAntBuildDialog.generateSingleFile"
value="false" />
+ <property name="MemberChooser.sorted" value="false" />
+ <property name="MemberChooser.showClasses" value="true" />
+ <property name="GenerateAntBuildDialog.backupFiles"
value="true" />
+ <property name="GenerateAntBuildDialog.forceTargetJdk"
value="true" />
+ <property name="GoToClass.includeLibraries" value="false"
/>
+ <property name="MemberChooser.copyJavadoc" value="false"
/>
+ </component>
+ <component name="ReadonlyStatusHandler">
+ <option name="SHOW_DIALOG" value="true" />
+ </component>
+ <component name="RecentsManager">
+ <key name="IntroduceConstantDialog.RECENTS_KEY">
+ <recent name="" />
+ </key>
+ <key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
+ <recent name="org.jboss.test.sam" />
+ <recent name="org.jboss.sam.chart" />
+ <recent name="org.jboss.sam.chart.internal" />
+ <recent name="org.jboss.sam.chart.internal.jfree" />
+ </key>
+ </component>
+ <component name="RestoreUpdateTree" />
+ <component name="RunManager"
selected="Application.SimulationMain">
+ <configuration default="true" type="Remote"
factoryName="Remote">
+ <option name="USE_SOCKET_TRANSPORT" value="true" />
+ <option name="SERVER_MODE" value="false" />
+ <option name="SHMEM_ADDRESS" value="javadebug" />
+ <option name="HOST" value="localhost" />
+ <option name="PORT" value="5005" />
+ </configuration>
+ <configuration default="true" type="Applet"
factoryName="Applet">
+ <module name="" />
+ <option name="MAIN_CLASS_NAME" />
+ <option name="HTML_FILE_NAME" />
+ <option name="HTML_USED" value="false" />
+ <option name="WIDTH" value="400" />
+ <option name="HEIGHT" value="300" />
+ <option name="POLICY_FILE"
value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
+ <option name="VM_PARAMETERS" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"
/>
+ <option name="ALTERNATIVE_JRE_PATH" />
+ </configuration>
+ <configuration default="true" type="Application"
factoryName="Application" enabled="false" merge="false">
+ <option name="MAIN_CLASS_NAME" />
+ <option name="VM_PARAMETERS" />
+ <option name="PROGRAM_PARAMETERS" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$"
/>
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"
/>
+ <option name="ALTERNATIVE_JRE_PATH" />
+ <option name="ENABLE_SWING_INSPECTOR" value="false" />
+ <module name="" />
+ <method>
+ <option name="Make" value="true" />
+ </method>
+ </configuration>
+ <configuration default="true" type="JUnit"
factoryName="JUnit" enabled="false" merge="false">
+ <module name="" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"
/>
+ <option name="ALTERNATIVE_JRE_PATH" />
+ <option name="PACKAGE_NAME" />
+ <option name="MAIN_CLASS_NAME" />
+ <option name="METHOD_NAME" />
+ <option name="TEST_OBJECT" value="class" />
+ <option name="VM_PARAMETERS" />
+ <option name="PARAMETERS" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$"
/>
+ <option name="ADDITIONAL_CLASS_PATH" />
+ <option name="TEST_SEARCH_SCOPE">
+ <value defaultName="wholeProject" />
+ </option>
+ <method>
+ <option name="Make" value="true" />
+ </method>
+ </configuration>
+ <configuration default="false" name="client"
type="Remote" factoryName="Remote">
+ <option name="USE_SOCKET_TRANSPORT" value="true" />
+ <option name="SERVER_MODE" value="false" />
+ <option name="SHMEM_ADDRESS" value="javadebug" />
+ <option name="HOST" value="localhost" />
+ <option name="PORT" value="5005" />
+ <RunnerSettings RunnerId="Debug">
+ <option name="DEBUG_PORT" value="5005" />
+ <option name="TRANSPORT" value="0" />
+ <option name="LOCAL" value="false" />
+ </RunnerSettings>
+ <ConfigurationWrapper RunnerId="Debug" />
+ <method>
+ <option name="Make" value="true" />
+ </method>
+ </configuration>
+ <configuration default="false" name="SimulationMain"
type="Application" factoryName="Application" enabled="false"
merge="false">
+ <option name="MAIN_CLASS_NAME"
value="org.jboss.test.sam.sim.SimulationMain" />
+ <option name="VM_PARAMETERS" />
+ <option name="PROGRAM_PARAMETERS" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$"
/>
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"
/>
+ <option name="ALTERNATIVE_JRE_PATH" />
+ <option name="ENABLE_SWING_INSPECTOR" value="false" />
+ <module name="sam-trunk" />
+ <RunnerSettings RunnerId="Debug">
+ <option name="DEBUG_PORT" value="53589" />
+ <option name="TRANSPORT" value="0" />
+ <option name="LOCAL" value="true" />
+ </RunnerSettings>
+ <RunnerSettings RunnerId="Run" />
+ <ConfigurationWrapper RunnerId="Debug" />
+ <ConfigurationWrapper RunnerId="Run" />
+ <method>
+ <option name="Make" value="true" />
+ </method>
+ </configuration>
+ <configuration name="<template>" type="WebApp"
default="true" selected="false">
+ <Host>localhost</Host>
+ <Port>5050</Port>
+ </configuration>
+ </component>
+ <component name="ScopeViewComponent">
+ <subPane subId="Project">
+ <PATH>
+ <PATH_ELEMENT USER_OBJECT="Root">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </component>
+ <component name="SelectInManager" />
+ <component name="StarteamConfiguration">
+ <option name="SERVER" value="" />
+ <option name="PORT" value="49201" />
+ <option name="USER" value="" />
+ <option name="PASSWORD" value="" />
+ <option name="PROJECT" value="" />
+ <option name="VIEW" value="" />
+ <option name="ALTERNATIVE_WORKING_PATH" value="" />
+ <option name="LOCK_ON_CHECKOUT" value="false" />
+ <option name="UNLOCK_ON_CHECKIN" value="false" />
+ </component>
+ <component name="StructuralSearchPlugin" />
+ <component name="StructureViewFactory">
+ <option name="AUTOSCROLL_MODE" value="true" />
+ <option name="AUTOSCROLL_FROM_SOURCE" value="false" />
+ <option name="ACTIVE_ACTIONS" value="SHOW_INTERFACES" />
+ </component>
+ <component name="Struts Assistant">
+ <option name="showInputs" value="true" />
+ <option name="resources">
+ <value>
+ <option name="strutsPath" />
+ <option name="strutsHelp" />
+ </value>
+ </option>
+ <option name="selectedTaglibs" />
+ <option name="selectedTaglibs" />
+ <option name="myStrutsValidationEnabled" value="true" />
+ <option name="myTilesValidationEnabled" value="true" />
+ <option name="myValidatorValidationEnabled" value="true"
/>
+ <option name="myReportErrorsAsWarnings" value="true" />
+ </component>
+ <component name="SvnChangesBrowserSettings">
+ <option name="USE_AUTHOR_FIELD" value="true" />
+ <option name="AUTHOR" value="" />
+ <option name="LOCATION" value="" />
+ <option name="USE_PROJECT_SETTINGS" value="true" />
+ <option name="USE_ALTERNATE_LOCATION" value="false" />
+ </component>
+ <component name="SvnConfiguration">
+ <option name="USER" value="" />
+ <option name="PASSWORD" value="" />
+ <option name="PROCESS_UNRESOLVED" value="false" />
+ <option name="LAST_MERGED_REVISION" />
+ <option name="UPDATE_RUN_STATUS" value="false" />
+ <option name="UPDATE_RECURSIVELY" value="true" />
+ <option name="MERGE_DRY_RUN" value="false" />
+ <configuration
useDefault="true">/home/hbraun/.subversion</configuration>
+ </component>
+ <component name="TodoView" selected-index="0">
+ <todo-panel id="selected-file">
+ <are-packages-shown value="false" />
+ <are-modules-shown value="false" />
+ <flatten-packages value="false" />
+ <is-autoscroll-to-source value="true" />
+ </todo-panel>
+ <todo-panel id="all">
+ <are-packages-shown value="true" />
+ <are-modules-shown value="false" />
+ <flatten-packages value="false" />
+ <is-autoscroll-to-source value="true" />
+ </todo-panel>
+ </component>
+ <component name="ToolWindowManager">
+ <frame x="-3" y="25" width="1686"
height="1003" extended-state="6" />
+ <editor active="true" />
+ <layout>
+ <window_info id="UI Designer" active="false"
anchor="left" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="Changes" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="Palette" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="Ant Build" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.25"
order="1" />
+ <window_info id="Find" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.32915717"
order="1" />
+ <window_info id="Debug" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.39863327"
order="3" />
+ <window_info id="IDEtalk Messages" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="IDEtalk" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="Version Control" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="Messages" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.32915717"
order="8" />
+ <window_info id="TODO" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="7" />
+ <window_info id="Maven" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="Structure" active="false"
anchor="left" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.24954017"
order="1" />
+ <window_info id="Commander" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.4"
order="0" />
+ <window_info id="CVS" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="Module Dependencies" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="Dependency Viewer" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="File View" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="Project" active="false"
anchor="left" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="true" weight="0.27774373"
order="0" />
+ <window_info id="Hierarchy" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.15757205"
order="2" />
+ <window_info id="Inspection" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.4"
order="6" />
+ <window_info id="Run" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.47038725"
order="2" />
+ <window_info id="Cvs" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.25"
order="5" />
+ <window_info id="Message" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="0" />
+ <window_info id="Web" active="false" anchor="left"
auto_hide="false" internal_type="DOCKED" type="DOCKED"
visible="false" weight="0.25" order="2" />
+ <window_info id="EJB" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.25"
order="4" />
+ </layout>
+ </component>
+ <component name="VCS.FileViewConfiguration">
+ <option name="SELECTED_STATUSES" value="DEFAULT" />
+ <option name="SELECTED_COLUMNS" value="DEFAULT" />
+ <option name="SHOW_FILTERS" value="true" />
+ <option name="CUSTOMIZE_VIEW" value="true" />
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="true" />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT"
value="true" />
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT"
value="true" />
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="false"
/>
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="false"
/>
+ <option name="PUT_FOCUS_INTO_COMMENT" value="false" />
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
+ <option name="LAST_COMMIT_MESSAGE" />
+ <option name="SAVE_LAST_COMMIT_MESSAGE" value="true" />
+ <option name="CHECKIN_DIALOG_SPLITTER_PROPORTION" value="0.8"
/>
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT"
value="false" />
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false"
/>
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false"
/>
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION"
value="0.8" />
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION"
value="0.5" />
+ <option name="ERROR_OCCURED" value="false" />
+ <option name="ACTIVE_VCS_NAME" />
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6"
/>
+ </component>
+ <component name="VssConfiguration">
+ <option name="CLIENT_PATH" value="" />
+ <option name="SRCSAFEINI_PATH" value="" />
+ <option name="USER_NAME" value="" />
+ <option name="PWD" value="" />
+ <option name="VSS_IS_INITIALIZED" value="true" />
+ <CheckoutOptions>
+ <option name="COMMENT" value="" />
+ <option name="DO_NOT_GET_LATEST_VERSION" value="false"
/>
+ <option name="REPLACE_WRITABLE" value="false" />
+ <option name="RECURSIVE" value="false" />
+ </CheckoutOptions>
+ <CheckinOptions>
+ <option name="COMMENT" value="" />
+ <option name="KEEP_CHECKED_OUT" value="false" />
+ <option name="RECURSIVE" value="false" />
+ </CheckinOptions>
+ <AddOptions>
+ <option name="STORE_ONLY_LATEST_VERSION" value="false"
/>
+ <option name="CHECK_OUT_IMMEDIATELY" value="false" />
+ <option name="FILE_TYPE" value="0" />
+ </AddOptions>
+ <UndocheckoutOptions>
+ <option name="MAKE_WRITABLE" value="false" />
+ <option name="REPLACE_LOCAL_COPY" value="0" />
+ <option name="RECURSIVE" value="false" />
+ </UndocheckoutOptions>
+ <GetOptions>
+ <option name="REPLACE_WRITABLE" value="0" />
+ <option name="MAKE_WRITABLE" value="false" />
+ <option name="ANSWER_NEGATIVELY" value="false" />
+ <option name="ANSWER_POSITIVELY" value="false" />
+ <option name="RECURSIVE" value="false" />
+ <option name="VERSION" />
+ </GetOptions>
+ <VssConfigurableExcludedFilesTag />
+ </component>
+ <component name="antWorkspaceConfiguration">
+ <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
+ <option name="FILTER_TARGETS" value="false" />
+ </component>
+ <component
name="com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable"
proportions="" version="1">
+ <option name="myLastEditedConfigurable" />
+ </component>
+ <component
name="com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectRootMasterDetailsConfigurable"
proportions="0.16666667" version="1">
+ <option name="myPlainMode" value="false" />
+ <option name="myLastEditedConfigurable"
value="javasim-samples" />
+ </component>
+ <component name="com.intellij.profile.ui.ErrorOptionsConfigurable"
proportions="" version="1">
+ <option name="myLastEditedConfigurable" />
+ </component>
+ <component name="editorHistoryManager">
+ <entry
file="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/chart/ChartMapping.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="97" column="4"
selection-start="3212" selection-end="3212"
vertical-scroll-proportion="1.4571773">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/chart/ChartMappingRegistry.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="36" column="0"
selection-start="1357" selection-end="1357"
vertical-scroll-proportion="0.36670688">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/chart/ChartMappingRegistryFactory.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="26" column="22"
selection-start="1139" selection-end="1139"
vertical-scroll-proportion="0.13751508">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/chart/ChartMetadata.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="30" column="17"
selection-start="1253" selection-end="1253"
vertical-scroll-proportion="0.2291918">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/chart/ChartServer.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="30" column="17"
selection-start="1260" selection-end="1260"
vertical-scroll-proportion="0.2291918">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/chart/ChartServerFactory.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="26" column="22"
selection-start="1139" selection-end="1139"
vertical-scroll-proportion="0.13751508">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/chart/PropertyMapping.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="36" column="19"
selection-start="1386" selection-end="1386"
vertical-scroll-proportion="-0.39806998">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/Statement.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="31" column="17"
selection-start="1394" selection-end="1394"
vertical-scroll-proportion="0.24675325">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/test/java/org/jboss/test/sam/sim/EventSourceEntity.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="34" column="13"
selection-start="1418" selection-end="1418"
vertical-scroll-proportion="0.1794569">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/test/java/org/jboss/test/sam/sim/SensorEventMessage.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="26" column="13"
selection-start="1133" selection-end="1133"
vertical-scroll-proportion="0.13459268">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/pom.xml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="26" column="65"
selection-start="1109" selection-end="1109"
vertical-scroll-proportion="-4.594952">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/main/java/org/jboss/sam/StreamInputCallback.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="28" column="17"
selection-start="1218" selection-end="1218"
vertical-scroll-proportion="0.1794569">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/test/java/org/jboss/test/sam/sim/SimulationMain.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="30" column="13"
selection-start="1274" selection-end="1274"
vertical-scroll-proportion="0.1794569">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/test/java/org/jboss/test/sam/sim/EventProcessorEntity.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="37" column="13"
selection-start="1593" selection-end="1593"
vertical-scroll-proportion="-0.022432113">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/src/test/java/org/jboss/test/sam/sim/EventSink.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="38" column="13"
selection-start="1528" selection-end="1528"
vertical-scroll-proportion="-0.5608028">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </component>
+</project>
+
Added: sam/trunk/doc/ESPER-NOTES.txt
===================================================================
--- sam/trunk/doc/ESPER-NOTES.txt (rev 0)
+++ sam/trunk/doc/ESPER-NOTES.txt 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,2 @@
+- Event beans require std. java property access. public fields wouldnt do
+- HSQL database requires <column-change-case value="lowercase"/>
\ No newline at end of file
Property changes on: sam/trunk/doc/ESPER-NOTES.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/pom.xml
===================================================================
--- sam/trunk/pom.xml (rev 0)
+++ sam/trunk/pom.xml 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,265 @@
+<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>
+
+ <name>SAM (Esper impl.)</name>
+ <groupId>org.jboss.sam</groupId>
+ <artifactId>sam-esper</artifactId>
+ <packaging>jar</packaging>
+
+ <version>1.0.0.SNAPSHOT</version>
+
+ <!-- Properties -->
+ <properties>
+
+ <surefire.security.args>-Djava.security.manager
-Djava.security.policy=src/test/etc/tst.policy</surefire.security.args>
+ <surefire.jdwp.args>-Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</surefire.jdwp.args>
+
+ <esper.version>2.1.0</esper.version>
+ <junit.version>3.8.2</junit.version>
+ <commons-logging.version>1.1</commons-logging.version>
+ <antlr.version>3.0.1</antlr.version>
+ <jfree.version>1.0.0</jfree.version>
+ <hsqldb.version>1.8.0.7</hsqldb.version>
+ <javasim.version>1.0</javasim.version>
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>esper</groupId>
+ <artifactId>esper</artifactId>
+ <version>${esper.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-api</artifactId>
+ <version>${commons-logging.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr-runtime</artifactId>
+ <version>${antlr.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>jfree</groupId>
+ <artifactId>jfreechart</artifactId>
+ <version>${jfree.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>${hsqldb.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javasim</groupId>
+ <artifactId>javasim-core</artifactId>
+ <version>${javasim.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <!-- Plugins -->
+ <build>
+ <resources>
+ <resource>
+ <targetPath>../etc</targetPath>
+ <directory>src/main/etc</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <!--plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>install</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="version.id"
value="${project.version}"/>
+ <property name="jboss.local.repository"
value="${jboss.local.repository}"/>
+ <ant antfile="src/main/ant/build-install.xml"
target="install"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins-->
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${surefire.jvm.args}</argLine>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ <!-- PluginManagement -->
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2.SP1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.1</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <profiles>
+ <!-- Name: debug
+ Descr: Enable remote debuging for tests
+ -->
+ <profile>
+ <id>debug</id>
+ <activation>
+ <property>
+ <name>debug</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jvm.args>${surefire.security.args}
${surefire.jdwp.args}</surefire.jvm.args>
+ </properties>
+ </profile>
+ <profile>
+ <id>no-debug</id>
+ <activation>
+ <property>
+ <name>!debug</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jvm.args>${surefire.security.args}</surefire.jvm.args>
+ </properties>
+ </profile>
+
+ </profiles>
+
+ <!-- Repositories -->
+ <repositories>
+ <repository>
+ <id>maven2.java.net</id>
+ <
name>Java.net Repository for Maven 2</name>
+ <
url>http://download.java.net/maven/2/</url>
+ </repository>
+ <repository>
+ <id>java.net</id>
+ <
url>http://download.java.net/maven/1/</url>
+ <layout>legacy</layout>
+ </repository>
+ <repository>
+ <id>repository.jboss.org</id>
+ <
url>http://repository.jboss.org/maven2</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <
url>http://snapshots.jboss.org/maven2</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <!-- PluginRepositories -->
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <
url>http://repository.jboss.org/maven2</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ <pluginRepository>
+ <id>snapshots.jboss.org</id>
+ <
url>http://snapshots.jboss.org/maven2</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <!-- DistributionManagement -->
+ <distributionManagement>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Maven Repository</name>
+ <url>file://${jboss.maven.repository}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <
url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <quiet>true</quiet>
+ <source>1.5</source>
+ <verbose>false</verbose>
+ <excludePackageNames>*.internal:*.test</excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
Property changes on: sam/trunk/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/sam-trunk.iml
===================================================================
--- sam/trunk/sam-trunk.iml (rev 0)
+++ sam/trunk/sam-trunk.iml 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources"
isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library name="M2 Dep: jfree:jfreechart:jar:1.0.0:compile">
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../.m2/repository/jfree/jfreechart/1.0.0/jfreechart-1.0.0.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: junit:junit:jar:3.8.2:compile">
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.antlr:antlr-runtime:jar:3.0.1:compile">
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../.m2/repository/org/antlr/antlr-runtime/3.0.1/antlr-runtime-3.0.1.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep:
commons-logging:commons-logging-api:jar:1.1:compile">
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: jfree:jcommon:jar:1.0.0:compile">
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../.m2/repository/jfree/jcommon/1.0.0/jcommon-1.0.0.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep:
org.antlr:stringtemplate:jar:3.1-b1:compile">
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../.m2/repository/org/antlr/stringtemplate/3.1-b1/stringtemplate-3.1-b1.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: esper:esper:jar:2.1.0:compile">
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../.m2/repository/esper/esper/2.1.0/esper-2.1.0.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: hsqldb:hsqldb:jar:1.8.0.7:compile">
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javasim:javasim-core:jar:1.0:compile">
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../.m2/repository/javasim/javasim-core/1.0/javasim-core-1.0.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: sam/trunk/src/main/java/org/jboss/sam/EventMessage.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/EventMessage.java (rev
0)
+++ sam/trunk/src/main/java/org/jboss/sam/EventMessage.java 2008-06-30 09:52:26 UTC (rev
83)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam;
+
+import java.util.Iterator;
+
+/**
+ * SAM's internal event representation.<br>
+ * It consist of a timestamp and associated event properties.
+ * EventMessage's are written to {@link org.jboss.sam.StreamOutput}'s.
+ * <p>
+ * EventMessage's can be mapped to {@link org.jboss.sam.chart.Chart}'s.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface EventMessage<T>
+{
+ /**
+ * Creation timestamp.
+ * @return
+ */
+ long getTimestamp();
+
+ /**
+ * Get an event property by name
+ * @param name
+ * @return
+ */
+ Object getProperty(String name);
+
+ /**
+ * Iterate over event property names
+ * @return
+ */
+ Iterator<String> getPropertyNames();
+
+ /**
+ * Access the underlying implementation
+ * @return
+ */
+ T getUnderlying();
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/EventMessage.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/EventProcessor.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/EventProcessor.java (rev
0)
+++ sam/trunk/src/main/java/org/jboss/sam/EventProcessor.java 2008-06-30 09:52:26 UTC (rev
83)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam;
+
+import java.util.Iterator;
+
+/**
+ * The hub glues together {@link org.jboss.sam.StreamInput} and {@link
org.jboss.sam.StreamOutput}
+ * and provides a way to register {@link org.jboss.sam.Statement}'s,
+ * both bound (event forwarding) and unbound (event aggregation and filtering).
+ * <p>
+ * Instances are created through {@link org.jboss.sam.EventProcessorFactory}
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface EventProcessor<T>
+{
+ /**
+ * Add input to the runtime
+ * @param streamInput
+ */
+ void addInput(StreamInput streamInput);
+
+ /**
+ * Remove input from the runtime
+ * @param streamName
+ */
+ void removeInput(String streamName);
+
+ /**
+ * Add output to the runtime
+ * @param streamOutput
+ */
+ void addOutput(StreamOutput streamOutput);
+
+ /**
+ * Remove output from the runtime
+ * @param streamName
+ */
+ void removeOutput(String streamName);
+
+ /**
+ * Iterate over input stream names
+ * @return
+ */
+ Iterator<String> getInputStreamNames();
+
+ /**
+ * Iterate over output stream names
+ * @return
+ */
+ Iterator<String> getOutputStreamNames();
+
+ /**
+ * Creates a statement
+ *
+ * @param statementName
+ * @param epl
+ * @return
+ */
+ Statement registerStatement(String statementName, String epl);
+
+ /**
+ * Creates a statement and binds it to an output stream.
+ *
+ * @param streamOutputName
+ * @param statementName
+ * @param epl
+ * @return
+ */
+ Statement registerBoundStatement(String streamOutputName, String statementName, String
epl);
+
+ /**
+ * Cleanup a statement and remove it
+ * @param statementName
+ */
+ void clearStatement(String statementName);
+
+ /**
+ * Cleanup all statements and remove them
+ */
+ void clearAllStatements();
+
+ /**
+ * Iterate over statement names
+ * @return
+ */
+ Iterator<String> getStatementNames();
+
+ String getName();
+
+ T getUnderlying();
+
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/EventProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/EventProcessorFactory.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/EventProcessorFactory.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/EventProcessorFactory.java 2008-06-30 09:52:26
UTC (rev 83)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam;
+
+import org.jboss.sam.internal.esper.EsperRuntimeImpl;
+
+import java.net.URL;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public abstract class EventProcessorFactory
+{
+ protected EventProcessorFactory()
+ {
+ }
+
+ public static EventProcessorFactory newInstance()
+ {
+ return new DefaultEventProcessorFactory();
+ }
+
+ public abstract EventProcessor createRuntime(String name, URL config);
+
+ static class DefaultEventProcessorFactory extends EventProcessorFactory
+ {
+
+ public EventProcessor createRuntime(String name, URL config)
+ {
+ return new EsperRuntimeImpl(name, config);
+ }
+ }
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/EventProcessorFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/Statement.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/Statement.java (rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/Statement.java 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam;
+
+/**
+ * Represents an EPL (event processing languge) statement.
+ * Statements are associated with a {@link org.jboss.sam.EventProcessor}
+ * and can be bound to a {@link org.jboss.sam.StreamOutput} to forward events,
+ * or used unbound to aggregate and filter events.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface Statement<T>
+{
+ /**
+ * Statements are managed by name
+ * @return
+ */
+ String getName();
+
+ /**
+ * Bind to a stream output
+ * @param stream
+ */
+ void bindTo(StreamOutput stream);
+
+ /**
+ * Remove a stream output binding
+ * @param name
+ * @return
+ */
+ StreamOutput unbind(String name);
+
+ boolean isBound();
+
+ /**
+ * Access the underlying implementation
+ * @return
+ */
+ T getUnderlying();
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/Statement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/StreamInput.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/StreamInput.java (rev
0)
+++ sam/trunk/src/main/java/org/jboss/sam/StreamInput.java 2008-06-30 09:52:26 UTC (rev
83)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam;
+
+/**
+ * Stream inputs are registered with {@link org.jboss.sam.EventProcessor}'s
+ * and notify registered {@link org.jboss.sam.StreamInputCallback}'s when new events
arrive.
+ * Typically the CEP runtime itself act's as such a listener in order to process
events.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface StreamInput<T>
+{
+ <T extends StreamInput> T start();
+
+ <T extends StreamInput> T stop();
+
+ boolean isStarted();
+
+ /**
+ * Register a callback
+ * @param streamInputCallback an event processing instance
+ */
+ void registerCallback(StreamInputCallback streamInputCallback);
+
+ /**
+ * Remove all registered callbacks
+ */
+ void clearCallbacks();
+
+ /**
+ * Stream input name
+ * @return
+ */
+ String getStreamName();
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/StreamInput.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/StreamInputCallback.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/StreamInputCallback.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/StreamInputCallback.java 2008-06-30 09:52:26 UTC
(rev 83)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam;
+
+/**
+ * Registered with a {@link StreamInput} and will be notified when new events arrive.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface StreamInputCallback
+{
+ void onEvent(Object args);
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/StreamInputCallback.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/StreamOutput.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/StreamOutput.java (rev
0)
+++ sam/trunk/src/main/java/org/jboss/sam/StreamOutput.java 2008-06-30 09:52:26 UTC (rev
83)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam;
+
+/**
+ * Stream outputs are used to forward events. Typically the last step
+ * of an event processing chain leads to an action which receive events through
+ * the <code>write(...)</code> method.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface StreamOutput<T>
+{
+ <T extends StreamOutput> T start();
+
+ <T extends StreamOutput> T stop();
+
+ boolean isStarted();
+
+ /**
+ * Receive forwarded events
+ * @param args an event stream
+ */
+ void write(EventMessage[] args);
+
+ /**
+ * Stream output name
+ * @return
+ */
+ String getStreamName();
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/StreamOutput.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/Chart.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/Chart.java (rev
0)
+++ sam/trunk/src/main/java/org/jboss/sam/chart/Chart.java 2008-06-30 09:52:26 UTC (rev
83)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart;
+
+import java.io.OutputStream;
+
+/**
+ * A chart repesentation.<br>
+ * Can be an in-memory representation or a link to a physical
+ * artifact (caching).
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface Chart<T>
+{
+ String getName();
+
+ void writeTo(OutputStream out);
+
+ T getUnderlying();
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/chart/Chart.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/ChartBuilder.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/ChartBuilder.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/chart/ChartBuilder.java 2008-06-30 09:52:26 UTC
(rev 83)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart;
+
+import org.jboss.sam.EventMessage;
+
+/**
+ * Builds charts from payload and mapping information.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface ChartBuilder
+{
+ ChartMetadata getMetadata();
+
+ Chart buildChart(EventMessage[] events, ChartMapping mapping);
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/chart/ChartBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/ChartMapping.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/ChartMapping.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/chart/ChartMapping.java 2008-06-30 09:52:26 UTC
(rev 83)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart;
+
+import java.util.Collections;
+import java.util.List;
+import java.io.Serializable;
+
+/**
+ * An immutable mapping of index and data values,
+ * that can be passed to a {@link org.jboss.sam.chart.ChartBuilder} to construct
+ * {@link org.jboss.sam.chart.Chart}'s. Each instance is identifed by an alias name
+ * and will be maintained through a {@link ChartMappingRegistry}.
+ * <p>
+ * ChartMappings should be created once and reused.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public final class ChartMapping implements Serializable
+{
+ String aliasName;
+
+ List<PropertyMapping> indexMappings;
+
+ List<PropertyMapping> propertyMappings;
+
+ public ChartMapping(String aliasName, List<PropertyMapping> indexMappings,
List<PropertyMapping> propertyMappings)
+ {
+ this.aliasName = aliasName;
+ this.indexMappings = Collections.unmodifiableList(indexMappings);
+ this.propertyMappings = Collections.unmodifiableList(propertyMappings);
+ }
+
+ String getAliasName()
+ {
+ return this.aliasName;
+ }
+
+ /**
+ * Returns an immutable index mapping for a key.
+ * The key is specified in {@link org.jboss.sam.chart.ChartMetadata}
+ * @return
+ */
+ public PropertyMapping getIndexMapping(String key)
+ {
+ PropertyMapping indexMapping = resolveKey(key, indexMappings);
+ if(null==indexMapping)
+ throw new IllegalArgumentException("Failed to resolved index mapping by
key: "+ key);
+
+ return indexMapping;
+ }
+
+ /**
+ * Returns an immutable data mapping
+ * @return
+ */
+ public PropertyMapping getPropertyMapping(String key)
+ {
+ PropertyMapping dataMapping = resolveKey(key, propertyMappings);
+ if(null==dataMapping)
+ throw new IllegalArgumentException("Failed to resolved data mapping by key:
"+ key);
+
+ return dataMapping;
+ }
+
+ private PropertyMapping resolveKey(String key, List<PropertyMapping> mappings)
+ {
+ PropertyMapping mapping = null;
+ for(PropertyMapping index : mappings)
+ {
+ if(index.getTargetKey().equals(key))
+ {
+ mapping = index;
+ break;
+ }
+ }
+
+ return mapping;
+ }
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/chart/ChartMapping.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistry.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistry.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistry.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart;
+
+/**
+ * Maintains {@link ChartMapping}'s.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface ChartMappingRegistry
+{
+ void registerChartMapping(ChartMapping chartMaping);
+
+ ChartMapping getChartMapping(String aliasName);
+
+ void clearChartMapping(String aliasName);
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistryFactory.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistryFactory.java
(rev 0)
+++
sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistryFactory.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public abstract class ChartMappingRegistryFactory
+{
+ abstract ChartMappingRegistry createChartMappingRegistry();
+
+ public static ChartMappingRegistryFactory newInstance()
+ {
+ return new DefaultChartMappingRegistryFactory();
+ }
+
+ static class DefaultChartMappingRegistryFactory extends ChartMappingRegistryFactory
+ {
+
+ ChartMappingRegistry createChartMappingRegistry()
+ {
+ throw new RuntimeException("Not implemented");
+ }
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/chart/ChartMappingRegistryFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/ChartMetadata.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/ChartMetadata.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/chart/ChartMetadata.java 2008-06-30 09:52:26 UTC
(rev 83)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart;
+
+import java.util.Iterator;
+
+/**
+ * Metadata for chart types associated with a {@link org.jboss.sam.chart.ChartBuilder}
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface ChartMetadata
+{
+ String getTypeName();
+
+ Iterator<String> getSupportedIndexNames();
+
+ Iterator<String> getSupportedPropertyNames();
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/chart/ChartMetadata.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/ChartServer.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/ChartServer.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/chart/ChartServer.java 2008-06-30 09:52:26 UTC
(rev 83)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart;
+
+import org.jboss.sam.EventMessage;
+
+/**
+ * Allows creation and retrieval of {@link org.jboss.sam.chart.Chart} repesenations.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface ChartServer
+{
+ /**
+ * Get chart by name
+ * @param chartName
+ * @return
+ */
+ Chart getChart(String chartName);
+
+ /**
+ * Create a new chart under a given name
+ * @param chartName
+ * @param payloads
+ * @return
+ */
+ Chart createChart(String chartName, EventMessage[] payloads);
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/chart/ChartServer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/ChartServerFactory.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/ChartServerFactory.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/chart/ChartServerFactory.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public abstract class ChartServerFactory
+{
+ abstract ChartServer createChartServer();
+
+ public static ChartServerFactory newInstance()
+ {
+ return new DefaultChartServerFactory();
+ }
+
+ static class DefaultChartServerFactory extends ChartServerFactory
+ {
+ ChartServer createChartServer()
+ {
+ throw new RuntimeException("Not implemented");
+ }
+ }
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/chart/ChartServerFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/PropertyMapping.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/PropertyMapping.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/chart/PropertyMapping.java 2008-06-30 09:52:26
UTC (rev 83)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart;
+
+import org.jboss.sam.EventMessage;
+
+import java.io.Serializable;
+
+/**
+ * Maps {@link org.jboss.sam.EventMessage} properties
+ * to chart attributes, like X-Axis and Y-Axis values.<br>
+ * Supports constants.
+ *
+ * @see org.jboss.sam.chart.ChartMapping
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public final class PropertyMapping implements Serializable
+{
+ /**
+ * The key to which a mapped property will be assigned
+ */
+ private String targetKey;
+
+ /**
+ * Name of the mapped {@link org.jboss.sam.EventMessage} property
+ */
+ private String sourcePropertyName;
+
+ private String constantValue = null;
+
+ public PropertyMapping(String targetKey, String sourcePropertyName)
+ {
+ this.targetKey = targetKey;
+ this.sourcePropertyName = sourcePropertyName;
+ }
+
+ public String getTargetKey()
+ {
+ return targetKey;
+ }
+
+ public PropertyMapping constant(String constant)
+ {
+ this.constantValue = constant.intern();
+ return this;
+ }
+
+ /**
+ * Retrieve an {@link org.jboss.sam.EventMessage} value
+ * by mapping to {@link #sourcePropertyName}
+ * @param payload
+ * @return
+ */
+ public Object map(EventMessage payload)
+ {
+ Object mapping;
+ if(null==constantValue)
+ mapping = payload.getProperty(sourcePropertyName);
+ else
+ mapping = constantValue;
+
+ return mapping;
+ }
+
+
+ public String toString()
+ {
+ String prop = sourcePropertyName != null ? sourcePropertyName :
"CONSTANT";
+ return targetKey +"->"+prop;
+ }
+}
Property changes on: sam/trunk/src/main/java/org/jboss/sam/chart/PropertyMapping.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/BarChartBuilder.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/BarChartBuilder.java
(rev 0)
+++
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/BarChartBuilder.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,169 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart.internal.jfree;
+
+import org.jboss.sam.EventMessage;
+import org.jboss.sam.chart.Chart;
+import org.jboss.sam.chart.ChartBuilder;
+import org.jboss.sam.chart.ChartMapping;
+import org.jboss.sam.chart.ChartMetadata;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.plot.PlotOrientation;
+import org.jfree.data.category.CategoryDataset;
+import org.jfree.data.category.DefaultCategoryDataset;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class BarChartBuilder implements ChartBuilder
+{
+ private String chartTitle;
+ private String domainAxisLabel, rangeAxisLabel;
+
+ public final static String INDEX_1 = "series";
+ public final static String INDEX_2 = "x_value";
+ public final static String PROP_1 = "y_value";
+
+ public static List<String> INDEXES = new ArrayList<String>();
+ public static List<String> PROPS = new ArrayList<String>();
+
+ static
+ {
+ INDEXES.add(INDEX_1);
+ INDEXES.add(INDEX_2);
+
+ PROPS.add(PROP_1);
+ }
+
+ public BarChartBuilder(String chartTitle, String domainAxisLabel, String
rangeAxisLabel)
+ {
+ this.chartTitle = chartTitle;
+ this.domainAxisLabel = domainAxisLabel;
+ this.rangeAxisLabel = rangeAxisLabel;
+ }
+
+ public ChartMetadata getMetadata()
+ {
+ return new ChartMetadata() {
+
+ public String getTypeName()
+ {
+ return "BarChart";
+ }
+
+ public Iterator<String> getSupportedIndexNames()
+ {
+ return INDEXES.iterator();
+ }
+
+ public Iterator<String> getSupportedPropertyNames()
+ {
+ return PROPS.iterator();
+ }
+ };
+ }
+
+ public Chart buildChart(EventMessage[] events, ChartMapping mapping)
+ {
+ CategoryDataset dataset = createDataset(events, mapping);
+
+ JFreeChart chart = org.jfree.chart.ChartFactory.createBarChart(
+ chartTitle, // chart title
+ domainAxisLabel, // domain axis label
+ rangeAxisLabel, // range axis label
+ dataset, // data
+ PlotOrientation.VERTICAL,
+ true, // include legend
+ true, // tooltips?
+ false // URLs?
+ );
+
+ //customize(chart);
+
+ return new JFreeChartImpl(chart);
+ }
+
+ private CategoryDataset createDataset(EventMessage[] payloads, ChartMapping mapping)
+ {
+ DefaultCategoryDataset dataset = new DefaultCategoryDataset();
+
+ for(EventMessage event : payloads)
+ {
+ Number number = (Number) (mapping.getPropertyMapping(PROP_1)).map(event);
+ Comparable c1 = (Comparable) (mapping.getIndexMapping(INDEX_1)).map(event);
+ Comparable c2 = (Comparable) (mapping.getIndexMapping(INDEX_2)).map(event);
+ dataset.addValue(
+ number, // value
+ c1, // seriesName
+ c2 // category
+ );
+ }
+
+ return dataset;
+ }
+
+ /**
+ * Example customization
+ *
+ * @todo Create common look and feel
+ *
+ * @param chart
+ */
+ /*private void customize(JFreeChart chart)
+ {
+ // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
+ // set the background color for the chart...
+ chart.setBackgroundPaint(new Color(0xBBBBDD));
+ // get a reference to the plot for further customisation...
+ CategoryPlot plot = chart.getCategoryPlot();
+ // set the range axis to display integers only...
+ NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
+ rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
+ // disable bar outlines...
+ BarRenderer renderer = (BarRenderer) plot.getRenderer();
+ renderer.setCreateEntities(true);
+
+ // set up gradient paints for series...
+ GradientPaint gp0 = new GradientPaint(
+ 0.0f, 0.0f, Color.blue,
+ 0.0f, 0.0f, Color.lightGray
+ );
+ GradientPaint gp1 = new GradientPaint(
+ 0.0f, 0.0f, Color.green,
+ 0.0f, 0.0f, Color.lightGray
+ );
+ GradientPaint gp2 = new GradientPaint(
+ 0.0f, 0.0f, Color.red,
+ 0.0f, 0.0f, Color.lightGray
+ );
+ renderer.setSeriesPaint(0, gp0);
+ renderer.setSeriesPaint(1, gp1);
+ renderer.setSeriesPaint(2, gp2);
+
+ // OPTIONAL CUSTOMISATION COMPLETED.
+ } */
+
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/BarChartBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/JFreeChartImpl.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/JFreeChartImpl.java
(rev 0)
+++
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/JFreeChartImpl.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart.internal.jfree;
+
+import org.jboss.sam.chart.Chart;
+import org.jboss.sam.chart.ChartMetadata;
+import org.jfree.chart.JFreeChart;
+
+import java.io.OutputStream;
+import java.util.UUID;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class JFreeChartImpl implements Chart<JFreeChart>
+{
+ private ChartMetadata metadata;
+
+ private JFreeChart delegate;
+
+ private String name;
+
+ public JFreeChartImpl(String name, JFreeChart delegate)
+ {
+ this.name = name;
+ this.delegate = delegate;
+ }
+
+ public JFreeChartImpl(JFreeChart delegate)
+ {
+ this(UUID.randomUUID().toString(), delegate);
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void writeTo(OutputStream out)
+ {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public JFreeChart getUnderlying()
+ {
+ return delegate;
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/JFreeChartImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/LineChartBuilder.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/LineChartBuilder.java
(rev 0)
+++
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/LineChartBuilder.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart.internal.jfree;
+
+import org.jboss.sam.EventMessage;
+import org.jboss.sam.chart.Chart;
+import org.jboss.sam.chart.ChartBuilder;
+import org.jboss.sam.chart.ChartMapping;
+import org.jboss.sam.chart.ChartMetadata;
+import org.jfree.chart.ChartFactory;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.plot.PlotOrientation;
+import org.jfree.data.xy.XYSeries;
+import org.jfree.data.xy.XYSeriesCollection;
+
+import java.util.Iterator;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class LineChartBuilder implements ChartBuilder
+{
+ private String chartTitle;
+ private String xAxisLabel,yAxisLabel;
+
+ public final static String INDEX_1 = "series";
+ public final static String INDEX_2 = "x_value";
+ public final static String DATA_1 = "y_value";
+
+ public LineChartBuilder(String chartTitle, String xAxisLabel, String yAxisLabel)
+ {
+ this.chartTitle = chartTitle;
+ this.xAxisLabel = xAxisLabel;
+ this.yAxisLabel = yAxisLabel;
+ }
+
+ public ChartMetadata getMetadata()
+ {
+ return null;
+ }
+
+ public Chart buildChart(EventMessage[] events, ChartMapping mapping)
+ {
+ XYSeriesCollection dataset = createDataset(events, mapping);
+
+ JFreeChart chart = ChartFactory.createXYLineChart(
+ chartTitle, // chart title
+ xAxisLabel, // x axis label
+ yAxisLabel, // y axis label
+ dataset, // data
+ PlotOrientation.VERTICAL,
+ true, // include legend
+ true, // tooltips
+ false // urls
+ );
+
+ return new JFreeChartImpl(chart);
+ }
+
+ private XYSeriesCollection createDataset(EventMessage[] events, ChartMapping mapping)
+ {
+
+ XYSeriesCollection dataset = new XYSeriesCollection();
+
+ for(EventMessage event : events)
+ {
+ XYSeries series = getOrCreateSeries(
+ dataset,
+ (String)mapping.getIndexMapping(INDEX_1).map(event)
+ );
+ series.add(
+ (Double)mapping.getIndexMapping(INDEX_2).map(event),
+ (Double)mapping.getPropertyMapping(DATA_1).map(event)
+ );
+ }
+
+ return dataset;
+ }
+
+ private XYSeries getOrCreateSeries(XYSeriesCollection dataset, Comparable key)
+ {
+ XYSeries match = null;
+ Iterator it = dataset.getSeries().iterator();
+ while(it.hasNext())
+ {
+ XYSeries series = (XYSeries)it.next();
+ if(series.getKey().equals(key))
+ {
+ match = series;
+ break;
+ }
+ }
+
+ if(null==match)
+ {
+ match = new XYSeries(key);
+ dataset.addSeries(match);
+ }
+
+ return match;
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/LineChartBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/PieChartBuilder.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/PieChartBuilder.java
(rev 0)
+++
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/PieChartBuilder.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.chart.internal.jfree;
+
+import org.jboss.sam.EventMessage;
+import org.jboss.sam.chart.Chart;
+import org.jboss.sam.chart.ChartBuilder;
+import org.jboss.sam.chart.ChartMapping;
+import org.jboss.sam.chart.ChartMetadata;
+import org.jfree.chart.ChartFactory;
+import org.jfree.chart.JFreeChart;
+import org.jfree.data.general.DefaultPieDataset;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class PieChartBuilder implements ChartBuilder
+{
+ private String chartName;
+ //private DefaultPieDataset dataset;
+
+ public final static String INDEX_1 = "category";
+ public final static String DATA_1 = "percentage";
+
+ public PieChartBuilder(String chartName)
+ {
+ this.chartName = chartName;
+ }
+
+
+ public ChartMetadata getMetadata()
+ {
+ return null;
+ }
+
+ public Chart buildChart(EventMessage[] events, ChartMapping mapping)
+ {
+ DefaultPieDataset dataset = createDataset(events, mapping);
+
+ JFreeChart chart = ChartFactory.createPieChart(
+ chartName,
+ dataset,
+ true, // legend?
+ true, // tooltips?
+ false // URLs?
+ );
+
+ return new JFreeChartImpl(chart);
+ }
+
+ private DefaultPieDataset createDataset(EventMessage[] events, ChartMapping mapping)
+ {
+ DefaultPieDataset dataset = new DefaultPieDataset();
+
+ for(EventMessage event : events)
+ {
+ dataset.setValue(
+ (String)mapping.getIndexMapping(INDEX_1).map(event), // category
+ (Double)mapping.getPropertyMapping(DATA_1).map(event) // percentage
+ );
+ }
+
+ return dataset;
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/chart/internal/jfree/PieChartBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperRuntimeImpl.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperRuntimeImpl.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperRuntimeImpl.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.internal.esper;
+
+import com.espertech.esper.client.*;
+import org.jboss.sam.*;
+
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * A SAM runtime implementation that builds atop of Esper.
+ * It processes imput streams and passes event representations to the underlying Esper
instance.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class EsperRuntimeImpl implements StreamInputCallback,
EventProcessor<EPServiceProvider>
+{
+ private String runtimeName;
+
+ private EPServiceProvider epService;
+
+ private Map<String, StreamInput> inputStreams = new ConcurrentHashMap<String,
StreamInput>();
+ private Map<String, StreamOutput> outputStreams = new
ConcurrentHashMap<String, StreamOutput>();
+
+ private Map<String, Statement> statements = new ConcurrentHashMap<String,
Statement>();
+
+ public EsperRuntimeImpl(String name, URL config)
+ {
+ this.runtimeName = name;
+ Configuration configuration = new Configuration();
+ configuration.configure( config );
+ this.epService = EPServiceProviderManager.getProvider(name, configuration);
+
+ /*epService.getEPRuntime().setUnmatchedListener(
+ new UnmatchedListener()
+ {
+
+ public void update(EventBean event)
+ {
+ System.out.println("! Unmatched: " + event);
+ }
+ }
+ );*/
+ }
+
+ public void addInput(StreamInput streamInput)
+ {
+ streamInput.registerCallback(this);
+ this.inputStreams.put(streamInput.getStreamName(), streamInput);
+ }
+
+ public void removeInput(String streamName)
+ {
+ this.inputStreams.remove(streamName);
+ }
+
+ public Iterator<String> getInputStreamNames()
+ {
+ return this.inputStreams.keySet().iterator();
+ }
+
+ public void addOutput(StreamOutput streamOutput)
+ {
+ this.outputStreams.put(streamOutput.getStreamName(), streamOutput);
+ }
+
+ public void removeOutput(String streamName)
+ {
+ this.outputStreams.remove(streamName);
+ }
+
+ public Iterator<String> getOutputStreamNames()
+ {
+ return this.outputStreams.keySet().iterator();
+ }
+
+ /**
+ * Any event send to an adapter goes to the EPRuntime
+ * @param args
+ */
+ public void onEvent(Object args)
+ {
+ epService.getEPRuntime().sendEvent(args);
+ }
+
+ public Statement registerStatement(String statementName, String epl)
+ {
+ EPStatement epStatement = epService.getEPAdministrator().createEPL(epl,
statementName);
+ return new EsperStatement(epStatement);
+ }
+
+ public Statement registerBoundStatement(String outputStreamName, String statementName,
String epl)
+ {
+ StreamOutput streamOutput = this.outputStreams.get(outputStreamName);
+ if(null == streamOutput)
+ throw new IllegalArgumentException("No such output stream: " +
outputStreamName);
+
+ EPStatement epStatement = epService.getEPAdministrator().createEPL(epl,
statementName);
+ EsperStatement statement = new EsperStatement(epStatement);
+ statement.bindTo(streamOutput);
+
+ return statement;
+ }
+
+ public Iterator<String> getStatementNames()
+ {
+ return this.statements.keySet().iterator();
+ }
+
+
+ public void clearStatement(String statementName)
+ {
+ Statement stmt = statements.get(statementName);
+ if(null==stmt)
+ throw new IllegalArgumentException("No such statement: " +
statementName);
+
+ statements.remove(statementName);
+ }
+
+ public void clearAllStatements()
+ {
+ Iterator<String> stmtNames = getStatementNames();
+ while(stmtNames.hasNext())
+ {
+ clearStatement(stmtNames.next());
+ }
+ }
+
+ public String getName()
+ {
+ return this.runtimeName;
+ }
+
+ public EPServiceProvider getUnderlying()
+ {
+ return this.epService;
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperRuntimeImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperStatement.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperStatement.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperStatement.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.internal.esper;
+
+import com.espertech.esper.client.EPStatement;
+import org.jboss.sam.Statement;
+import org.jboss.sam.StreamOutput;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class EsperStatement implements Statement<EPStatement>
+{
+ private EPStatement delegate;
+
+ // Registered listener, 1:n
+ protected Map<String, StreamOutputAdapter> listener = new HashMap<String,
StreamOutputAdapter>();
+
+ protected String name;
+
+ private boolean bound;
+
+ public EsperStatement(EPStatement delegate)
+ {
+ this(delegate, false);
+ }
+
+ public EsperStatement(EPStatement delegate, boolean isBound)
+ {
+ this.bound = isBound;
+ this.delegate = delegate;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+
+ public boolean isBound()
+ {
+ return this.bound;
+ }
+
+ public void bindTo(StreamOutput stream)
+ {
+ StreamOutputAdapter adapter = new StreamOutputAdapter(stream);
+ delegate.addListener(adapter);
+ this.listener.put(stream.getStreamName(), adapter);
+ }
+
+ public StreamOutput unbind(String name)
+ {
+ return null;
+ }
+
+ public EPStatement getUnderlying()
+ {
+ return delegate;
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/internal/esper/EsperStatement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/internal/esper/EventAdapter.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/internal/esper/EventAdapter.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/internal/esper/EventAdapter.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.internal.esper;
+
+import com.espertech.esper.event.EventBean;
+import org.jboss.sam.EventMessage;
+
+import java.util.Iterator;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class EventAdapter implements EventMessage<EventBean>
+{
+ private final EventBean delegate;
+
+ private long timestamp;
+
+ /**
+ * Create with an implicit timestamp
+ *
+ * @param delegate
+ */
+ public EventAdapter(EventBean delegate)
+ {
+ this.delegate = delegate;
+ this.timestamp = System.currentTimeMillis();
+ }
+
+ /**
+ * Create with an external timestamp
+ * @param delegate
+ * @param timestamp
+ */
+ public EventAdapter(EventBean delegate, long timestamp)
+ {
+ this.delegate = delegate;
+ this.timestamp = timestamp;
+ }
+
+ public long getTimestamp()
+ {
+ return this.timestamp;
+ }
+
+ public Iterator<String> getPropertyNames()
+ {
+ Iterator<String> it = new Iterator<String>()
+ {
+
+ private String[] names = delegate.getEventType().getPropertyNames();
+ private int index=0;
+
+ public boolean hasNext()
+ {
+ return names.length>0 && index<names.length-1;
+ }
+
+ public String next()
+ {
+ String next = names[index];
+ index++;
+ return next;
+ }
+
+ public void remove()
+ {
+ throw new IllegalArgumentException("Not implemented");
+ }
+ };
+
+ return it;
+ }
+
+ public Object getProperty(String property)
+ {
+ return delegate.get(property);
+ }
+
+ public EventBean getUnderlying()
+ {
+ return delegate;
+ }
+}
+
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/internal/esper/EventAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/internal/esper/StreamOutputAdapter.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/internal/esper/StreamOutputAdapter.java
(rev 0)
+++
sam/trunk/src/main/java/org/jboss/sam/internal/esper/StreamOutputAdapter.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.internal.esper;
+
+import com.espertech.esper.client.UpdateListener;
+import com.espertech.esper.event.EventBean;
+import org.jboss.sam.EventMessage;
+import org.jboss.sam.StreamOutput;
+
+/**
+ * Adopts an Esper {@link com.espertech.esper.client.UpdateListener}
+ * to to an FX {@link org.jboss.sam.StreamOutput}
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+class StreamOutputAdapter implements UpdateListener
+{
+ protected StreamOutput delegate;
+
+ public StreamOutputAdapter(StreamOutput eventListener)
+ {
+ this.delegate = eventListener;
+ }
+
+ public void update(EventBean[] newEvents, EventBean[] oldEvents)
+ {
+ EventMessage[] args1 = adoptPayload(newEvents);
+ EventMessage[] args2 = adoptPayload(oldEvents);
+
+ // TODO: review StreamOutput interface wrt oldEvents
+
+ delegate.write(args1);
+ }
+
+ private EventMessage[] adoptPayload(EventBean[] data)
+ {
+ int size = data !=null ? data.length : 0;
+ EventMessage[] payloads = new EventMessage[size];
+
+ for(int i=0; i<size; i++)
+ {
+ payloads[i] = new EventAdapter(data[i]);
+ }
+
+ return payloads;
+ }
+
+ StreamOutput getUnderlying()
+ {
+ return this.delegate;
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/internal/esper/StreamOutputAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMDispatcher.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMDispatcher.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMDispatcher.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.internal.stream;
+
+import org.jboss.sam.StreamInputCallback;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class InVMDispatcher
+{
+ private InVMStreamRegistry channelRegistry;
+
+ private String streamName;
+
+ public InVMDispatcher(String streamName)
+ {
+ this.streamName = streamName;
+ this.channelRegistry = InVMStreamRegistry.getInstance();
+ }
+
+ public void dispatch(Object event)
+ {
+ for(StreamInputCallback callback :
channelRegistry.getChannelCallbacks(streamName))
+ {
+ callback.onEvent(event);
+ }
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMDispatcher.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamInput.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamInput.java
(rev 0)
+++ sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamInput.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.internal.stream;
+
+import org.jboss.sam.StreamInput;
+import org.jboss.sam.StreamInputCallback;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class InVMStreamInput implements StreamInput
+{
+ private boolean started;
+
+ private String streamName;
+
+ InVMStreamRegistry channelRegistry;
+
+ public InVMStreamInput(String name)
+ {
+ this.streamName = name;
+ this.channelRegistry = InVMStreamRegistry.getInstance();
+ }
+
+ public StreamInput start()
+ {
+ this.started = true;
+ return this;
+ }
+
+ public StreamInput stop()
+ {
+ this.started = false;
+ return this;
+ }
+
+ public boolean isStarted()
+ {
+ return this.started;
+ }
+
+ public String getStreamName()
+ {
+ return this.streamName;
+ }
+
+ public void registerCallback(StreamInputCallback listener)
+ {
+ channelRegistry.getChannelCallbacks(streamName).add(listener);
+ }
+
+ public void clearCallbacks()
+ {
+ channelRegistry.getChannelCallbacks(streamName).clear();
+ }
+
+ public void newEvent(Object args)
+ {
+ for(StreamInputCallback callback :
channelRegistry.getChannelCallbacks(streamName))
+ {
+ callback.onEvent(args);
+ }
+
+ }
+
+ public String toString()
+ {
+ return "InVMInputAdapter{"+this.streamName +"}";
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamInput.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamRegistry.java
===================================================================
--- sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamRegistry.java
(rev 0)
+++
sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamRegistry.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.sam.internal.stream;
+
+import org.jboss.sam.StreamInputCallback;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class InVMStreamRegistry
+{
+ private Map<String, List<StreamInputCallback>> streams = new
ConcurrentHashMap<String, List<StreamInputCallback>>();
+
+ private static InVMStreamRegistry INSTANCE;
+
+ private InVMStreamRegistry()
+ {
+ }
+
+ public static InVMStreamRegistry getInstance()
+ {
+ if(null == INSTANCE)
+ INSTANCE = new InVMStreamRegistry();
+ return INSTANCE;
+ }
+
+ public List<StreamInputCallback> getChannelCallbacks(String streamName)
+ {
+ if(null == streams.get(streamName))
+ streams.put(streamName, new CopyOnWriteArrayList<StreamInputCallback>());
+ return streams.get(streamName);
+ }
+}
Property changes on:
sam/trunk/src/main/java/org/jboss/sam/internal/stream/InVMStreamRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/etc/tst.policy
===================================================================
--- sam/trunk/src/test/etc/tst.policy (rev 0)
+++ sam/trunk/src/test/etc/tst.policy 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,4 @@
+grant {
+ permission java.security.AllPermission;
+};
+
Added: sam/trunk/src/test/java/org/jboss/test/sam/BufferedStreamOutput.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/BufferedStreamOutput.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/BufferedStreamOutput.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam;
+
+import junit.framework.Assert;
+import org.jboss.sam.EventMessage;
+import org.jboss.sam.StreamOutput;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * Unit test helper borrowed from esper samples.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class BufferedStreamOutput implements StreamOutput
+{
+ private List<EventMessage[]> newDataLists;
+ private List<EventMessage[]> oldDataLists;
+
+ private EventMessage[] lastNewDatas;
+ private EventMessage[] lastOldDatas;
+ private boolean isInvoked;
+
+ private String streamName;
+
+ private boolean started;
+
+ public static String NAME = "InVM";
+
+ public BufferedStreamOutput()
+ {
+ this(UUID.randomUUID().toString());
+ }
+
+ public BufferedStreamOutput(String name)
+ {
+ this.streamName = name;
+ newDataLists = new LinkedList<EventMessage[]>();
+ oldDataLists = new LinkedList<EventMessage[]>();
+ }
+
+
+ public BufferedStreamOutput start()
+ {
+ this.started = true;
+ return this;
+ }
+
+ public BufferedStreamOutput stop()
+ {
+ this.started = false;
+ return this;
+ }
+
+ public boolean isStarted()
+ {
+ return this.started;
+ }
+
+ public String getStreamName()
+ {
+ return this.streamName;
+ }
+
+ public void write(EventMessage[] args)
+ {
+ update(args, new EventMessage[]{});
+ }
+
+ public void update(EventMessage[] newDatas, EventMessage[] oldDatas)
+ {
+ this.oldDataLists.add(oldDatas);
+ this.newDataLists.add(newDatas);
+
+ this.lastNewDatas = newDatas;
+ this.lastOldDatas = oldDatas;
+
+ isInvoked = true;
+ }
+
+ public void reset()
+ {
+ this.oldDataLists.clear();
+ this.newDataLists.clear();
+ this.lastNewDatas = null;
+ this.lastOldDatas = null;
+ isInvoked = false;
+ }
+
+ public EventMessage[] getLastNewData()
+ {
+ return lastNewDatas;
+ }
+
+ public EventMessage[] getAndResetLastNewData()
+ {
+ EventMessage[] lastNews = lastNewDatas;
+ lastNewDatas = null;
+ return lastNews;
+ }
+
+ public EventMessage[] getLastOldData()
+ {
+ return lastOldDatas;
+ }
+
+ public List<EventMessage[]> getNewDataList()
+ {
+ return newDataLists;
+ }
+
+ public List<EventMessage[]> getOldDataList()
+ {
+ return oldDataLists;
+ }
+
+ public boolean isInvoked()
+ {
+ return isInvoked;
+ }
+
+ public boolean getAndClearIsInvoked()
+ {
+ boolean invoked = isInvoked;
+ isInvoked = false;
+ return invoked;
+ }
+
+ public void setLastNewData(EventMessage[] lastNewDatas)
+ {
+ this.lastNewDatas = lastNewDatas;
+ }
+
+ public void setLastOldData(EventMessage[] lastOldDatas)
+ {
+ this.lastOldDatas = lastOldDatas;
+ }
+
+ public EventMessage assertOneGetNewAndReset()
+ {
+ Assert.assertTrue(isInvoked);
+
+ Assert.assertEquals(1, newDataLists.size());
+ Assert.assertEquals(1, oldDataLists.size());
+
+ Assert.assertEquals(1, lastNewDatas.length);
+ Assert.assertNull(lastOldDatas);
+
+ EventMessage lastNew = lastNewDatas[0];
+ reset();
+ return lastNew;
+ }
+
+}
\ No newline at end of file
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/BufferedStreamOutput.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/InMemoryDatabase.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/InMemoryDatabase.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/InMemoryDatabase.java 2008-06-30 09:52:26
UTC (rev 83)
@@ -0,0 +1,146 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam;
+
+import java.sql.*;
+
+/**
+ * A simple in memory database backed by HSQL.<p>
+ * Connection details:
+ *
+ * <ul>
+ * <li>Conn: {@link #CONNECTION_STING}
+ * <li>User: {@link #USER}
+ * <li>Pass: {@link #PASSWORD}
+ * <ul>
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class InMemoryDatabase
+{
+ private Connection conn;
+
+ private final static String CONNECTION_STING =
"jdbc:hsqldb:mem:SamTestSetup";
+ private static final String USER = "sa";
+ private static final String PASSWORD = "";
+
+ public InMemoryDatabase()
+ {
+ try
+ {
+ Class.forName("org.hsqldb.jdbcDriver");
+ conn = DriverManager.getConnection(CONNECTION_STING, USER, PASSWORD);
+ } catch (Exception e)
+ {
+ throw new RuntimeException("Failed to setup HSQL database", e);
+ }
+ }
+
+ public synchronized void query(String expression) throws SQLException
+ {
+
+ Statement st = null;
+ ResultSet rs = null;
+
+ st = conn.createStatement(); // statement objects can be reused with
+
+ // repeated calls to execute but we
+ // choose to make a new one each time
+ rs = st.executeQuery(expression); // run the query
+
+ // do something with the result set.
+ dump(rs);
+ st.close(); // NOTE!! if you close a statement the associated ResultSet is
+
+ // closed too
+ // so you should copy the contents to some other object.
+ // the result set is invalidated also if you recycle an Statement
+ // and try to execute some other query before the result set has been
+ // completely examined.
+ }
+
+ /**
+ * Use for SQL commands CREATE, DROP, INSERT and UPDATE
+ *
+ * @param expression
+ * @throws SQLException
+ */
+ public synchronized void update(String expression) throws SQLException {
+
+ Statement st = null;
+
+ st = conn.createStatement(); // statements
+
+ int i = st.executeUpdate(expression); // run the query
+
+ if (i == -1) {
+ System.out.println("db error : " + expression);
+ }
+
+ st.close();
+ } // void update()
+
+ public void shutdown() throws SQLException {
+
+ Statement st = conn.createStatement();
+
+ // db writes out to files and performs clean shuts down
+ // otherwise there will be an unclean shutdown
+ // when program ends
+ st.execute("SHUTDOWN");
+ conn.close(); // if there are no other open connection
+ }
+
+
+ public static void dump(ResultSet rs) throws SQLException {
+
+ // the order of the rows in a cursor
+ // are implementation dependent unless you use the SQL ORDER statement
+ ResultSetMetaData meta = rs.getMetaData();
+ int colmax = meta.getColumnCount();
+ int i;
+ Object o = null;
+
+ // the result set is a cursor into the data. You can only
+ // point to one row at a time
+ // assume we are pointing to BEFORE the first row
+ // rs.next() points to next row and returns true
+ // or false if there is no next row, which breaks the loop
+ for (; rs.next(); ) {
+ for (i = 0; i < colmax; ++i) {
+ String cname = rs.getMetaData().getColumnName(i+1);
+ o = rs.getObject(i + 1); // Is SQL the first column is indexed
+
+ // with 1 not 0
+ System.out.print(cname+":"+o.toString() + "\t ");
+ }
+
+ System.out.println(" ");
+ }
+ }
+
+
+ public String toString()
+ {
+ return "InMemoryDB {conn="+CONNECTION_STING+",
user="+USER+", pass="+PASSWORD+"}";
+ }
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/InMemoryDatabase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/JFreeChartViewer.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/JFreeChartViewer.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/JFreeChartViewer.java 2008-06-30 09:52:26
UTC (rev 83)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam;
+
+import org.jfree.chart.ChartPanel;
+import org.jfree.chart.JFreeChart;
+import org.jfree.ui.ApplicationFrame;
+import org.jfree.ui.RefineryUtilities;
+
+import java.awt.event.WindowEvent;
+
+/**
+ * Helper to display charts
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class JFreeChartViewer extends ApplicationFrame
+{
+ private JFreeChart chart;
+
+ public JFreeChartViewer()
+ {
+ super("ChartViewer");
+ }
+
+ public JFreeChartViewer setChart(JFreeChart chart)
+ {
+ this.chart = chart;
+ return this;
+ }
+
+ public void display()
+ {
+ // put the chart to a panel...
+ ChartPanel chartPanel = new ChartPanel(chart);
+ chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
+ setContentPane(chartPanel);
+
+ pack();
+ RefineryUtilities.centerFrameOnScreen(this);
+ setVisible(true);
+ }
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/JFreeChartViewer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/MapEventMessage.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/MapEventMessage.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/MapEventMessage.java 2008-06-30 09:52:26
UTC (rev 83)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam;
+
+import org.jboss.sam.EventMessage;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MapEventMessage implements EventMessage<Map>
+{
+ private Map<String, Object> data = new HashMap<String, Object>();
+
+ private long timestamp;
+
+ public MapEventMessage()
+ {
+ this(System.currentTimeMillis());
+ }
+
+ public MapEventMessage(long timestamp)
+ {
+ this.timestamp = timestamp;
+ }
+
+ public MapEventMessage put(String key, Object value)
+ {
+ data.put(key, value);
+ return this;
+ }
+
+ public Object getProperty(String name)
+ {
+ return data.get(name);
+ }
+
+ public Map getUnderlying()
+ {
+ return data;
+ }
+
+ public long getTimestamp()
+ {
+ return this.timestamp;
+ }
+
+ public Iterator<String> getPropertyNames()
+ {
+ return this.data.keySet().iterator();
+ }
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/MapEventMessage.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/SamTestSetup.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/SamTestSetup.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/SamTestSetup.java 2008-06-30 09:52:26 UTC
(rev 83)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam;
+
+import junit.framework.TestCase;
+import org.jboss.sam.EventProcessor;
+import org.jboss.sam.EventProcessorFactory;
+import org.jboss.sam.StreamInput;
+import org.jboss.sam.internal.stream.InVMStreamInput;
+import org.jboss.sam.internal.stream.InVMDispatcher;
+
+import java.net.URL;
+
+/**
+ * Basic SAM test skeleton. Test cases should derive from this class.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public abstract class SamTestSetup extends TestCase
+{
+ protected EventProcessor eventProcessor;
+ protected StreamInput streamInput;
+ protected BufferedStreamOutput bufferedOutput;
+ private InVMDispatcher dispatcher;
+
+ /**
+ * Constructs a {@link org.jboss.sam.EventProcessor} for a given name
+ * and assigns default stream input's and output's.
+ *
+ * @see org.jboss.sam.internal.stream.InVMStreamInput
+ * @see org.jboss.test.sam.BufferedStreamOutput
+ *
+ * @param name the runtime name
+ * @param configFile name of the esper-config file relative to test execution
+ */
+ public void createInVMSetup(String name, String configFile)
+ {
+ // Main runtime
+ eventProcessor = EventProcessorFactory.newInstance().createRuntime(
+ name, loadTestConfiguration(configFile)
+ );
+
+ // Stream input and output
+ streamInput = new InVMStreamInput("InVM").start();
+ dispatcher = new InVMDispatcher(streamInput.getStreamName());
+
+ bufferedOutput = new BufferedStreamOutput("InVM").start();
+ eventProcessor.addInput(streamInput);
+ eventProcessor.addOutput(bufferedOutput);
+
+ System.out.println("Initialized SamRuntime: " +
eventProcessor.getName());
+ }
+
+ /**
+ * Creates an in memory database. Make sure to shutdown the database in {@link
#tearDown()}
+ * @return pointer to an in memory database
+ */
+ protected InMemoryDatabase createDatabase()
+ {
+ InMemoryDatabase inMemoryDB = new InMemoryDatabase();
+ System.out.println("Database has been setup: " + inMemoryDB);
+ return inMemoryDB;
+ }
+
+ protected void generateInVMEvent(Object obj)
+ {
+ dispatcher.dispatch(obj);
+ }
+
+ public URL loadTestConfiguration(String name)
+ {
+ return Thread.currentThread().getContextClassLoader().getResource(name);
+ }
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/SamTestSetup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/Alert.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/Alert.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/Alert.java 2008-06-30 09:52:26
UTC (rev 83)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.adapter.invm;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public final class Alert
+{
+ private final String source;
+ private final String value;
+
+ public Alert(String source, String value)
+ {
+ this.value = value;
+ this.source = source;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public String getSource()
+ {
+ return source;
+ }
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/Alert.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/InVMAdapterTestCase.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/InVMAdapterTestCase.java
(rev 0)
+++
sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/InVMAdapterTestCase.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.adapter.invm;
+
+import org.jboss.sam.Statement;
+import org.jboss.test.sam.SamTestSetup;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class InVMAdapterTestCase extends SamTestSetup
+{
+ public void setUp()
+ {
+ createInVMSetup("InVMAdapterTestCase",
"adapter/invm/esper-cfg.xml");
+ }
+
+ public void testAdapter() throws Exception
+ {
+ // setup
+ String stmt = "select * from Alert.win:length(1)";
+ Statement view =
eventProcessor.registerBoundStatement("InVM","AlertTest", stmt);
+
+ // fire event
+ generateInVMEvent( new Alert("sensor1", "Threshold exceeded")
);
+
+ // check result
+ assertTrue("Listener not invoked", bufferedOutput.isInvoked());
+ assertFalse( bufferedOutput.getLastNewData().length == 0);
+ assertEquals( "Threshold exceeded",
bufferedOutput.getLastNewData()[0].getProperty("value"));
+ }
+
+ public void testUnknownAdapter() throws Exception
+ {
+ try
+ {
+ String stmt = "select * from Alert.win:length(1)";
+ eventProcessor.registerBoundStatement("NoSuchAdapter",
"AlertTest", stmt);
+ fail("Expected exception not thrown");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected behaviour
+ }
+
+ }
+}
+
Property changes on:
sam/trunk/src/test/java/org/jboss/test/sam/adapter/invm/InVMAdapterTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/chart/BarChartRunner.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/chart/BarChartRunner.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/chart/BarChartRunner.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.chart;
+
+import org.jboss.sam.EventMessage;
+import org.jboss.sam.chart.Chart;
+import org.jboss.sam.chart.ChartMapping;
+import org.jboss.sam.chart.PropertyMapping;
+import org.jboss.sam.chart.internal.jfree.BarChartBuilder;
+import org.jboss.test.sam.JFreeChartViewer;
+import org.jboss.test.sam.MapEventMessage;
+import org.jfree.chart.JFreeChart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class BarChartRunner
+{
+ public static void main(String[] args) throws Exception
+ {
+ BarChartRunner app = new BarChartRunner();
+ app.run();
+ }
+
+ public void run() throws Exception
+ {
+ // example data
+ EventMessage[] payloads = new EventMessage[] {
+ new MapEventMessage().put("node", "Prepare
Order").put("average", 8.17),
+ new MapEventMessage().put("node", "Request
verification").put("average", 44.17),
+ new MapEventMessage().put("node",
"Billing").put("average", 22.17),
+ new MapEventMessage().put("node", "Prepare
shipping").put("average", 12.10),
+ new MapEventMessage().put("node", "Notify
customer").put("average", 6.80)
+ };
+
+ // create chart
+ Chart<JFreeChart> chart = buildChart(payloads);
+
+ // display it
+ new JFreeChartViewer().setChart(chart.getUnderlying()).display();
+ }
+
+ public Chart buildChart(EventMessage[] payloads)
+ {
+ List<PropertyMapping> index = new ArrayList<PropertyMapping>();
+ index.add(new PropertyMapping(BarChartBuilder.INDEX_1, null).constant("Exec
time per node"));
+ index.add(new PropertyMapping(BarChartBuilder.INDEX_2, "node"));
+
+ List<PropertyMapping> data = new ArrayList<PropertyMapping>();
+ data.add(new PropertyMapping(BarChartBuilder.PROP_1, "average"));
+
+ ChartMapping mapping = new ChartMapping("Average exec time per
node",index, data); // could be serialzed
+
+ Chart chart = new BarChartBuilder(
+ "Order process execution time layout", "Node", "Average
exectime")
+ .buildChart(payloads, mapping);
+
+ return chart;
+ }
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/chart/BarChartRunner.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/chart/LineChartRunner.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/chart/LineChartRunner.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/chart/LineChartRunner.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.chart;
+
+import org.jboss.sam.EventMessage;
+import org.jboss.sam.chart.Chart;
+import org.jboss.sam.chart.ChartMapping;
+import org.jboss.sam.chart.PropertyMapping;
+import org.jboss.sam.chart.internal.jfree.LineChartBuilder;
+import org.jboss.test.sam.JFreeChartViewer;
+import org.jboss.test.sam.MapEventMessage;
+import org.jfree.chart.JFreeChart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class LineChartRunner
+{
+ public static void main(String[] args) throws Exception
+ {
+ LineChartRunner app = new LineChartRunner();
+ app.run();
+ }
+
+ public void run() throws Exception
+ {
+ // example data
+ EventMessage[] payloads = new EventMessage[] {
+ new MapEventMessage().put("instance",
"Proc1").put("sample", 1.0).put("average", 12.00),
+ new MapEventMessage().put("instance",
"Proc1").put("sample", 2.0).put("average", 32.00),
+ new MapEventMessage().put("instance",
"Proc1").put("sample", 3.0).put("average", 70.00),
+ new MapEventMessage().put("instance",
"Proc1").put("sample", 4.0).put("average", 8.00),
+ new MapEventMessage().put("instance",
"Proc1").put("sample", 5.0).put("average", 18.00),
+
+ new MapEventMessage().put("instance",
"Proc2").put("sample", 1.0).put("average", 13.00),
+ new MapEventMessage().put("instance",
"Proc2").put("sample", 2.0).put("average", 48.00),
+ new MapEventMessage().put("instance",
"Proc2").put("sample", 3.0).put("average", 13.00),
+ new MapEventMessage().put("instance",
"Proc2").put("sample", 4.0).put("average", 12.00),
+ new MapEventMessage().put("instance",
"Proc2").put("sample", 5.0).put("average", 14.00),
+
+ new MapEventMessage().put("instance",
"Proc3").put("sample", 1.0).put("average", 7.00),
+ new MapEventMessage().put("instance",
"Proc3").put("sample", 2.0).put("average", 23.00),
+ new MapEventMessage().put("instance",
"Proc3").put("sample", 3.0).put("average", 40.00),
+ new MapEventMessage().put("instance",
"Proc3").put("sample", 4.0).put("average", 50.00),
+ new MapEventMessage().put("instance",
"Proc3").put("sample", 5.0).put("average", 32.00)
+ };
+
+ // build chart
+ Chart<JFreeChart> chart = buildChart(payloads);
+
+ // display it
+ new JFreeChartViewer().setChart(chart.getUnderlying()).display();
+ }
+
+ public Chart buildChart(EventMessage[] payloads)
+ {
+ List<PropertyMapping> index = new ArrayList<PropertyMapping>();
+ index.add(new PropertyMapping(LineChartBuilder.INDEX_1, "instance"));
+ index.add(new PropertyMapping(LineChartBuilder.INDEX_2, "sample"));
+
+ List<PropertyMapping> data = new ArrayList<PropertyMapping>();
+ data.add(new PropertyMapping(LineChartBuilder.DATA_1, "average"));
+
+ ChartMapping mapping = new ChartMapping("Process exsecution per sample",
index, data);
+
+ Chart chart = new LineChartBuilder(
+ "Process instance execution time",
+ "Sample", "Average Execution"
+ ).buildChart(payloads, mapping);
+
+ return chart;
+ }
+
+}
Property changes on:
sam/trunk/src/test/java/org/jboss/test/sam/chart/LineChartRunner.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/chart/PieChartRunner.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/chart/PieChartRunner.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/chart/PieChartRunner.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.chart;
+
+import org.jboss.sam.EventMessage;
+import org.jboss.sam.chart.Chart;
+import org.jboss.sam.chart.ChartMapping;
+import org.jboss.sam.chart.PropertyMapping;
+import org.jboss.sam.chart.internal.jfree.PieChartBuilder;
+import org.jboss.test.sam.JFreeChartViewer;
+import org.jboss.test.sam.MapEventMessage;
+import org.jfree.chart.JFreeChart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class PieChartRunner
+{
+ public static void main(String[] args) throws Exception
+ {
+ PieChartRunner app = new PieChartRunner();
+ app.run();
+ }
+
+ public void run() throws Exception
+ {
+ // example data
+ EventMessage[] payloads = new EventMessage[] {
+ new MapEventMessage().put("process",
"OrderPreparation").put("average", 23.17),
+ new MapEventMessage().put("process",
"Billing").put("average", 17.17),
+ new MapEventMessage().put("process",
"Shipment").put("average", 22.17),
+ };
+
+ // create chart
+ Chart<JFreeChart> chart = buildChart(payloads);
+
+ // display it
+ new JFreeChartViewer().setChart(chart.getUnderlying()).display();
+ }
+
+ public Chart buildChart(EventMessage[] payloads)
+ {
+ List<PropertyMapping> index = new ArrayList<PropertyMapping>();
+ index.add(new PropertyMapping(PieChartBuilder.INDEX_1, "process"));
+
+ List<PropertyMapping> data = new ArrayList<PropertyMapping>();
+ data.add(new PropertyMapping(PieChartBuilder.DATA_1, "average"));
+
+ ChartMapping mapping = new ChartMapping("Most executed process
definitions", index, data);
+
+ Chart chart = new PieChartBuilder(
+ "Average process execution time")
+ .buildChart(payloads, mapping);
+
+ return chart;
+ }
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/chart/PieChartRunner.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/database/DatabaseTestCase.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/database/DatabaseTestCase.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/database/DatabaseTestCase.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.database;
+
+import com.espertech.esper.client.EPServiceProvider;
+import com.espertech.esper.client.EPStatement;
+import com.espertech.esper.client.StatementAwareUpdateListener;
+import com.espertech.esper.event.EventBean;
+import org.jboss.sam.Statement;
+import org.jboss.sam.EventMessage;
+import org.jboss.test.sam.SamTestSetup;
+import org.jboss.test.sam.InMemoryDatabase;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Test esper database integration patterns
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class DatabaseTestCase extends SamTestSetup
+{
+ private InMemoryDatabase db;
+
+ public void setUp() throws Exception
+ {
+ // Runtime
+ createInVMSetup("DataBaseTestCase", "database/esper-cfg.xml");
+
+ // InMemory Database
+ db = createDatabase();
+
+ // test schema
+ db.update("CREATE TABLE quotes (" +
+ " symbol varchar(10) NOT NULL," +
+ " name varchar(50) NOT NULL," +
+ " price double NOT NULL," +
+ " PRIMARY KEY (symbol)" +
+ ")"
+ );
+
+ // test data
+ db.update("INSERT INTO quotes (symbol, name, price) VALUES ('IBM',
'IBM', 127.26)");
+ db.update("INSERT INTO quotes (symbol, name, price) VALUES ('MSFT',
'Microsoft', 27.36)");
+ db.update("INSERT INTO quotes (symbol, name, price) VALUES('AAPL',
'Apple', 184.96)" );
+ db.update("INSERT INTO quotes (symbol, name, price) VALUES('RHT',
'Red Hat', 22.82)");
+ db.update("INSERT INTO quotes (symbol, name, price) VALUES('ORCL',
'Oracle', 22.85)");
+ db.update("INSERT INTO quotes (symbol, name, price) VALUES('JAVA',
'Sun', 12.42)" );
+ db.update("INSERT INTO quotes (symbol, name, price) VALUES('GOOG',
'Goole', 572.51)");
+
+ db.query("SELECT symbol, price FROM quotes");
+ }
+
+
+ protected void tearDown() throws Exception
+ {
+ db.shutdown();
+ }
+
+ /**
+ * Fire a event to trigger the SQL query
+ */
+ public void testTriggeredSQLQuery() throws Exception
+ {
+ // setup
+ String epl = "select symbol, price from Query.win:length(1) as query," +
+ " sql:SamTestDB ['SELECT symbol, price FROM quotes WHERE symbol like
(${query.criteria})']";
+
+ Statement view =
eventProcessor.registerBoundStatement("InVM","TriggerSQL", epl);
+
+ // trigger
+ generateInVMEvent( new Query("%") );
+
+ // evaluate
+ assertTrue("Listener not invoked", bufferedOutput.isInvoked());
+ EventMessage[] lastnews = bufferedOutput.getLastNewData();
+ assertFalse(lastnews.length==0);
+
+ for(EventMessage event : lastnews)
+ {
+ System.out.println("symbol/price -> " +
event.getProperty("symbol") + "/" +
event.getProperty("price"));
+ }
+ }
+
+ public void testEsperPullAPI() throws Exception
+ {
+ System.out.println("FIXME ESPER-254: testPullAPI on database queries");
+
+ /*
+ Is going to be fixed in Esper 2.0.2
+ See
http://jira.codehaus.org/browse/ESPER-254
+
+ String aggregate = "insert into NewQuotes " +
+ "select symbol, price from " +
+ "pattern [every timer:interval(1 sec)], "+
+ "sql:SamTestDB ['select * from quotes']";
+
+ String action = "select * from NewQuotes.win:length(1)";
+
+ // create two views
+ EPLStatement aggregateView = runtime.registerStatement("PullAPI",
aggregate);
+ EPLStatement actionView = runtime.registerStatement("PullAPIAction",
action);
+
+ // bind pull listener to it
+ PullListener pullListener = new PullListener();
+ ((EsperEPLStatement)actionView).getUnderlying().addListener(pullListener);
+
+ // evaluate results
+ assertTrue("PullListener not invoked", pullListener.invoked);
+ assertTrue("No data pulled fronm DB",
pullListener.lastData.length>0);
+ */
+ }
+
+ class PullListener implements StatementAwareUpdateListener
+ {
+ public EventBean[] lastData = new EventBean[]{};
+ public boolean invoked;
+
+ public void update(EventBean[] newEvents, EventBean[] oldEvents,
+ EPStatement statement, EPServiceProvider epServiceProvider)
+ {
+ List<EventBean> batch = new ArrayList<EventBean>();
+ Iterator<EventBean> it = statement.iterator();
+ while(it.hasNext())
+ {
+ batch.add(it.next());
+ }
+ this.invoked = true;
+ this.lastData = batch.toArray(new EventBean[]{});
+ }
+ }
+}
Property changes on:
sam/trunk/src/test/java/org/jboss/test/sam/database/DatabaseTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/database/Query.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/database/Query.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/database/Query.java 2008-06-30 09:52:26 UTC
(rev 83)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.database;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class Query
+{
+ public String criteria;
+
+ public Query(String criteria)
+ {
+ this.criteria = criteria;
+ }
+
+
+ public String getCriteria()
+ {
+ return criteria;
+ }
+
+ public void setCriteria(String criteria)
+ {
+ this.criteria = criteria;
+ }
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/database/Query.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/sim/EventProcessorEntity.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/sim/EventProcessorEntity.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/sim/EventProcessorEntity.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.sim;
+
+import arjuna.JavaSim.Simulation.SimulationEntity;
+import org.jboss.sam.EventProcessor;
+import org.jboss.sam.StreamInput;
+import org.jboss.sam.EventProcessorFactory;
+import org.jboss.sam.StreamOutput;
+import org.jboss.sam.internal.stream.InVMStreamInput;
+import org.jboss.sam.internal.stream.InVMDispatcher;
+import org.jboss.sam.internal.esper.EsperRuntimeImpl;
+import com.espertech.esper.client.UnmatchedListener;
+import com.espertech.esper.event.EventBean;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class EventProcessorEntity extends SimulationEntity
+{
+ private EventProcessor eventProcessor;
+ private StreamInput streamInput;
+ private StreamOutput streamOutput;
+
+ private static InVMDispatcher dispatcher = new InVMDispatcher("Sim");
+
+ public EventProcessorEntity()
+ {
+ this.eventProcessor = EventProcessorFactory.newInstance().
+ createRuntime(
+ "Sim",
+
Thread.currentThread().getContextClassLoader().getResource("sim/esper-cfg.xml")
+ );
+
+ // create input and output
+ this.streamInput = new InVMStreamInput("Sim");
+ this.streamOutput = new EventSink("Sink");
+
+ // register in/out with hub
+ this.eventProcessor.addInput(streamInput);
+ this.eventProcessor.addOutput(streamOutput);
+
+ ((EsperRuntimeImpl) eventProcessor).getUnderlying().getEPRuntime()
+ .setUnmatchedListener(
+ new UnmatchedListener()
+ {
+
+ public void update(EventBean event)
+ {
+ System.out.println("! Unmatched event: " + event);
+ SimulationMain.numUnmatchedEvents++;
+ }
+ }
+ );
+
+ // bind the results to a stream output (EventSink)
+ this.eventProcessor.registerBoundStatement(
+ "Sink", "Monitor", "select * from
SensorEvent.win:length_batch(10)"
+ );
+ }
+
+ public static void dispatch(Object event)
+ {
+ SimulationMain.numDispatchedEvents++;
+ dispatcher.dispatch(event);
+ }
+}
Property changes on:
sam/trunk/src/test/java/org/jboss/test/sam/sim/EventProcessorEntity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSink.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSink.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSink.java 2008-06-30 09:52:26 UTC
(rev 83)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.sim;
+
+import org.jboss.sam.StreamOutput;
+import org.jboss.sam.EventMessage;
+import org.jboss.sam.chart.Chart;
+import org.jboss.sam.chart.PropertyMapping;
+import org.jboss.sam.chart.ChartMapping;
+import org.jboss.sam.chart.internal.jfree.BarChartBuilder;
+import org.jboss.sam.chart.internal.jfree.PieChartBuilder;
+import org.jfree.chart.JFreeChart;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class EventSink implements StreamOutput
+{
+ private String streamName;
+
+ public static Chart<JFreeChart> currentChart = null;
+
+ public EventSink(String streamName)
+ {
+ this.streamName = streamName;
+ }
+
+ public StreamOutput start()
+ {
+ return this;
+ }
+
+ public StreamOutput stop()
+ {
+ return this;
+ }
+
+ public boolean isStarted()
+ {
+ return true;
+ }
+
+ public String getStreamName()
+ {
+ return this.streamName;
+ }
+
+ public void write(EventMessage[] events)
+ {
+ long numEvents = events.length;
+ SimulationMain.numProcessedEvents += numEvents;
+ for(EventMessage e : events)
+ {
+ System.out.println(e.getUnderlying());
+ }
+
+ EventSink.currentChart = buildChart(events);
+ }
+
+ private Chart<JFreeChart> buildChart(EventMessage[] events)
+ {
+ ChartMapping mapping = valuePerSampleMapping();
+
+ Chart chart = new BarChartBuilder(
+ "Sensor simulation", "Sample", "Survey value")
+ .buildChart(events, mapping);
+
+ return chart;
+ }
+
+ private ChartMapping valuePerSampleMapping()
+ {
+ List<PropertyMapping> index = new ArrayList<PropertyMapping>();
+ index.add(new PropertyMapping(BarChartBuilder.INDEX_1, null).constant("Sensor
data"));
+ index.add(new PropertyMapping(BarChartBuilder.INDEX_2, "simTime"));
+
+ List<PropertyMapping> data = new ArrayList<PropertyMapping>();
+ data.add(new PropertyMapping(BarChartBuilder.PROP_1, "surveyValue"));
+
+ ChartMapping mapping = new ChartMapping("Sensor value per sample", index,
data); // could be serialzed
+ return mapping;
+ }
+
+ private ChartMapping sinkDistributionMapping()
+ {
+ List<PropertyMapping> index = new ArrayList<PropertyMapping>();
+ index.add(new PropertyMapping(PieChartBuilder.INDEX_1, "source"));
+
+ List<PropertyMapping> data = new ArrayList<PropertyMapping>();
+ data.add(new PropertyMapping(PieChartBuilder.DATA_1, "numEvents"));
+
+ ChartMapping mapping = new ChartMapping("Sensor event per EventSink",
index, data);
+ return mapping;
+ }
+
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSink.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSourceEntity.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSourceEntity.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSourceEntity.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.sim;
+
+import arjuna.JavaSim.Simulation.SimulationEntity;
+import arjuna.JavaSim.Simulation.SimulationException;
+import arjuna.JavaSim.Simulation.RestartException;
+import arjuna.JavaSim.Simulation.Scheduler;
+import arjuna.JavaSim.Distributions.ExponentialStream;
+
+import java.io.IOException;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class EventSourceEntity extends SimulationEntity
+{
+ private ExponentialStream InterArrivalTime;
+ private ExponentialStream STime;
+ private String sinkName;
+
+ public EventSourceEntity(String sinkName, double creationMean)
+ {
+ this.sinkName = sinkName;
+ InterArrivalTime = new ExponentialStream(creationMean);
+ this.STime = new ExponentialStream(1,5);
+ }
+
+ public void run()
+ {
+ for (; ;)
+ {
+ try
+ {
+ Hold(InterArrivalTime.getNumber());
+ }
+ catch (SimulationException e)
+ {
+ }
+ catch (RestartException e)
+ {
+ }
+ catch (IOException e)
+ {
+ }
+
+ // TODO: create an event here
+ EventProcessorEntity.dispatch( new SensorEventMessage(sinkName,
getSurveyValue(), Scheduler.CurrentTime()) );
+ }
+ }
+
+ public double getSurveyValue()
+ {
+ try
+ {
+ return STime.getNumber();
+ }
+ catch (IOException e)
+ {
+ return 0.0;
+ }
+ }
+
+}
Property changes on:
sam/trunk/src/test/java/org/jboss/test/sam/sim/EventSourceEntity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/sim/SensorEventMessage.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/sim/SensorEventMessage.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/sim/SensorEventMessage.java 2008-06-30
09:52:26 UTC (rev 83)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.sim;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class SensorEventMessage
+{
+ private String source;
+ private double surveyValue;
+ private double simTime;
+
+ public SensorEventMessage(String source, double threshold, double simTime)
+ {
+ this.source = source;
+ this.surveyValue = threshold;
+ this.simTime = simTime;
+ }
+
+ public String getSource()
+ {
+ return source;
+ }
+
+ public double getSurveyValue()
+ {
+ return surveyValue;
+ }
+
+ public double getSimTime()
+ {
+ return simTime;
+ }
+
+ public String toString()
+ {
+ return "[@"+simTime+":
"+source+"->"+surveyValue+"]";
+ }
+}
Property changes on:
sam/trunk/src/test/java/org/jboss/test/sam/sim/SensorEventMessage.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/java/org/jboss/test/sam/sim/SimulationMain.java
===================================================================
--- sam/trunk/src/test/java/org/jboss/test/sam/sim/SimulationMain.java
(rev 0)
+++ sam/trunk/src/test/java/org/jboss/test/sam/sim/SimulationMain.java 2008-06-30 09:52:26
UTC (rev 83)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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 (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.sam.sim;
+
+import arjuna.JavaSim.Simulation.SimulationProcess;
+import arjuna.JavaSim.Simulation.Scheduler;
+import org.jboss.test.sam.JFreeChartViewer;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class SimulationMain extends SimulationProcess
+{
+ public static long numProcessedEvents = 0;
+ public static long numUnmatchedEvents = 0;
+ public static long numDispatchedEvents = 0;
+
+ private EventProcessorEntity eventProcessor;
+ private EventSourceEntity eventSource_A;
+ private EventSourceEntity eventSource_B;
+
+ private static final int TOTAL_SIM_TIME = 50;
+
+ public static void main (String[] args)
+ {
+ SimulationMain c = new SimulationMain();
+ c.await();
+ }
+
+ public void run()
+ {
+ eventProcessor = new EventProcessorEntity();
+ eventSource_A = new EventSourceEntity("EventSink-A", 4);
+ eventSource_B = new EventSourceEntity("EventSink-B", 8);
+
+ try
+ {
+ eventSource_A.Activate();
+ eventSource_B.Activate();
+
+ // start
+ Scheduler.startSimulation();
+
+ double end = Scheduler.CurrentTime()+ TOTAL_SIM_TIME;
+ while(Scheduler.CurrentTime()<end)
+ Hold(10);
+
+ System.out.println("Dispatched: " +numDispatchedEvents);
+ System.out.println("Processed: " +numProcessedEvents);
+ System.out.println("Unmatched: " +numUnmatchedEvents);
+
+ // cleanup
+ Scheduler.stopSimulation();
+ eventSource_A.terminate();
+ eventSource_B.terminate();
+
+ if(EventSink.currentChart!=null)
+ {
+ new
JFreeChartViewer().setChart(EventSink.currentChart.getUnderlying()).display();
+ SimulationProcess.mainSuspend();
+ }
+ else
+ {
+ System.out.println("* No chart rendered *");
+ System.exit(0);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void await()
+ {
+ this.Resume();
+ SimulationProcess.mainSuspend();
+ }
+
+ public void exit()
+ {
+ try
+ {
+ SimulationProcess.mainResume();
+ Suspend();
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+ }
+}
Property changes on: sam/trunk/src/test/java/org/jboss/test/sam/sim/SimulationMain.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/resources/adapter/invm/esper-cfg.xml
===================================================================
--- sam/trunk/src/test/resources/adapter/invm/esper-cfg.xml (rev
0)
+++ sam/trunk/src/test/resources/adapter/invm/esper-cfg.xml 2008-06-30 09:52:26 UTC (rev
83)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Sample configuration file.
+-->
+<esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+
+ <!--
+ Adds a Java package name of a package that Java event classes reside in.
+ This setting allows an application to place all it's events into one or more Java
packages
+ and then declare these packages.
+ The engine attempts to resolve an event type alias to a Java class residing in each
declared package.
+ -->
+ <event-type-auto-alias
package-name="org.jboss.test.sam.adapter.invm"/>
+
+ <!--
+ Sample configuration for database access using DriverManager;
+ retains connections associated with a statement, closing the connection when a
statement is stopped
+ -->
+ <database-reference name="mysql1">
+ <drivermanager-connection class-name="com.mysql.jdbc.Driver"
+
url="jdbc:mysql://localhost/mysql1?user=root&password="
+ user="jbossfx" password="">
+ <connection-arg name="user" value ="root"/>
+ <connection-arg name="password" value =""/>
+ </drivermanager-connection>
+ <!--
+ Retains connection associated with a statement, closing a connection only when a
statement is stopped
+ -->
+ <connection-lifecycle value="retain"/>
+ <!--
+ Configures an optional time-based cache with a maximum age in seconds and a purge
interval,
+ and an optional reference strategy
+ -->
+ <expiry-time-cache max-age-seconds="60"
purge-interval-seconds="120" ref-type="weak"/>
+ </database-reference>
+
+ <!--
+ Sample engine settings
+ -->
+ <engine-settings>
+ <defaults>
+ <threading>
+ <!--
+ In multithreaded environments, this setting controls whether dispatches to
listeners
+ preserve the ordering in which the statement processes events
+ -->
+ <listener-dispatch preserve-order="true"
timeout-msec="1000" locking="spin"/>
+ <!--
+ In multithreaded environments, this setting controls whether insert-into
streams
+ preserve the order of events inserted into them by one or more statements,
+ allowing statements that consume other statement's events to behave
deterministic.
+ -->
+ <insert-into-dispatch preserve-order="true"
timeout-msec="100" locking="spin"/>
+ <!-- These settings define the resolution of the internal timer thread,
+ and can disable the timer to indicate that the application supplies the
timer events
+ -->
+ <internal-timer enabled="true"
msec-resolution="100"/>
+ </threading>
+ <event-meta>
+ <!--
+ Lets configure the engine to use case-insensitive resolution for event
properties
+ -->
+ <class-property-resolution
style="distinct_case_insensitive"/>
+ </event-meta>
+ <view-resources>
+ <!--
+ Lets configure the engine to reuse views, which is the default but can
introduce additional locking
+ -->
+ <share-views enabled="true"/>
+ </view-resources>
+ <logging>
+ <!--
+ By default the engine does not generate logging through Log4j of the event
processing execution path.
+ To get debug output, set this flag to true. This setting translates into a
static boolean flag
+ and thus may apply to multiple engine instances within a given VM.
+ -->
+ <execution-path enabled="false" />
+ </logging>
+ <stream-selection>
+ <!--
+ By default the engine generates output for the insert stream only, and not
for the remove stream.
+ To obtain output for remove stream only, or for insert stream and remove
stream,
+ there are keywords "rstream" and "irstream" for use in
the select clause.
+ This setting controls the default behavior, if no keyword is specified in
the select-clause by statements.
+ -->
+ <stream-selector value="irstream" />
+ </stream-selection>
+ <time-source>
+ <!--
+ By default the time source is System.currentTimeMillis.
+ This sample configures the nano-second time call System.nanoTime() as the
time source,
+ which Esper adjusts for wall clock time.
+ -->
+ <time-source-type value="nano" />
+ </time-source>
+ </defaults>
+ </engine-settings>
+
+</esper-configuration>
Property changes on: sam/trunk/src/test/resources/adapter/invm/esper-cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/resources/database/esper-cfg.xml
===================================================================
--- sam/trunk/src/test/resources/database/esper-cfg.xml (rev 0)
+++ sam/trunk/src/test/resources/database/esper-cfg.xml 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Sample configuration file.
+-->
+<esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+
+ <!--
+ Adds a Java package name of a package that Java event classes reside in.
+ This setting allows an application to place all it's events into one or more Java
packages
+ and then declare these packages.
+ The engine attempts to resolve an event type alias to a Java class residing in each
declared package.
+ -->
+ <event-type-auto-alias package-name="org.jboss.test.sam.database"/>
+
+ <!--
+ Sample configuration for database access using DriverManager;
+ retains connections associated with a statement, closing the connection when a
statement is stopped
+ -->
+
+ <!--database-reference name="MySQLDB">
+ <drivermanager-connection class-name="com.mysql.jdbc.Driver"
+
url="jdbc:mysql://localhost/mysql1?user=root&password="
+ user="jbossfx" password="">
+ <connection-arg name="user" value ="root"/>
+ <connection-arg name="password" value =""/>
+ </drivermanager-connection>
+ <connection-lifecycle value="retain"/>
+ <expiry-time-cache max-age-seconds="60"
purge-interval-seconds="120" ref-type="weak"/>
+ </database-reference-->
+
+ <database-reference name="SamTestDB">
+ <drivermanager-connection class-name="org.hsqldb.jdbcDriver"
+
url="jdbc:hsqldb:mem:SamTestSetup;get_column_name=true"
+ user="jbossfx" password="">
+ <connection-arg name="user" value ="sa"/>
+ <connection-arg name="password" value =""/>
+ </drivermanager-connection>
+
+ <connection-lifecycle value="retain"/>
+ <expiry-time-cache max-age-seconds="60"
purge-interval-seconds="120" ref-type="weak"/>
+ <column-change-case value="lowercase"/> <!-- important -->
+ </database-reference>
+
+ <!--
+ Sample engine settings
+ -->
+ <engine-settings>
+ <defaults>
+ <threading>
+ <!--
+ In multithreaded environments, this setting controls whether dispatches to
listeners
+ preserve the ordering in which the statement processes events
+ -->
+ <listener-dispatch preserve-order="true"
timeout-msec="1000" locking="spin"/>
+ <!--
+ In multithreaded environments, this setting controls whether insert-into
streams
+ preserve the order of events inserted into them by one or more statements,
+ allowing statements that consume other statement's events to behave
deterministic.
+ -->
+ <insert-into-dispatch preserve-order="true"
timeout-msec="100" locking="spin"/>
+ <!-- These settings define the resolution of the internal timer thread,
+ and can disable the timer to indicate that the application supplies the
timer events
+ -->
+ <internal-timer enabled="true"
msec-resolution="100"/>
+ </threading>
+ <event-meta>
+ <!--
+ Lets configure the engine to use case-insensitive resolution for event
properties
+ -->
+ <class-property-resolution
style="distinct_case_insensitive"/>
+ </event-meta>
+ <view-resources>
+ <!--
+ Lets configure the engine to reuse views, which is the default but can
introduce additional locking
+ -->
+ <share-views enabled="true"/>
+ </view-resources>
+ <logging>
+ <!--
+ By default the engine does not generate logging through Log4j of the event
processing execution path.
+ To get debug output, set this flag to true. This setting translates into a
static boolean flag
+ and thus may apply to multiple engine instances within a given VM.
+ -->
+ <execution-path enabled="false" />
+ </logging>
+ <stream-selection>
+ <!--
+ By default the engine generates output for the insert stream only, and not
for the remove stream.
+ To obtain output for remove stream only, or for insert stream and remove
stream,
+ there are keywords "rstream" and "irstream" for use in
the select clause.
+ This setting controls the default behavior, if no keyword is specified in
the select-clause by statements.
+ -->
+ <stream-selector value="irstream" />
+ </stream-selection>
+ <time-source>
+ <!--
+ By default the time source is System.currentTimeMillis.
+ This sample configures the nano-second time call System.nanoTime() as the
time source,
+ which Esper adjusts for wall clock time.
+ -->
+ <time-source-type value="nano" />
+ </time-source>
+ </defaults>
+ </engine-settings>
+
+</esper-configuration>
Property changes on: sam/trunk/src/test/resources/database/esper-cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/resources/sim/esper-cfg.xml
===================================================================
--- sam/trunk/src/test/resources/sim/esper-cfg.xml (rev 0)
+++ sam/trunk/src/test/resources/sim/esper-cfg.xml 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Sample configuration file.
+-->
+<esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+
+ <!--
+ Adds a Java package name of a package that Java event classes reside in.
+ This setting allows an application to place all it's events into one or more Java
packages
+ and then declare these packages.
+ The engine attempts to resolve an event type alias to a Java class residing in each
declared package.
+ -->
+ <event-type-auto-alias package-name="org.jboss.test.sam.sim"/>
+
+ <!--
+ Sample engine settings
+ -->
+ <engine-settings>
+ <defaults>
+ <threading>
+ <!--
+ In multithreaded environments, this setting controls whether dispatches to
listeners
+ preserve the ordering in which the statement processes events
+ -->
+ <listener-dispatch preserve-order="true"
timeout-msec="1000" locking="spin"/>
+ <!--
+ In multithreaded environments, this setting controls whether insert-into
streams
+ preserve the order of events inserted into them by one or more statements,
+ allowing statements that consume other statement's events to behave
deterministic.
+ -->
+ <insert-into-dispatch preserve-order="true"
timeout-msec="100" locking="spin"/>
+ <!-- These settings define the resolution of the internal timer thread,
+ and can disable the timer to indicate that the application supplies the
timer events
+ -->
+ <internal-timer enabled="true"
msec-resolution="100"/>
+ </threading>
+ <event-meta>
+ <!--
+ Lets configure the engine to use case-insensitive resolution for event
properties
+ -->
+ <class-property-resolution
style="distinct_case_insensitive"/>
+ </event-meta>
+ <view-resources>
+ <!--
+ Lets configure the engine to reuse views, which is the default but can
introduce additional locking
+ -->
+ <share-views enabled="true"/>
+ </view-resources>
+ <logging>
+ <!--
+ By default the engine does not generate logging through Log4j of the event
processing execution path.
+ To get debug output, set this flag to true. This setting translates into a
static boolean flag
+ and thus may apply to multiple engine instances within a given VM.
+ -->
+ <execution-path enabled="false" />
+ </logging>
+ <stream-selection>
+ <!--
+ By default the engine generates output for the insert stream only, and not
for the remove stream.
+ To obtain output for remove stream only, or for insert stream and remove
stream,
+ there are keywords "rstream" and "irstream" for use in
the select clause.
+ This setting controls the default behavior, if no keyword is specified in
the select-clause by statements.
+ -->
+ <stream-selector value="irstream" />
+ </stream-selection>
+ <time-source>
+ <!--
+ By default the time source is System.currentTimeMillis.
+ This sample configures the nano-second time call System.nanoTime() as the
time source,
+ which Esper adjusts for wall clock time.
+ -->
+ <time-source-type value="nano" />
+ </time-source>
+ </defaults>
+ </engine-settings>
+
+</esper-configuration>
Property changes on: sam/trunk/src/test/resources/sim/esper-cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: sam/trunk/src/test/resources/viz/esper-cfg.xml
===================================================================
--- sam/trunk/src/test/resources/viz/esper-cfg.xml (rev 0)
+++ sam/trunk/src/test/resources/viz/esper-cfg.xml 2008-06-30 09:52:26 UTC (rev 83)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Sample configuration file.
+-->
+<esper-configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://www.espertech.com/schema/esper"
+
xsi:noNamespaceSchemaLocation="esper-configuration-2-0.xsd">
+
+ <!--
+ Adds a Java package name of a package that Java event classes reside in.
+ This setting allows an application to place all it's events into one or more Java
packages
+ and then declare these packages.
+ The engine attempts to resolve an event type alias to a Java class residing in each
declared package.
+ -->
+ <event-type-auto-alias
package-name="org.jboss.test.sam.adapter.invm"/>
+
+ <!--
+ Sample configuration for database access using DriverManager;
+ retains connections associated with a statement, closing the connection when a
statement is stopped
+ -->
+ <database-reference name="mysql1">
+ <drivermanager-connection class-name="com.mysql.jdbc.Driver"
+
url="jdbc:mysql://localhost/mysql1?user=root&password="
+ user="jbossfx" password="">
+ <connection-arg name="user" value ="root"/>
+ <connection-arg name="password" value =""/>
+ </drivermanager-connection>
+ <!--
+ Retains connection associated with a statement, closing a connection only when a
statement is stopped
+ -->
+ <connection-lifecycle value="retain"/>
+ <!--
+ Configures an optional time-based cache with a maximum age in seconds and a purge
interval,
+ and an optional reference strategy
+ -->
+ <expiry-time-cache max-age-seconds="60"
purge-interval-seconds="120" ref-type="weak"/>
+ </database-reference>
+
+ <!--
+ Sample engine settings
+ -->
+ <engine-settings>
+ <defaults>
+ <threading>
+ <!--
+ In multithreaded environments, this setting controls whether dispatches to
listeners
+ preserve the ordering in which the statement processes events
+ -->
+ <listener-dispatch preserve-order="true"
timeout-msec="1000" locking="spin"/>
+ <!--
+ In multithreaded environments, this setting controls whether insert-into
streams
+ preserve the order of events inserted into them by one or more statements,
+ allowing statements that consume other statement's events to behave
deterministic.
+ -->
+ <insert-into-dispatch preserve-order="true"
timeout-msec="100" locking="spin"/>
+ <!-- These settings define the resolution of the internal timer thread,
+ and can disable the timer to indicate that the application supplies the
timer events
+ -->
+ <internal-timer enabled="true"
msec-resolution="100"/>
+ </threading>
+ <event-meta>
+ <!--
+ Lets configure the engine to use case-insensitive resolution for event
properties
+ -->
+ <class-property-resolution
style="distinct_case_insensitive"/>
+ </event-meta>
+ <view-resources>
+ <!--
+ Lets configure the engine to reuse views, which is the default but can
introduce additional locking
+ -->
+ <share-views enabled="true"/>
+ </view-resources>
+ <logging>
+ <!--
+ By default the engine does not generate logging through Log4j of the event
processing execution path.
+ To get debug output, set this flag to true. This setting translates into a
static boolean flag
+ and thus may apply to multiple engine instances within a given VM.
+ -->
+ <execution-path enabled="false" />
+ </logging>
+ <stream-selection>
+ <!--
+ By default the engine generates output for the insert stream only, and not
for the remove stream.
+ To obtain output for remove stream only, or for insert stream and remove
stream,
+ there are keywords "rstream" and "irstream" for use in
the select clause.
+ This setting controls the default behavior, if no keyword is specified in
the select-clause by statements.
+ -->
+ <stream-selector value="irstream" />
+ </stream-selection>
+ <time-source>
+ <!--
+ By default the time source is System.currentTimeMillis.
+ This sample configures the nano-second time call System.nanoTime() as the
time source,
+ which Esper adjusts for wall clock time.
+ -->
+ <time-source-type value="nano" />
+ </time-source>
+ </defaults>
+ </engine-settings>
+
+</esper-configuration>
Property changes on: sam/trunk/src/test/resources/viz/esper-cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF