teiid SVN: r2071 - trunk/console/src/main/java/org/teiid/rhq/plugin.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-04-21 15:07:27 -0400 (Wed, 21 Apr 2010)
New Revision: 2071
Modified:
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
Log:
Fix null resource configuration for VDB metrics
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-04-21 18:19:46 UTC (rev 2070)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-04-21 19:07:27 UTC (rev 2071)
@@ -77,6 +77,7 @@
public void start(ResourceContext context) {
this.setComponentName(context.getPluginConfiguration().getSimpleValue(
"name", null));
+ this.resourceConfiguration=context.getPluginConfiguration();
super.start(context);
}
14 years, 8 months
teiid SVN: r2070 - trunk/documentation/admin-guide/src/main/docbook/en-US/content.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-21 14:19:46 -0400 (Wed, 21 Apr 2010)
New Revision: 2070
Modified:
trunk/documentation/admin-guide/src/main/docbook/en-US/content/appendix-a.xml
Log:
TEIID-1052 adding faq about the difference between console and shell
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/appendix-a.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/appendix-a.xml 2010-04-21 17:46:11 UTC (rev 2069)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/appendix-a.xml 2010-04-21 18:19:46 UTC (rev 2070)
@@ -1,8 +1,18 @@
<appendix id="faq">
<title>Frequently Asked Questions</title>
<qandaset>
+
<qandaentry>
<question>
+ <para>Why won't the adminhelp command work in the Console tool?</para>
+ </question>
+ <answer>
+ <para>The Console environment does not understand Shell commands (load, help, adminhelp, etc.), since they are not directly supported by Groovy. In the Console you should use the equivalent functional form / Groovy, e.g. instead of adminhelp, adminHelp()</para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
<para>Are there any pre-built scripts available?</para>
</question>
<answer>
@@ -21,7 +31,7 @@
<qandaentry>
<question>
- <para>What is different between "connectAsAdmin()" and "connect()" ?</para>
+ <para>What is different between "connectAsAdmin()" and "connect()"?</para>
</question>
<answer>
<para>The connectAsAdmin methods create a contextual connection to the AdminAPI of the Teiid Server. The connect methods return an extension of the Groovy Sql object to be used for Sql calls to the Teiid Server.</para>
@@ -33,7 +43,7 @@
<para>Is IDE support available for writing the scripts?</para>
</question>
<answer>
- <para>The AdminConsole tool is a light IDE. Full IDE support is available for Groovy, but requires manual manipulation of the class path and script imports. See <link linkend="other_environments">using AdminShell methods in other environments</link>.</para>
+ <para>The Admin Console tool is a light-weight IDE. Full IDE support is available for Groovy, but requires manual manipulation of the class path and script imports. See <link linkend="other_environments">using AdminShell methods in other environments</link>.</para>
</answer>
</qandaentry>
14 years, 8 months
teiid SVN: r2069 - in trunk: adminshell/src/main/resources/org/codehaus/groovy/tools/shell and 6 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-21 13:46:11 -0400 (Wed, 21 Apr 2010)
New Revision: 2069
Added:
trunk/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java
trunk/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties
trunk/build/kits/
trunk/build/kits/adminshell/
trunk/build/kits/jboss-container/
Removed:
trunk/build/kit-adminshell/
trunk/build/kit-jboss-container/
Modified:
trunk/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java
trunk/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java
trunk/adminshell/src/main/java/org/teiid/adminshell/Help.java
trunk/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml
trunk/build/assembly/adminshell/adminshell-dist.xml
trunk/build/assembly/jboss-container/dist.xml
trunk/build/kits/adminshell/adminconsole.bat
trunk/build/kits/adminshell/adminconsole.sh
trunk/build/kits/adminshell/adminshell.bat
trunk/build/kits/adminshell/adminshell.sh
trunk/build/pom.xml
Log:
TEIID-1052 fixing classpath of the adminshell and adding the sql help as a command.
Modified: trunk/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java 2010-04-21 16:42:57 UTC (rev 2068)
+++ trunk/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java 2010-04-21 17:46:11 UTC (rev 2069)
@@ -36,9 +36,9 @@
public class GroovyAdminConsole {
- public static final String IMPORTS = "import static " + AdminShell.class.getName() + ".*\n" + //$NON-NLS-1$ //$NON-NLS-2$
- "import static " + GroovySqlExtensions.class.getName() + ".*\n" + //$NON-NLS-1$ //$NON-NLS-2$
- "import " + Admin.class.getPackage().getName() + ".*\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ public static final String IMPORTS = "import static " + AdminShell.class.getName() + ".*;\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ "import static " + GroovySqlExtensions.class.getName() + ".*;\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ "import " + Admin.class.getPackage().getName() + ".*;\n"; //$NON-NLS-1$ //$NON-NLS-2$
public static void main(String[] args) throws Exception {
// allow the full stack traces to bubble up to the root logger
Modified: trunk/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java 2010-04-21 16:42:57 UTC (rev 2068)
+++ trunk/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java 2010-04-21 17:46:11 UTC (rev 2069)
@@ -43,7 +43,7 @@
private static Help help = new Help(GroovySqlExtensions.class);
- @Help.Doc(text = "Get a Teiid connection - using connection.properties")
+ @Help.Doc(text = "Get a Teiid connection with a URL")
public static TeiidSql connect(
@Help.Doc(text = "url") String url) throws SQLException {
return connect(url, null, null);
@@ -76,8 +76,8 @@
AdminShell.p.getProperty("jdbc.user", "admin"), AdminShell.p.getProperty("jdbc.password", "teiid"));
}
- @Help.Doc(text = "Alternate row to String method that pretty prints SQL/XML," +
- " \ne.g. sql.eachRow(\"select * from tables\", {row -> println rowToString(row) })")
+ @Help.Doc(text = "Alternate row to String method that pretty prints SQL/XML",
+ moreText = "e.g. sql.eachRow(\"select * from tables\", {row -> println rowToString(row) })")
public static String rowToString(ResultSet results) throws SQLException {
StringBuilder sb = new StringBuilder();
//alternative toString - see GroovyResultSetExtension
@@ -103,17 +103,19 @@
return sb.toString();
}
- @Help.Doc(text = "Pretty prints the ResultSetMetadata")
+ @Help.Doc(text = "Pretty prints the ResultSetMetadata",
+ moreText = {"e.g. sql.eachRow(\"select * from tables\", {rsmd -> println resultSetMetaDataToString(rsmd)},",
+ " {row -> println rowToString(row) })"})
public static String resultSetMetaDataToString(ResultSetMetaData rsmd) throws SQLException {
return ResultSetReader.resultSetMetaDataToString(rsmd, " "); //$NON-NLS-1$
}
- @Help.Doc(text = "Show help for all Sql methods")
+ @Help.Doc(text = "Show help for all SQL Extension methods")
public static void sqlHelp() {
help.help();
}
- @Help.Doc(text = "Show help for the given Sql method")
+ @Help.Doc(text = "Show help for the given SQL Extension method")
public static void sqlHelp(
@Help.Doc(text = "method name") String method) {
help.help(method);
Modified: trunk/adminshell/src/main/java/org/teiid/adminshell/Help.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/adminshell/Help.java 2010-04-21 16:42:57 UTC (rev 2068)
+++ trunk/adminshell/src/main/java/org/teiid/adminshell/Help.java 2010-04-21 17:46:11 UTC (rev 2069)
@@ -46,6 +46,7 @@
@Target({ElementType.METHOD, ElementType.PARAMETER})
public @interface Doc {
String text();
+ String[] moreText() default {};
}
private TreeMap<String, List<String>> help = new TreeMap<String, List<String>>();
@@ -66,8 +67,12 @@
}
shortSb.append(")"); //$NON-NLS-1$
String shortHelpStr = String.format(" %-25s", shortSb.toString()); //$NON-NLS-1$
- if (doc != null && doc.text() != null) {
- sb.append("/*\n *").append(doc.text()).append("\n */\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (doc != null) {
+ sb.append("/*\n *").append(doc.text()); //$NON-NLS-1$
+ for (String string : doc.moreText()) {
+ sb.append("\n *").append(string); //$NON-NLS-1$
+ }
+ sb.append("\n */\n"); //$NON-NLS-1$
shortHelpStr += " -- " + doc.text(); //$NON-NLS-1$
}
shortHelp.add(shortHelpStr);
@@ -108,7 +113,7 @@
}
public void help() {
- System.out.println("/* method(arg count) -- description */"); //$NON-NLS-1$
+ System.out.println("/* method(arg count) -- description */"); //$NON-NLS-1$
for (String helpString : shortHelp) {
System.out.println(helpString);
}
Added: trunk/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java (rev 0)
+++ trunk/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java 2010-04-21 17:46:11 UTC (rev 2069)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General public static
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 static License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General public static
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.adminshell;
+
+import java.util.List;
+
+import org.codehaus.groovy.tools.shell.CommandSupport;
+import org.codehaus.groovy.tools.shell.Shell;
+
+public class SqlHelpCommand extends CommandSupport {
+
+ protected SqlHelpCommand(Shell shell) {
+ super(shell, "sqlhelp", "\\sh"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ public Object execute(List args) {
+ if (args.size() > 1) {
+ fail(messages.format("error.unexpected_args", new Object[] {args.toString()})); //$NON-NLS-1$
+ }
+ if (args.isEmpty()) {
+ GroovySqlExtensions.sqlHelp();
+ } else {
+ GroovySqlExtensions.sqlHelp(args.get(0).toString());
+ }
+ return null;
+ }
+
+}
Property changes on: trunk/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml
===================================================================
--- trunk/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml 2010-04-21 16:42:57 UTC (rev 2068)
+++ trunk/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml 2010-04-21 17:46:11 UTC (rev 2069)
@@ -53,5 +53,7 @@
<command>org.codehaus.groovy.tools.shell.commands.RegisterCommand</command>
<command>org.teiid.adminshell.AdminHelpCommand</command>
+
+ <command>org.teiid.adminshell.SqlHelpCommand</command>
</commands>
Added: trunk/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties
===================================================================
--- trunk/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties (rev 0)
+++ trunk/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties 2010-04-21 17:46:11 UTC (rev 2069)
@@ -0,0 +1,3 @@
+command.description=Display Teiid SQL Extension Help
+command.usage=[<method>]
+command.help=Display the list of Teiid SQL Extension methods or the help text for @|BOLD method|@. This reports the same information as the sqlHelp([method]) function.
\ No newline at end of file
Property changes on: trunk/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/build/assembly/adminshell/adminshell-dist.xml
===================================================================
--- trunk/build/assembly/adminshell/adminshell-dist.xml 2010-04-21 16:42:57 UTC (rev 2068)
+++ trunk/build/assembly/adminshell/adminshell-dist.xml 2010-04-21 17:46:11 UTC (rev 2069)
@@ -39,7 +39,7 @@
<fileSets>
<fileSet>
- <directory>build/kit-adminshell</directory>
+ <directory>build/target/kits/adminshell</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>**/*.sh</include>
@@ -48,7 +48,7 @@
</fileSet>
<fileSet>
- <directory>build/kit-adminshell</directory>
+ <directory>build/target/kits/adminshell</directory>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>**/*.sh</exclude>
Modified: trunk/build/assembly/jboss-container/dist.xml
===================================================================
--- trunk/build/assembly/jboss-container/dist.xml 2010-04-21 16:42:57 UTC (rev 2068)
+++ trunk/build/assembly/jboss-container/dist.xml 2010-04-21 17:46:11 UTC (rev 2069)
@@ -13,7 +13,7 @@
<fileSets>
<fileSet>
- <directory>build/target/kit-jboss-container</directory>
+ <directory>build/target/kits/jboss-container</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
Copied: trunk/build/kits/adminshell (from rev 2065, trunk/build/kit-adminshell)
Modified: trunk/build/kits/adminshell/adminconsole.bat
===================================================================
--- trunk/build/kit-adminshell/adminconsole.bat 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/build/kits/adminshell/adminconsole.bat 2010-04-21 17:46:11 UTC (rev 2069)
@@ -53,7 +53,7 @@
)
)
-set TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\lib\*;
+set TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\lib\teiid-adminshell-${pom.version}.jar;%TEIID_HOME%\lib\*;
rem JVM memory allocation pool parameters. Modify as appropriate.
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -XX:MaxPermSize=256m
Modified: trunk/build/kits/adminshell/adminconsole.sh
===================================================================
--- trunk/build/kit-adminshell/adminconsole.sh 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/build/kits/adminshell/adminconsole.sh 2010-04-21 17:46:11 UTC (rev 2069)
@@ -63,7 +63,7 @@
# JPDA options. Uncomment and modify as appropriate to enable remote debugging.
# JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
-TEIID_CLASSPATH="$TEIID_HOME/lib/patches/*:$TEIID_HOME/lib/*"
+TEIID_CLASSPATH="$TEIID_HOME/lib/patches/*:$TEIID_HOME/lib/teiid-adminshell-${pom.version}.jar:$TEIID_HOME/lib/*"
JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx256m -XX:MaxPermSize=256m"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.config.file=log.properties"
Modified: trunk/build/kits/adminshell/adminshell.bat
===================================================================
--- trunk/build/kit-adminshell/adminshell.bat 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/build/kits/adminshell/adminshell.bat 2010-04-21 17:46:11 UTC (rev 2069)
@@ -53,7 +53,7 @@
)
)
-set TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\lib\*;
+set TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\lib\teiid-adminshell-${pom.version}.jar;%TEIID_HOME%\lib\*;
rem JVM memory allocation pool parameters. Modify as appropriate.
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -XX:MaxPermSize=256m
Modified: trunk/build/kits/adminshell/adminshell.sh
===================================================================
--- trunk/build/kit-adminshell/adminshell.sh 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/build/kits/adminshell/adminshell.sh 2010-04-21 17:46:11 UTC (rev 2069)
@@ -63,7 +63,7 @@
# JPDA options. Uncomment and modify as appropriate to enable remote debugging.
# JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
-TEIID_CLASSPATH="$TEIID_HOME/lib/patches/*:$TEIID_HOME/lib/*"
+TEIID_CLASSPATH="$TEIID_HOME/lib/patches/*:$TEIID_HOME/lib/teiid-adminshell-${pom.version}.jar:$TEIID_HOME/lib/*"
JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx256m -XX:MaxPermSize=256m"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.config.file=log.properties"
Copied: trunk/build/kits/jboss-container (from rev 2065, trunk/build/kit-jboss-container)
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2010-04-21 16:42:57 UTC (rev 2068)
+++ trunk/build/pom.xml 2010-04-21 17:46:11 UTC (rev 2069)
@@ -10,20 +10,26 @@
<name>Build</name>
<description>Teiid Build</description>
<build>
- <outputDirectory>target/kit-jboss-container</outputDirectory>
+ <outputDirectory>target/kits</outputDirectory>
<resources>
<resource>
- <directory>kit-jboss-container</directory>
+ <directory>kits</directory>
<filtering>true</filtering>
<includes>
<include>**/*.xml</include>
+ <include>**/*.properties</include>
+ <include>**/*.sh</include>
+ <include>**/*.bat</include>
</includes>
</resource>
<resource>
- <directory>kit-jboss-container</directory>
+ <directory>kits</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ <exclude>**/*.sh</exclude>
+ <exclude>**/*.bat</exclude>
</excludes>
</resource>
</resources>
14 years, 8 months
teiid SVN: r2068 - trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-21 12:42:57 -0400 (Wed, 21 Apr 2010)
New Revision: 2068
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
Log:
TEIID-1012 combining the log configuration and listener interfaces
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-04-21 16:35:49 UTC (rev 2067)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-04-21 16:42:57 UTC (rev 2068)
@@ -52,7 +52,7 @@
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.core.log.MessageLevel;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.dqp.message.AtomicRequestID;
14 years, 8 months
teiid SVN: r2067 - trunk/engine/src/main/java/org/teiid/dqp/internal/process.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-21 12:35:49 -0400 (Wed, 21 Apr 2010)
New Revision: 2067
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/StatsCapturingWorkManager.java
Log:
TEIID-1012 combining the log configuration and listener interfaces
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/StatsCapturingWorkManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/StatsCapturingWorkManager.java 2010-04-21 15:51:54 UTC (rev 2066)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/StatsCapturingWorkManager.java 2010-04-21 16:35:49 UTC (rev 2067)
@@ -46,7 +46,7 @@
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.core.log.MessageLevel;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.core.util.NamedThreadFactory;
import com.metamatrix.query.QueryPlugin;
14 years, 8 months
teiid SVN: r2066 - in trunk: common-core/src/test/java/com/metamatrix/core and 14 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-21 11:51:54 -0400 (Wed, 21 Apr 2010)
New Revision: 2066
Added:
trunk/engine/src/main/java/com/metamatrix/common/log/JavaLogWriter.java
trunk/engine/src/main/java/com/metamatrix/common/log/LogListener.java
trunk/engine/src/main/java/com/metamatrix/common/log/LogMessage.java
trunk/engine/src/main/java/com/metamatrix/common/log/MessageLevel.java
trunk/runtime/src/main/java/org/teiid/logging/Log4jListener.java
Removed:
trunk/common-core/src/main/java/com/metamatrix/core/log/
trunk/common-core/src/test/java/com/metamatrix/core/log/
trunk/engine/src/main/java/com/metamatrix/common/log/LogConfiguration.java
trunk/engine/src/main/java/com/metamatrix/common/log/LogConfigurationImpl.java
trunk/runtime/src/main/java/org/teiid/logging/Log4JUtil.java
trunk/runtime/src/main/java/org/teiid/logging/LogConfigurationProvider.java
trunk/runtime/src/main/java/org/teiid/logging/LogListernerProvider.java
Modified:
trunk/connector-api/src/main/java/org/teiid/connector/basic/DefaultConnectorLogger.java
trunk/engine/src/main/java/com/metamatrix/common/buffer/TupleBuffer.java
trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/FileStorageManager.java
trunk/engine/src/main/java/com/metamatrix/common/log/LogConstants.java
trunk/engine/src/main/java/com/metamatrix/common/log/LogManager.java
trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
trunk/engine/src/main/java/com/metamatrix/query/processor/QueryProcessor.java
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNode.java
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java
trunk/engine/src/main/java/com/metamatrix/query/processor/xml/SAXDocumentInProgress.java
trunk/engine/src/main/java/com/metamatrix/query/processor/xml/XMLProcessorEnvironment.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/validator/AuthorizationValidationVisitor.java
trunk/engine/src/test/java/com/metamatrix/common/log/TestLogManager.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/runtime/src/main/java/org/teiid/logging/CommonsLogManagerAdapter.java
trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
trunk/runtime/src/main/java/org/teiid/transport/SocketListener.java
Log:
TEIID-1012 combining the log configuration and listener interfaces
Modified: trunk/connector-api/src/main/java/org/teiid/connector/basic/DefaultConnectorLogger.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/basic/DefaultConnectorLogger.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/connector-api/src/main/java/org/teiid/connector/basic/DefaultConnectorLogger.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -32,7 +32,6 @@
* DefaultConnectorLogger.
*/
public class DefaultConnectorLogger implements ConnectorLogger {
- public static final String CTX_CONNECTOR = "CONNECTOR"; //$NON-NLS-1$
@Override
public void logError(String message) {
//LogManager.logError(CTX_CONNECTOR, message);
Modified: trunk/engine/src/main/java/com/metamatrix/common/buffer/TupleBuffer.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/buffer/TupleBuffer.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/common/buffer/TupleBuffer.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -34,9 +34,9 @@
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.common.types.Streamable;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.query.sql.symbol.Expression;
Modified: trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/FileStorageManager.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/FileStorageManager.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/common/buffer/impl/FileStorageManager.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -35,7 +35,7 @@
import com.metamatrix.common.buffer.FileStore;
import com.metamatrix.common.buffer.StorageManager;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.core.log.MessageLevel;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.query.execution.QueryExecPlugin;
Copied: trunk/engine/src/main/java/com/metamatrix/common/log/JavaLogWriter.java (from rev 2065, trunk/common-core/src/main/java/com/metamatrix/core/log/JavaLogWriter.java)
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/log/JavaLogWriter.java (rev 0)
+++ trunk/engine/src/main/java/com/metamatrix/common/log/JavaLogWriter.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.common.log;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Write to Java logging
+ */
+public class JavaLogWriter implements LogListener {
+
+ @Override
+ public boolean isEnabled(String context, int msgLevel) {
+ Logger logger = Logger.getLogger(context);
+
+ Level javaLevel = convertLevel(msgLevel);
+ return logger.isLoggable(javaLevel);
+ }
+
+ public void log(int level, String context, Object msg) {
+ Logger logger = Logger.getLogger(context);
+
+ Level javaLevel = convertLevel(level);
+ logger.log(javaLevel, msg.toString());
+ }
+
+ public void log(int level, String context, Throwable t, Object msg) {
+ Logger logger = Logger.getLogger(context);
+
+ Level javaLevel = convertLevel(level);
+ logger.log(javaLevel, msg.toString(), t);
+ }
+
+ public Level convertLevel(int level) {
+ switch (level) {
+ case MessageLevel.CRITICAL:
+ case MessageLevel.ERROR:
+ return Level.SEVERE;
+ case MessageLevel.WARNING:
+ return Level.WARNING;
+ case MessageLevel.INFO:
+ return Level.FINE;
+ case MessageLevel.DETAIL:
+ return Level.FINER;
+ case MessageLevel.TRACE:
+ return Level.FINEST;
+ }
+ return Level.ALL;
+ }
+
+ public void shutdown() {
+ }
+
+}
Property changes on: trunk/engine/src/main/java/com/metamatrix/common/log/JavaLogWriter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: trunk/engine/src/main/java/com/metamatrix/common/log/LogConfiguration.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/log/LogConfiguration.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/common/log/LogConfiguration.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.common.log;
-
-import java.util.Set;
-
-public interface LogConfiguration {
- public static final String ROOT_CONTEXT = "org.teiid."; //$NON-NLS-1$
-
- /**
- * Get the current configured Log Level for supplied context
- * @param context
- * @return int value
- * @see com.metamatrix.core.log.MessageLevel
- */
- int getLogLevel(String context);
-
- /**
- * Obtain the set of message contexts that are currently used.
- * @return the unmodifiable set of context Strings; never null
- */
- Set<String> getContexts();
-
- /**
- * Set the Log Level
- *
- * Note: Must call setLogConfiguration(LogConfiguration) for log level to take
- * affect on the server.
- *
- * @param context log context name
- * @param logLevel The logLevel to set.
- */
- public void setLogLevel(String context, int logLevel);
-
- /**
- * Is the logging for the given context at the specified message level enabled.
- * @param context
- * @param msgLevel
- * @return
- */
- boolean isEnabled(String context, int msgLevel);
-}
Deleted: trunk/engine/src/main/java/com/metamatrix/common/log/LogConfigurationImpl.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/log/LogConfigurationImpl.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/common/log/LogConfigurationImpl.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -1,89 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.common.log;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-public class LogConfigurationImpl implements LogConfiguration, Serializable {
-
- private static final long serialVersionUID = 4626429149431532292L;
-
- Map<String, Integer> contextMap = null;
- private int defaultLevel;
-
- public LogConfigurationImpl(int defaultLevel) {
- this.defaultLevel = defaultLevel;
- this.contextMap = new HashMap<String, Integer>();
- }
-
- public LogConfigurationImpl(Map<String, Integer> contextMap) {
- this.contextMap = contextMap;
- }
-
- @Override
- public Set<String> getContexts() {
- return this.contextMap.keySet();
- }
-
- @Override
- public int getLogLevel(String context) {
- Integer level = this.contextMap.get(context);
- if (level == null) {
- context = fixContext(context);
- }
- level = this.contextMap.get(context);
- if (level != null) {
- return level;
- }
- return defaultLevel;
- }
-
- private String fixContext(String context) {
- if (context.indexOf('.') == -1) {
- context = ROOT_CONTEXT+context;
- }
- return context;
- }
-
- @Override
- public void setLogLevel(String context, int logLevel) {
- this.contextMap.put(context, logLevel);
- }
-
- @Override
- public boolean isEnabled(String context, int msgLevel) {
- int level = getLogLevel(context);
- return level >= msgLevel;
- }
-
- public static LogConfiguration makeCopy(LogConfiguration config) {
- Map<String, Integer> contextMap = new HashMap<String, Integer>();
- for(String context:config.getContexts()) {
- contextMap.put(context, config.getLogLevel(context));
- }
- return new LogConfigurationImpl(contextMap);
- }
-}
Modified: trunk/engine/src/main/java/com/metamatrix/common/log/LogConstants.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/log/LogConstants.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/common/log/LogConstants.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -22,21 +22,20 @@
package com.metamatrix.common.log;
-import org.teiid.connector.basic.DefaultConnectorLogger;
public interface LogConstants {
// add the new contexts to the Log4JUtil.java class, for configuration purpose
- public static final String CTX_SECURITY = "SECURITY"; //$NON-NLS-1$
- public static final String CTX_TRANSPORT = "TRANSPORT"; //$NON-NLS-1$
- public static final String CTX_QUERY_PLANNER = "PLANNER"; //$NON-NLS-1$
- public static final String CTX_DQP = "PROCESSOR"; //$NON-NLS-1$
- public static final String CTX_CONNECTOR = DefaultConnectorLogger.CTX_CONNECTOR;
- public static final String CTX_BUFFER_MGR = "BUFFER_MGR"; //$NON-NLS-1$
- public static final String CTX_TXN_LOG = "TXN_LOG"; //$NON-NLS-1$
- public static final String CTX_COMMANDLOGGING = "COMMAND_LOG"; //$NON-NLS-1$
- public static final String CTX_AUDITLOGGING = "AUDIT_LOG"; //$NON-NLS-1$
- public static final String CTX_ADMIN_API = "ADMIN_API"; //$NON-NLS-1$
- public static final String CTX_RUNTIME = "RUNTIME"; //$NON-NLS-1$
+ public static final String CTX_SECURITY = "org.teiid.SECURITY"; //$NON-NLS-1$
+ public static final String CTX_TRANSPORT = "org.teiid.TRANSPORT"; //$NON-NLS-1$
+ public static final String CTX_QUERY_PLANNER = "org.teiid.PLANNER"; //$NON-NLS-1$
+ public static final String CTX_DQP = "org.teiid.PROCESSOR"; //$NON-NLS-1$
+ public static final String CTX_CONNECTOR = "org.teiid.CONNECTOR"; //$NON-NLS-1$
+ public static final String CTX_BUFFER_MGR = "org.teiid.BUFFER_MGR"; //$NON-NLS-1$
+ public static final String CTX_TXN_LOG = "org.teiid.TXN_LOG"; //$NON-NLS-1$
+ public static final String CTX_COMMANDLOGGING = "org.teiid.COMMAND_LOG"; //$NON-NLS-1$
+ public static final String CTX_AUDITLOGGING = "org.teiid.AUDIT_LOG"; //$NON-NLS-1$
+ public static final String CTX_ADMIN_API = "org.teiid.ADMIN_API"; //$NON-NLS-1$
+ public static final String CTX_RUNTIME = "org.teiid.RUNTIME"; //$NON-NLS-1$
// Query contexts
public static final String CTX_FUNCTION_TREE = CTX_QUERY_PLANNER + ".FUNCTION_TREE"; //$NON-NLS-1$
public static final String CTX_QUERY_RESOLVER = CTX_QUERY_PLANNER + ".RESOLVER"; //$NON-NLS-1$
Copied: trunk/engine/src/main/java/com/metamatrix/common/log/LogListener.java (from rev 2065, trunk/common-core/src/main/java/com/metamatrix/core/log/LogListener.java)
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/log/LogListener.java (rev 0)
+++ trunk/engine/src/main/java/com/metamatrix/common/log/LogListener.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.common.log;
+
+
+/**
+ * LogListener
+ */
+public interface LogListener {
+
+ /**
+ * Is the logging for the given context at the specified message level enabled.
+ * @param context
+ * @param msgLevel
+ * @return
+ */
+ boolean isEnabled(String context, int msgLevel);
+
+ void log(int level, String context, Object msg);
+
+ void log(int level, String context, Throwable t, Object msg);
+
+ /**
+ * Shut down this listener, requesting it clean up and release any resources it
+ * may have acquired during its use. The listener is free to ignore this
+ * request if it is not responsible for managing the resources it uses or if
+ * there are no resources.
+ */
+ void shutdown();
+
+}
Modified: trunk/engine/src/main/java/com/metamatrix/common/log/LogManager.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/log/LogManager.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/common/log/LogManager.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -27,10 +27,6 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
-import com.metamatrix.core.log.JavaLogWriter;
-import com.metamatrix.core.log.LogListener;
-import com.metamatrix.core.log.LogMessage;
-import com.metamatrix.core.log.MessageLevel;
/**
@@ -134,12 +130,8 @@
}
}
-
- static LogConfiguration configuration = new LogConfigurationImpl(MessageLevel.DETAIL); // either injected or manually set using the set methods
-
static LogListener logListener = new JavaLogWriter(); // either injected or manually set using the set methods
-
/**
* Send a critical message to the log. This level of message is generally
* used to record an event or error that must be recorded (if any logging
@@ -362,22 +354,6 @@
logListener.log(msgLevel, context, e, message);
}
- /**
- * Utility method to obtain the a modifiable log configuration for the LogManager.
- * <p>After modifying the log config, user must call {@link #setLogConfiguration(LogConfiguration)} to
- * affect the logging configuration.</p>
- * @return a modifiable copy of the current log configuration
- */
- public static LogConfiguration getLogConfigurationCopy() {
- return LogConfigurationImpl.makeCopy(configuration);
- }
-
- public static void setLogConfiguration(LogConfiguration config ) {
- if ( config != null ) {
- configuration = LogConfigurationImpl.makeCopy(config);
- }
- }
-
public static void setLogListener(LogListener listener) {
logListener.shutdown();
if (listener != null) {
@@ -397,8 +373,8 @@
* or false if it would be discarded by the LogManager.
*/
public static boolean isMessageToBeRecorded(String context, int msgLevel) {
- if (configuration != null) {
- return configuration.isEnabled(context, msgLevel);
+ if (logListener != null) {
+ return logListener.isEnabled(context, msgLevel);
}
return true;
}
Copied: trunk/engine/src/main/java/com/metamatrix/common/log/LogMessage.java (from rev 2065, trunk/common-core/src/main/java/com/metamatrix/core/log/LogMessage.java)
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/log/LogMessage.java (rev 0)
+++ trunk/engine/src/main/java/com/metamatrix/common/log/LogMessage.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.common.log;
+
+import java.io.Serializable;
+
+
+public class LogMessage implements Serializable{
+
+ private Object[] msgParts;
+
+ public LogMessage(Object[] msgParts) {
+ this.msgParts = msgParts;
+ }
+
+ public Object[] getMessageParts() {
+ return this.msgParts;
+ }
+
+ public String getText() {
+ StringBuffer text = null;
+ if(msgParts != null) {
+ text = new StringBuffer();
+ for(int i=0; i<msgParts.length; i++) {
+ if (i>0) text.append(" "); //$NON-NLS-1$
+ Object omsg = msgParts[i];
+ if ( omsg != null ) {
+ text.append(omsg.toString());
+ }
+ }
+ }
+
+ if (text == null) {
+ return "NULL"; //$NON-NLS-1$
+ }
+ return text.toString();
+ }
+
+ public String toString() {
+ return getText();
+ }
+}
Copied: trunk/engine/src/main/java/com/metamatrix/common/log/MessageLevel.java (from rev 2065, trunk/common-core/src/main/java/com/metamatrix/core/log/MessageLevel.java)
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/log/MessageLevel.java (rev 0)
+++ trunk/engine/src/main/java/com/metamatrix/common/log/MessageLevel.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -0,0 +1,230 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.common.log;
+
+import java.util.*;
+
+/**
+ * Constants that define the level of the messages that are to be recorded
+ * by the LogManager.
+ */
+public final class MessageLevel {
+
+ /**
+ * Message level value that specifies that no messages are to be recorded.
+ */
+ public static final int NONE = 0;
+
+ /**
+ * Message level value that specifies that critical messages are to be recorded.
+ */
+ public static final int CRITICAL = 1;
+
+ /**
+ * Message level value that specifies that error messages and critical
+ * messages are to be recorded.
+ */
+ public static final int ERROR = 2;
+
+ /**
+ * Message level value that specifies that warning, error and critical
+ * messages are to be recorded.
+ */
+ public static final int WARNING = 3;
+
+ /**
+ * Message level value that specifies that information, warning, error and critical
+ * messages are to be recorded.
+ */
+ public static final int INFO = 4;
+
+ /**
+ * Message level value that specifies that detailed, information, warning, error and critical
+ * messages are to be recorded.
+ */
+ public static final int DETAIL = 5;
+
+ /**
+ * Message level value that specifies that all messages are to be recorded.
+ */
+ public static final int TRACE = 6;
+
+
+ /**
+ * The default message level is WARNING.
+ */
+ public static final int DEFAULT_MESSAGE_LEVEL = WARNING;
+
+ private static final int MINIMUM = NONE;
+ private static final int MAXIMUM = TRACE;
+
+ /**
+ * Constants that define the types of the messages that are to be recorded
+ * by the LogManager.
+ */
+ public static class Labels {
+ public static final String CRITICAL = "CRITICAL"; //$NON-NLS-1$
+ public static final String ERROR = "ERROR"; //$NON-NLS-1$
+ public static final String WARNING = "WARNING"; //$NON-NLS-1$
+ public static final String INFO = "INFO"; //$NON-NLS-1$
+ public static final String DETAIL = "DETAIL"; //$NON-NLS-1$
+ public static final String TRACE = "TRACE"; //$NON-NLS-1$
+ public static final String NONE = "NONE"; //$NON-NLS-1$
+ static final String UNKNOWN = "UNKNOWN"; //$NON-NLS-1$
+ }
+
+ /**
+ * Constants that define the types of the messages that are to be recorded
+ * by the LogManager.
+ */
+ public static class DisplayNames {
+ public static final String CRITICAL = "Critical"; //$NON-NLS-1$
+ public static final String ERROR = "Error"; //$NON-NLS-1$
+ public static final String WARNING = "Warning"; //$NON-NLS-1$
+ public static final String INFO = "Information"; //$NON-NLS-1$
+ public static final String DETAIL = "Detail"; //$NON-NLS-1$
+ public static final String TRACE = "Trace"; //$NON-NLS-1$
+ public static final String NONE = "None"; //$NON-NLS-1$
+ }
+
+ private static Map LABEL_TO_LEVEL_MAP = new HashMap();
+ private static Map DISPLAY_TO_LEVEL_MAP = new HashMap();
+ private static List LABELS = new ArrayList(MAXIMUM - MINIMUM + 1);
+ private static List DISPLAYS = new ArrayList(MAXIMUM - MINIMUM + 1);
+
+ static {
+ LABEL_TO_LEVEL_MAP.put(Labels.CRITICAL, new Integer(CRITICAL) );
+ LABEL_TO_LEVEL_MAP.put(Labels.ERROR, new Integer(ERROR) );
+ LABEL_TO_LEVEL_MAP.put(Labels.WARNING, new Integer(WARNING) );
+ LABEL_TO_LEVEL_MAP.put(Labels.INFO, new Integer(INFO) );
+ LABEL_TO_LEVEL_MAP.put(Labels.DETAIL, new Integer(DETAIL) );
+ LABEL_TO_LEVEL_MAP.put(Labels.TRACE, new Integer(TRACE) );
+ LABEL_TO_LEVEL_MAP.put(Labels.NONE, new Integer(NONE) );
+ DISPLAY_TO_LEVEL_MAP.put(DisplayNames.CRITICAL, new Integer(CRITICAL) );
+ DISPLAY_TO_LEVEL_MAP.put(DisplayNames.ERROR, new Integer(ERROR) );
+ DISPLAY_TO_LEVEL_MAP.put(DisplayNames.WARNING, new Integer(WARNING) );
+ DISPLAY_TO_LEVEL_MAP.put(DisplayNames.INFO, new Integer(INFO) );
+ DISPLAY_TO_LEVEL_MAP.put(DisplayNames.DETAIL, new Integer(DETAIL) );
+ DISPLAY_TO_LEVEL_MAP.put(DisplayNames.TRACE, new Integer(TRACE) );
+ DISPLAY_TO_LEVEL_MAP.put(DisplayNames.NONE, new Integer(NONE) );
+
+ // Do in the correct order so that the indexes match the levels
+ LABELS.add(Labels.NONE);
+ LABELS.add(Labels.CRITICAL);
+ LABELS.add(Labels.ERROR);
+ LABELS.add(Labels.WARNING);
+ LABELS.add(Labels.INFO);
+ LABELS.add(Labels.DETAIL);
+ LABELS.add(Labels.TRACE);
+ DISPLAYS.add(DisplayNames.NONE);
+ DISPLAYS.add(DisplayNames.CRITICAL);
+ DISPLAYS.add(DisplayNames.ERROR);
+ DISPLAYS.add(DisplayNames.WARNING);
+ DISPLAYS.add(DisplayNames.INFO);
+ DISPLAYS.add(DisplayNames.DETAIL);
+ DISPLAYS.add(DisplayNames.TRACE);
+ }
+
+ /**
+ * Utility method to set the level of messages that are recorded for this VM.
+ * @param newMessageLevel the new level; must be either
+ * <code>MessageLevel.NONE</code>,
+ * <code>MessageLevel.CRITICAL</code>,
+ * <code>MessageLevel.ERROR</code>,
+ * <code>MessageLevel.WARNING</code>,
+ * <code>MessageLevel.INFO</code>,
+ * <code>MessageLevel.DETAIL</code>, or
+ * <code>MessageLevel.TRACE.
+ * @throws IllegalArgumentException if the level is out of range.
+ */
+ public static boolean isMessageLevelValid( int newMessageLevel ) {
+ return !( newMessageLevel < MessageLevel.NONE || newMessageLevel > MessageLevel.TRACE );
+ }
+
+ /**
+ * Utility method for knowing what is the lower boundary for
+ * a valid message level.
+ * @return int message level
+ * @see #validUpperMessageLevel
+ */
+ public static int getValidLowerMessageLevel() {
+ return MessageLevel.NONE;
+ }
+
+ /**
+ * Utility method for knowing what is the upper boundary for
+ * a valid message level.
+ * @return int message level
+ * @see #validLowerMessageLevel
+ */
+ public static int getValidUpperMessageLevel() {
+ return MessageLevel.TRACE;
+ }
+
+ public static String getLabelForLevel( int level ) {
+ switch ( level ) {
+ case MessageLevel.NONE:
+ return Labels.NONE;
+ case MessageLevel.CRITICAL:
+ return Labels.CRITICAL;
+ case MessageLevel.ERROR:
+ return Labels.ERROR;
+ case MessageLevel.WARNING:
+ return Labels.WARNING;
+ case MessageLevel.INFO:
+ return Labels.INFO;
+ case MessageLevel.DETAIL:
+ return Labels.DETAIL;
+ case MessageLevel.TRACE:
+ return Labels.TRACE;
+ }
+ return Labels.UNKNOWN;
+ //throw new IllegalArgumentException("The specified message level \"" + level + "\" is invalid");
+ }
+
+ public static int getMinimumLevel() {
+ return MINIMUM;
+ }
+
+ public static int getMaximumLevel() {
+ return MAXIMUM;
+ }
+
+ public static Collection getDisplayNames() {
+ return DISPLAYS;
+ }
+
+
+ /**
+ * Utility method to get the labels for the levels, starting with the lowest
+ * level and ending with the highest level.
+ * @return an ordered list of String labels
+ */
+ public static List getLabels() {
+ return LABELS;
+ }
+
+
+
+}
+
Modified: trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -36,8 +36,8 @@
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.query.sql.LanguageObject;
import com.metamatrix.query.sql.lang.SubqueryContainer;
import com.metamatrix.query.sql.symbol.SingleElementSymbol;
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/QueryProcessor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/QueryProcessor.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/QueryProcessor.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -36,8 +36,8 @@
import com.metamatrix.common.buffer.BufferManager.TupleSourceType;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.query.execution.QueryExecPlugin;
import com.metamatrix.query.processor.BatchCollector.BatchProducer;
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNode.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNode.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNode.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -38,7 +38,7 @@
import com.metamatrix.common.buffer.BufferManager;
import com.metamatrix.common.buffer.TupleBatch;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.core.log.MessageLevel;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.query.analysis.AnalysisRecord;
import com.metamatrix.query.processor.ProcessorDataManager;
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/SortUtility.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -39,7 +39,7 @@
import com.metamatrix.common.buffer.BufferManager.BufferReserveMode;
import com.metamatrix.common.buffer.BufferManager.TupleSourceType;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.core.log.MessageLevel;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.query.sql.lang.OrderBy;
import com.metamatrix.query.sql.symbol.SingleElementSymbol;
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/xml/SAXDocumentInProgress.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/xml/SAXDocumentInProgress.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/xml/SAXDocumentInProgress.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -37,7 +37,7 @@
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.core.log.MessageLevel;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.query.mapping.xml.MappingNodeConstants;
/**
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/xml/XMLProcessorEnvironment.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/xml/XMLProcessorEnvironment.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/xml/XMLProcessorEnvironment.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -31,7 +31,7 @@
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.buffer.BufferManager;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.core.log.MessageLevel;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.query.mapping.xml.ResultSetInfo;
import com.metamatrix.query.processor.ProcessorDataManager;
import com.metamatrix.query.processor.ProcessorPlan;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -64,9 +64,9 @@
import com.metamatrix.common.buffer.BufferManager;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.common.types.Streamable;
import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.dqp.message.AtomicRequestMessage;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -48,10 +48,10 @@
import com.metamatrix.common.buffer.BufferManager;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.core.id.IDGenerator;
import com.metamatrix.core.id.IntegerIDFactory;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.dqp.message.RequestID;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -50,9 +50,9 @@
import com.metamatrix.common.buffer.TupleBuffer;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.core.MetaMatrixCoreException;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.RequestID;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/validator/AuthorizationValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/validator/AuthorizationValidationVisitor.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/validator/AuthorizationValidationVisitor.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -46,7 +46,7 @@
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.core.log.MessageLevel;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.query.function.FunctionLibrary;
import com.metamatrix.query.metadata.TempMetadataID;
Modified: trunk/engine/src/test/java/com/metamatrix/common/log/TestLogManager.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/common/log/TestLogManager.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/engine/src/test/java/com/metamatrix/common/log/TestLogManager.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -27,11 +27,10 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import junit.framework.TestCase;
-import com.metamatrix.core.log.LogListener;
-import com.metamatrix.core.log.MessageLevel;
/**
* This test case tests the LogManager.
@@ -50,9 +49,9 @@
@Override
protected void setUp() throws Exception {
- Map<String, Integer> contextMap = new HashMap<String, Integer>();
- contextMap.put(context, MessageLevel.DETAIL);
- LogManager.configuration = new LogConfigurationImpl(contextMap);
+ ListLogger logger = new ListLogger();
+ logger.setLogLevel(context, MessageLevel.DETAIL);
+ LogManager.logListener = logger;
}
// =========================================================================
@@ -65,9 +64,8 @@
public void testIsMessageToBeRecordedString() {
assertTrue(LogManager.isMessageToBeRecorded(context, MessageLevel.CRITICAL) );
- LogConfiguration cfg = LogManager.getLogConfigurationCopy();
+ ListLogger cfg = (ListLogger)LogManager.logListener;
cfg.setLogLevel(context, MessageLevel.NONE);
- LogManager.setLogConfiguration(cfg);
assertFalse(LogManager.isMessageToBeRecorded(context, MessageLevel.CRITICAL) );
}
@@ -75,14 +73,8 @@
* Test that all msgs logged are equal and output in same order.
*/
public void testLogMessage() throws Exception {
-
-
- LogConfiguration cfg = LogManager.getLogConfigurationCopy();
+ ListLogger cfg = (ListLogger)LogManager.logListener;
cfg.setLogLevel(context, MessageLevel.INFO );
- LogManager.setLogConfiguration(cfg);
-
- ListLogger listener = new ListLogger(6);
- LogManager.logListener = listener;
List<String> sentMsgList = new ArrayList<String>();
sentMsgList.add("A message 1"); //$NON-NLS-1$
@@ -97,51 +89,11 @@
LogManager.logInfo(context, msg);
}
- List recevedMsgList = listener.getLoggedMessages();
+ List recevedMsgList = cfg.getLoggedMessages();
assertEquals(sentMsgList.size(), recevedMsgList.size());
assertEquals(sentMsgList, recevedMsgList);
}
- public void testFilterMessage() {
- final LogConfiguration cfg = LogManager.getLogConfigurationCopy();
- cfg.setLogLevel(context, MessageLevel.INFO );
- LogManager.setLogConfiguration(cfg);
-
- LogListener listener = new LogListener() {
- @Override
- public void log(int level, String context, Object msg) {
- int setLevel = cfg.getLogLevel(context);
- assertTrue(level <= setLevel);
- }
-
- @Override
- public void log(int level, String context, Throwable t, Object msg) {
- int setLevel = cfg.getLogLevel(context);
- assertTrue(level <= setLevel);
- }
-
- @Override
- public void shutdown() {
- }
- };
- LogManager.logListener = listener;
-
- LogManager.logCritical(context, "message"); //$NON-NLS-1$
- LogManager.logDetail(context, "msgParts");//$NON-NLS-1$
- LogManager.logError(context, "message");//$NON-NLS-1$
- LogManager.logInfo(context, "message");//$NON-NLS-1$
- LogManager.logTrace(context, "msgParts");//$NON-NLS-1$
- LogManager.logWarning(context, "message");//$NON-NLS-1$
-
- Exception e = new Exception("test"); //$NON-NLS-1$
- LogManager.logCritical(context, e, "message"); //$NON-NLS-1$
- LogManager.logDetail(context, e, "msgParts");//$NON-NLS-1$
- LogManager.logError(context, e, "message");//$NON-NLS-1$
- LogManager.log(MessageLevel.INFO, context, e, "message");//$NON-NLS-1$
- LogManager.logTrace(context,e, "msgParts");//$NON-NLS-1$
- LogManager.logWarning(context, e, "message");//$NON-NLS-1$
- }
-
/**
*
* A log listener that saves messages (IStatus)s in a
@@ -149,27 +101,21 @@
*/
class ListLogger implements LogListener {
private List<String> messages = new ArrayList<String>();
- private int expectedMessages;
+ private Map<String, Integer> contextMap = new HashMap<String, Integer>();
+ private int defaultLevel;
- public ListLogger(int expectedMessages) {
- this.expectedMessages = expectedMessages;
+ public ListLogger() {
}
-
+
/* (non-Javadoc)
* @see com.metamatrix.core.log.LogListener#logMessage(org.eclipse.core.runtime.IStatus, long, java.lang.String, java.lang.String)
*/
- public synchronized void log(int level, String context, Object msg){
+ public void log(int level, String context, Object msg){
this.messages.add(msg.toString());
- if (this.messages.size() == expectedMessages) {
- this.notifyAll();
- }
}
public void log(int level, String context, Throwable t, Object msg) {
this.messages.add(msg.toString());
- if (this.messages.size() == expectedMessages) {
- this.notifyAll();
- }
}
/* (non-Javadoc)
@@ -185,13 +131,31 @@
return this.messages.size();
}
- public synchronized List getLoggedMessages() throws InterruptedException {
- if (this.messages.size() < expectedMessages) {
- this.wait(1000);
- }
+ public List getLoggedMessages() {
return this.messages;
}
+
+ public Set<String> getContexts() {
+ return this.contextMap.keySet();
+ }
+ public int getLogLevel(String context) {
+ Integer level = this.contextMap.get(context);
+ if (level != null) {
+ return level;
+ }
+ return defaultLevel;
+ }
+
+ public void setLogLevel(String context, int logLevel) {
+ this.contextMap.put(context, logLevel);
+ }
+
+ @Override
+ public boolean isEnabled(String context, int msgLevel) {
+ int level = getLogLevel(context);
+ return level >= msgLevel;
+ }
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -59,8 +59,7 @@
import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.dqp.internal.transaction.TransactionServerImpl;
import org.teiid.jboss.IntegrationPlugin;
-import org.teiid.logging.LogConfigurationProvider;
-import org.teiid.logging.LogListernerProvider;
+import org.teiid.logging.Log4jListener;
import org.teiid.security.SecurityHelper;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.ClientServiceRegistryImpl;
@@ -72,8 +71,8 @@
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.dqp.service.BufferService;
import com.metamatrix.dqp.service.SessionService;
import com.metamatrix.dqp.service.SessionServiceException;
@@ -98,8 +97,7 @@
public RuntimeEngineDeployer() {
// TODO: this does not belong here
- LogManager.setLogConfiguration(new LogConfigurationProvider().get());
- LogManager.setLogListener(new LogListernerProvider().get());
+ LogManager.setLogListener(new Log4jListener());
}
@Override
Modified: trunk/runtime/src/main/java/org/teiid/logging/CommonsLogManagerAdapter.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/logging/CommonsLogManagerAdapter.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/runtime/src/main/java/org/teiid/logging/CommonsLogManagerAdapter.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -25,7 +25,7 @@
import org.apache.commons.logging.Log;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.core.log.MessageLevel;
+import com.metamatrix.common.log.MessageLevel;
/**
* This class is bridge for hooking LogManager into systems that use apache commons logging. In the Teiid
Deleted: trunk/runtime/src/main/java/org/teiid/logging/Log4JUtil.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/logging/Log4JUtil.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/runtime/src/main/java/org/teiid/logging/Log4JUtil.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.logging;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-import com.metamatrix.common.log.LogConfiguration;
-import com.metamatrix.core.log.MessageLevel;
-
-class Log4JUtil {
- private static final String ROOT_CONTEXT = LogConfiguration.ROOT_CONTEXT;
-
- /**
- * Convert {@link MessageLevel} to {@link Level}
- * @param level
- * @return
- */
- public static Level convert2Log4JLevel(int level) {
- switch (level) {
- case MessageLevel.CRITICAL:
- return Level.FATAL;
- case MessageLevel.ERROR:
- return Level.ERROR;
- case MessageLevel.WARNING:
- return Level.WARN;
- case MessageLevel.INFO:
- return Level.INFO;
- case MessageLevel.DETAIL:
- case MessageLevel.TRACE:
- return Level.DEBUG;
- case MessageLevel.NONE:
- return Level.OFF;
- }
- return Level.DEBUG;
- }
-
- /**
- * Convert {@link Level} to {@link MessageLevel}
- * @param level
- * @return
- */
- public static int convert2MessageLevel(Level level) {
- switch (level.toInt()) {
- case Level.FATAL_INT:
- return MessageLevel.CRITICAL;
- case Level.ERROR_INT:
- return MessageLevel.ERROR;
- case Level.WARN_INT:
- return MessageLevel.WARNING;
- case Level.INFO_INT:
- return MessageLevel.INFO;
- case Level.DEBUG_INT:
- return MessageLevel.DETAIL;
- case Level.OFF_INT:
- return MessageLevel.NONE;
- }
- return MessageLevel.DETAIL;
- }
-
- /**
- * Get the logger for the given context.
- * @param context
- * @return
- */
- public static Logger getLogger(String context) {
- Logger log4j = null;
- if (context.indexOf('.') == -1) {
- log4j = Logger.getLogger(ROOT_CONTEXT+context);
- }
- else {
- log4j = Logger.getLogger(context);
- }
- return log4j;
- }
-
- public static Set<String> getContexts(){
- HashSet<String> contexts = new HashSet<String>();
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_DQP);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_CONNECTOR);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_BUFFER_MGR);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_TXN_LOG);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_COMMANDLOGGING);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_AUDITLOGGING);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_SECURITY);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_TRANSPORT);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_ADMIN_API);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_QUERY_PLANNER);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_RUNTIME);
-
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_FUNCTION_TREE);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_QUERY_RESOLVER);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_XML_PLANNER);
- contexts.add(ROOT_CONTEXT+com.metamatrix.common.log.LogConstants.CTX_XML_PLAN);
-
- contexts.add("com.arjuna"); //$NON-NLS-1$
- contexts.add("org.jboss"); //$NON-NLS-1$
- contexts.add("org.teiid"); //$NON-NLS-1$
- return contexts;
- }
-}
Added: trunk/runtime/src/main/java/org/teiid/logging/Log4jListener.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/logging/Log4jListener.java (rev 0)
+++ trunk/runtime/src/main/java/org/teiid/logging/Log4jListener.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.logging;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+import com.metamatrix.common.log.LogListener;
+import com.metamatrix.common.log.MessageLevel;
+
+/**
+ * Log4J Listener
+ */
+public class Log4jListener implements LogListener{
+
+ @Override
+ public boolean isEnabled(String context, int level) {
+ if ( context == null ) {
+ return false;
+ }
+ Level logLevel = convert2Log4JLevel(level);
+ if ( logLevel == Level.OFF) {
+ return false;
+ }
+ Logger log = getLogger(context);
+ return log.isEnabledFor(logLevel);
+ }
+
+ @Override
+ public void log(int level, String context, Object msg) {
+ Logger log4j = getLogger(context);
+ log4j.log(convert2Log4JLevel(level), msg);
+ }
+
+ public void log(int level, String context, Throwable t, Object msg) {
+ Logger log4j = getLogger(context);
+ log4j.log(convert2Log4JLevel(level), msg, t);
+ }
+
+ /**
+ * Convert {@link MessageLevel} to {@link Level}
+ * @param level
+ * @return
+ */
+ public static Level convert2Log4JLevel(int level) {
+ switch (level) {
+ case MessageLevel.CRITICAL:
+ return Level.FATAL;
+ case MessageLevel.ERROR:
+ return Level.ERROR;
+ case MessageLevel.WARNING:
+ return Level.WARN;
+ case MessageLevel.INFO:
+ return Level.INFO;
+ case MessageLevel.DETAIL:
+ case MessageLevel.TRACE:
+ return Level.DEBUG;
+ case MessageLevel.NONE:
+ return Level.OFF;
+ }
+ return Level.DEBUG;
+ }
+
+ /**
+ * Convert {@link Level} to {@link MessageLevel}
+ * @param level
+ * @return
+ */
+ public static int convert2MessageLevel(Level level) {
+ switch (level.toInt()) {
+ case Level.FATAL_INT:
+ return MessageLevel.CRITICAL;
+ case Level.ERROR_INT:
+ return MessageLevel.ERROR;
+ case Level.WARN_INT:
+ return MessageLevel.WARNING;
+ case Level.INFO_INT:
+ return MessageLevel.INFO;
+ case Level.DEBUG_INT:
+ return MessageLevel.DETAIL;
+ case Level.OFF_INT:
+ return MessageLevel.NONE;
+ }
+ return MessageLevel.DETAIL;
+ }
+
+ /**
+ * Get the logger for the given context.
+ * @param context
+ * @return
+ */
+ public static Logger getLogger(String context) {
+ return Logger.getLogger(context);
+ }
+
+ @Override
+ public void shutdown() {
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/runtime/src/main/java/org/teiid/logging/Log4jListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/runtime/src/main/java/org/teiid/logging/LogConfigurationProvider.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/logging/LogConfigurationProvider.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/runtime/src/main/java/org/teiid/logging/LogConfigurationProvider.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.logging;
-
-import java.util.Set;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-import com.metamatrix.common.log.LogConfiguration;
-
-public class LogConfigurationProvider {
-
- public LogConfiguration get() {
- return new Log4JLogConfiguration();
- }
-
- static class Log4JLogConfiguration implements LogConfiguration {
-
- @Override
- public Set<String> getContexts() {
- return Log4JUtil.getContexts();
- }
-
- @Override
- public int getLogLevel(String context) {
- Logger log = Log4JUtil.getLogger(context);
- Level level = log.getLevel();
- while (level == null) {
- log = (Logger)log.getParent();
- if (log != null) {
- level = log.getLevel();
- }
- else {
- level = Level.ERROR;
- }
- }
- return Log4JUtil.convert2MessageLevel(level);
- }
-
- @Override
- public boolean isEnabled(String context, int level) {
- if ( context == null ) {
- return false;
- }
- Level logLevel = Log4JUtil.convert2Log4JLevel(level);
- if ( logLevel == Level.OFF) {
- return false;
- }
- Logger log = Log4JUtil.getLogger(context);
- return log.isEnabledFor(logLevel);
- }
-
- @Override
- public void setLogLevel(String context, int level) {
- Logger log = Log4JUtil.getLogger(context);
- log.setLevel(Log4JUtil.convert2Log4JLevel(level));
- }
- }
-}
Deleted: trunk/runtime/src/main/java/org/teiid/logging/LogListernerProvider.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/logging/LogListernerProvider.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/runtime/src/main/java/org/teiid/logging/LogListernerProvider.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.logging;
-
-import org.apache.log4j.Logger;
-
-import com.metamatrix.core.log.LogListener;
-
-public class LogListernerProvider {
-
- public LogListener get() {
- return new Log4jListener();
- }
-
- /**
- * Log4J Listener
- */
- static class Log4jListener implements LogListener{
-
- @Override
- public void log(int level, String context, Object msg) {
- Logger log4j = Log4JUtil.getLogger(context);
- log4j.log(Log4JUtil.convert2Log4JLevel(level), msg);
- }
-
- public void log(int level, String context, Throwable t, Object msg) {
- Logger log4j = Log4JUtil.getLogger(context);
- log4j.log(Log4JUtil.convert2Log4JLevel(level), msg, t);
- }
-
- @Override
- public void shutdown() {
- }
-
- }
-}
Modified: trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -36,11 +36,11 @@
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.common.util.crypto.CryptoException;
import com.metamatrix.common.util.crypto.Cryptor;
import com.metamatrix.common.util.crypto.DhKeyGenerator;
import com.metamatrix.common.util.crypto.NullCryptor;
-import com.metamatrix.core.log.MessageLevel;
/**
* Sockets implementation of the communication framework class representing the server's view of a client connection.
Modified: trunk/runtime/src/main/java/org/teiid/transport/SocketListener.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SocketListener.java 2010-04-21 00:35:51 UTC (rev 2065)
+++ trunk/runtime/src/main/java/org/teiid/transport/SocketListener.java 2010-04-21 15:51:54 UTC (rev 2066)
@@ -37,8 +37,8 @@
import com.metamatrix.common.buffer.StorageManager;
import com.metamatrix.common.log.LogConstants;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.log.MessageLevel;
import com.metamatrix.common.util.ApplicationInfo;
-import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.core.util.NamedThreadFactory;
/**
14 years, 8 months
teiid SVN: r2065 - in trunk/engine/src: test/java/com/metamatrix/dqp/service and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-20 20:35:51 -0400 (Tue, 20 Apr 2010)
New Revision: 2065
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/QueryProcessor.java
trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
Log:
TEIID-1015 datanotavailable needs handled by the queryprocessor also
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/QueryProcessor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/QueryProcessor.java 2010-04-20 19:17:40 UTC (rev 2064)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/QueryProcessor.java 2010-04-21 00:35:51 UTC (rev 2065)
@@ -24,6 +24,8 @@
import java.util.List;
+import org.teiid.connector.api.DataNotAvailableException;
+
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.MetaMatrixException;
import com.metamatrix.api.exception.MetaMatrixProcessingException;
@@ -99,22 +101,29 @@
throws BlockedException, MetaMatrixProcessingException, MetaMatrixComponentException {
while (true) {
+ long wait = DEFAULT_WAIT;
try {
return nextBatchDirect();
} catch (ExpiredTimeSliceException e) {
if (!nonBlocking) {
throw e;
}
+ continue;
+ } catch (DataNotAvailableException e) {
+ if (!nonBlocking) {
+ throw e;
+ }
+ wait = e.getRetryDelay();
} catch (BlockedException e) {
if (!nonBlocking) {
throw e;
}
- try {
- Thread.sleep(DEFAULT_WAIT);
- } catch (InterruptedException err) {
- throw new MetaMatrixComponentException(err);
- }
}
+ try {
+ Thread.sleep(wait);
+ } catch (InterruptedException err) {
+ throw new MetaMatrixComponentException(err);
+ }
}
}
Modified: trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2010-04-20 19:17:40 UTC (rev 2064)
+++ trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2010-04-21 00:35:51 UTC (rev 2065)
@@ -29,6 +29,7 @@
import java.util.List;
import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.DataNotAvailableException;
import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
import org.teiid.dqp.internal.datamgr.impl.ConnectorWork;
import org.teiid.dqp.internal.datamgr.impl.ConnectorWorkItem;
@@ -50,6 +51,7 @@
private int rows = 10;
private SourceCapabilities caps;
public boolean throwExceptionOnExecute;
+ public int dataNotAvailable = -1;
public AutoGenDataService() {
super("FakeConnector");
@@ -84,6 +86,11 @@
@Override
public AtomicResultsMessage execute() throws ConnectorException {
+ if (dataNotAvailable > -1) {
+ int delay = dataNotAvailable;
+ dataNotAvailable = -1;
+ throw new DataNotAvailableException(delay);
+ }
return msg;
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2010-04-20 19:17:40 UTC (rev 2064)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2010-04-21 00:35:51 UTC (rev 2065)
@@ -130,4 +130,11 @@
}
}
+ public void testCodeTableResponseDataNotAvailable() throws Exception {
+ helpSetup(3);
+ this.connectorManager.dataNotAvailable = 5;
+
+ assertNull(dtm.lookupCodeValue(context, "BQT1.SmallA", "IntKey", "StringKey", "49")); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+
}
14 years, 8 months
teiid SVN: r2064 - in trunk/console/src/main: java/org/teiid/rhq/plugin and 2 other directories.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-04-20 15:17:40 -0400 (Tue, 20 Apr 2010)
New Revision: 2064
Modified:
trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
trunk/console/src/main/java/org/teiid/rhq/plugin/ModelDiscoveryComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
- Added Error count metric on Summary tab
- Change Inactive/Active to Up/Down
- Modified description text from JBoss Enterprise to Teiid
- Corrected Content tab error for VDB
- Corrected data types for Model properties
Modified: trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java 2010-04-20 19:13:08 UTC (rev 2063)
+++ trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java 2010-04-20 19:17:40 UTC (rev 2064)
@@ -14,11 +14,22 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.api.ManagedOperation;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.plugins.ManagedObjectImpl;
import org.jboss.metatype.api.types.MetaType;
import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.GenericValueSupport;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.teiid.adminapi.Request;
import org.teiid.adminapi.Session;
import org.teiid.rhq.comm.ExecutedResult;
@@ -27,8 +38,6 @@
import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.Platform;
import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.VDB;
-
-
public class DQPManagementView implements PluginConstants {
private static ManagedComponent mc = null;
@@ -88,26 +97,25 @@
Object resultObject = new Object();
- if (metric
- .equals(PluginConstants.ComponentType.VDB.Metrics.STATUS)) {
- //TODO remove version parameter after AdminAPI is changed
- resultObject = getVDBStatus((String)valueMap.get(VDB.NAME), 1);
+ if (metric.equals(PluginConstants.ComponentType.VDB.Metrics.ERROR_COUNT)) {
+ // TODO remove version parameter after AdminAPI is changed
+ resultObject = getErrorCount((String) valueMap.get(VDB.NAME));
+ } else if (metric.equals(PluginConstants.ComponentType.VDB.Metrics.STATUS)) {
+ // TODO remove version parameter after AdminAPI is changed
+ resultObject = getVDBStatus((String) valueMap.get(VDB.NAME), 1);
} else if (metric
.equals(PluginConstants.ComponentType.VDB.Metrics.QUERY_COUNT)) {
resultObject = new Double(getQueryCount().doubleValue());
- } else {
- if (metric
- .equals(PluginConstants.ComponentType.VDB.Metrics.SESSION_COUNT)) {
- resultObject = new Double(getSessionCount().doubleValue());
- } else {
- if (metric
- .equals(PluginConstants.ComponentType.VDB.Metrics.LONG_RUNNING_QUERIES)) {
- Integer longRunningQueryLimit = (Integer) valueMap
- .get(PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT);
- Collection<Request> longRunningQueries = getLongRunningQueries(longRunningQueryLimit);
- resultObject = new Double(longRunningQueries.size());
- }
- }
+ } else if (metric
+ .equals(PluginConstants.ComponentType.VDB.Metrics.SESSION_COUNT)) {
+ resultObject = new Double(getSessionCount().doubleValue());
+ } else if (metric
+ .equals(PluginConstants.ComponentType.VDB.Metrics.LONG_RUNNING_QUERIES)) {
+ Integer longRunningQueryLimit = (Integer) valueMap
+ .get(PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT);
+ Collection<Request> longRunningQueries = getLongRunningQueries(longRunningQueryLimit);
+ resultObject = new Double(longRunningQueries.size());
+
}
return resultObject;
@@ -159,9 +167,11 @@
resultObject.iterator()));
} else if (operationName.equals(Platform.Operations.KILL_SESSION)) {
Long sessionID = (Long) valueMap.get(Operation.Value.SESSION_ID);
- MetaValue[] args = new MetaValue[] {metaValueFactory.create(sessionID) };
+ MetaValue[] args = new MetaValue[] { metaValueFactory
+ .create(sessionID) };
try {
- executeManagedOperation(mc, Platform.Operations.KILL_SESSION, args);
+ executeManagedOperation(mc, Platform.Operations.KILL_SESSION,
+ args);
} catch (Exception e) {
final String msg = "Exception executing operation: " + Platform.Operations.KILL_SESSION; //$NON-NLS-1$
LOG.error(msg, e);
@@ -173,7 +183,8 @@
metaValueFactory.create(requestID),
metaValueFactory.create(sessionID) };
try {
- executeManagedOperation(mc, Platform.Operations.KILL_REQUEST, args);
+ executeManagedOperation(mc, Platform.Operations.KILL_REQUEST,
+ args);
} catch (Exception e) {
final String msg = "Exception executing operation: " + Platform.Operations.KILL_REQUEST; //$NON-NLS-1$
LOG.error(msg, e);
@@ -190,8 +201,8 @@
List<String> fieldNameList = operationResult.getFieldNameList();
getProperties(PluginConstants.ComponentType.VDB.NAME);
operationResult.setContent(createReportResultList(fieldNameList,
- resultObject.iterator()));
- }else if (operationName.equals(VDB.Operations.GET_SESSIONS)) {
+ resultObject.iterator()));
+ } else if (operationName.equals(VDB.Operations.GET_SESSIONS)) {
List<String> fieldNameList = operationResult.getFieldNameList();
MetaValue sessionMetaValue = getSessions();
getSessionCollectionValue(sessionMetaValue,
@@ -229,7 +240,7 @@
}
- protected MetaValue getRequests() {
+ protected MetaValue getRequests() {
MetaValue requestsCollection = null;
MetaValue args = null;
@@ -261,15 +272,17 @@
return sessionCollection;
}
-
+
public static String getVDBStatus(String vdbName, int version) {
-
+
ManagedComponent mcVdb = null;
try {
mcVdb = ProfileServiceUtil
- .getManagedComponent(new org.jboss.managed.api.ComponentType(
- PluginConstants.ComponentType.VDB.TYPE,
- PluginConstants.ComponentType.VDB.SUBTYPE), vdbName);
+ .getManagedComponent(
+ new org.jboss.managed.api.ComponentType(
+ PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE),
+ vdbName);
} catch (NamingException e) {
final String msg = "NamingException in getVDBStatus(): " + e.getExplanation(); //$NON-NLS-1$
LOG.error(msg, e);
@@ -278,8 +291,7 @@
LOG.error(msg, e);
}
- return ProfileServiceUtil.getSimpleValue(mcVdb,
- "status", String.class);
+ return ProfileServiceUtil.getSimpleValue(mcVdb, "status", String.class);
}
public static MetaValue executeManagedOperation(ManagedComponent mc,
@@ -302,8 +314,7 @@
}
}
}
- throw new Exception(
- "No operation found with given name =" + operation);
+ throw new Exception("No operation found with given name =" + operation);
}
@@ -328,7 +339,7 @@
String property, MetaValue... args) throws Exception {
mc = getDQPManagementView(mc);
-
+
try {
mc.getProperty(property);
} catch (Exception e) {
@@ -336,8 +347,7 @@
LOG.error(msg, e);
}
- throw new Exception(
- "No property found with given name =" + property);
+ throw new Exception("No property found with given name =" + property);
}
private Integer getQueryCount() {
@@ -366,9 +376,56 @@
return activeSessionsCollection.size();
}
- protected Collection<Request> getLongRunningQueries(
- int longRunningValue) {
+ /**
+ * @param mcVdb
+ * @return count
+ * @throws Exception
+ */
+ private int getErrorCount(String vdbName) {
+
+ ManagedComponent mcVdb = null;
+ try {
+ mcVdb = ProfileServiceUtil
+ .getManagedComponent(
+ new org.jboss.managed.api.ComponentType(
+ PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE),
+ vdbName);
+ } catch (NamingException e) {
+ final String msg = "NamingException in getVDBStatus(): " + e.getExplanation(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ } catch (Exception e) {
+ final String msg = "Exception in getVDBStatus(): " + e.getMessage(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ }
+
+ // Get models from VDB
+ int count = 0;
+ ManagedProperty property = mcVdb.getProperty("models");
+ CollectionValueSupport valueSupport = (CollectionValueSupport) property
+ .getValue();
+ MetaValue[] metaValues = valueSupport.getElements();
+ for (MetaValue value : metaValues) {
+ GenericValueSupport genValueSupport = (GenericValueSupport) value;
+ ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+ .getValue();
+
+ String modelName = managedObject.getName();
+
+ // Get any model errors/warnings
+ MetaValue errors = managedObject.getProperty("errors").getValue();
+ if (errors != null) {
+ CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
+ MetaValue[] errorArray = errorValueSupport.getElements();
+ count += errorArray.length;
+ }
+ }
+ return count;
+ }
+
+ protected Collection<Request> getLongRunningQueries(int longRunningValue) {
+
MetaValue requestsCollection = null;
Collection<Request> list = new ArrayList<Request>();
@@ -401,7 +458,8 @@
for (MetaValue value : ((CollectionValueSupport) pValue)
.getElements()) {
if (value.getMetaType().isComposite()) {
- Request Request = (Request)MetaValueFactory.getInstance().unwrap(value);
+ Request Request = (Request) MetaValueFactory.getInstance()
+ .unwrap(value);
list.add(Request);
} else {
throw new IllegalStateException(pValue
@@ -418,7 +476,8 @@
for (MetaValue value : ((CollectionValueSupport) pValue)
.getElements()) {
if (value.getMetaType().isComposite()) {
- Session Session = (Session)MetaValueFactory.getInstance().unwrap(value);
+ Session Session = (Session) MetaValueFactory.getInstance()
+ .unwrap(value);
list.add(Session);
} else {
throw new IllegalStateException(pValue
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/ModelDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/ModelDiscoveryComponent.java 2010-04-20 19:13:08 UTC (rev 2063)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/ModelDiscoveryComponent.java 2010-04-20 19:17:40 UTC (rev 2064)
@@ -64,59 +64,32 @@
throws InvalidPluginConfigurationException, Exception {
Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
- PropertyList list = discoveryContext.getParentResourceContext().getPluginConfiguration().getList("models");
+ for (int i = 0; i < 3; i++) {
+ String modelName = "myModel" + i;
- Iterator<Property> listIter = list.getList().iterator();
-
- while(listIter.hasNext()){
- PropertyMap propertyMap = (PropertyMap)listIter.next();
-
- String modelName = ((PropertySimple)propertyMap.getMap().get("name")).getStringValue();
-
- ManagedComponent model = ProfileServiceUtil
- .getManagedComponent(new ComponentType(
- PluginConstants.ComponentType.Model.TYPE,
- PluginConstants.ComponentType.Model.SUBTYPE),
- modelName);
-
- /**
- *
- * A discovered resource must have a unique key, that must stay the same
- * when the resource is discovered the next time
- */
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
discoveryContext.getResourceType(), // ResourceType
modelName, // Resource Key
modelName, // Resource Name
null, // Version TODO can we get that from discovery ?
PluginConstants.ComponentType.Model.DESCRIPTION, // Description
- discoveryContext.getDefaultPluginConfiguration(), // Plugin Config
+ discoveryContext.getDefaultPluginConfiguration(), // Plugin
+ // Config
null // Process info from a process scan
);
-
- // modelURI, connectorBindingNames, source, visible, modelType, visibility, supportsMultiSourceBindings,
- // name, path, uuid, properties
- String name = ((SimpleValueSupport)model.getProperty("name").getValue()).getValue().toString();
- String path = ((SimpleValueSupport)model.getProperty("path").getValue()).getValue().toString();
- String modelURI = ((SimpleValueSupport)model.getProperty("modelURI").getValue()).getValue().toString();
- String source = ((SimpleValueSupport)model.getProperty("source").getValue()).getValue().toString();
- String visible = ((SimpleValueSupport)model.getProperty("visible").getValue()).getValue().toString();
- String modelType = ((SimpleValueSupport)model.getProperty("modelType").getValue()).getValue().toString();
- String supportsMultiSourceBindings = ((SimpleValueSupport)model.getProperty("supportsMultiSourceBindings").getValue()).getValue().toString();
+
+ Configuration c = detail.getPluginConfiguration();
+ c.put(new PropertySimple(modelName, "name"));
+
+ PropertyList list = new PropertyList("multisourceModels");
+ PropertyMap map = new PropertyMap("model",
+ new PropertySimple("oraclesource", "sourceName"),
+ new PropertySimple("JNDINameOracle", "jndiName"),
+ new PropertySimple("MySQLsource", "sourceName"),
+ new PropertySimple("JNDINameMySQL", "jndiName"));
+ list.add(map);
- Configuration c = detail.getPluginConfiguration();
-
- getConnectors(model, c);
-
- c.put(new PropertySimple("name", name));
- c.put(new PropertySimple("path", path));
- c.put(new PropertySimple("modelURI", modelURI));
- c.put(new PropertySimple("source", source));
- c.put(new PropertySimple("visible", visible));
- c.put(new PropertySimple("modelType", modelType));
- c.put(new PropertySimple("supportsMultiSourceBindings", supportsMultiSourceBindings));
-
-
+ detail.setPluginConfiguration(c);
// Add to return values
discoveredResources.add(detail);
log.info("Discovered Teiid Model: " + modelName);
@@ -124,27 +97,30 @@
return discoveredResources;
}
-
+
/**
* @param mcVdb
* @param configuration
*/
- private void getConnectors(ManagedComponent model, Configuration configuration) {
- //Get Connector(s) from Model
+ private void getConnectors(ManagedComponent model,
+ Configuration configuration) {
+ // Get Connector(s) from Model
ManagedProperty property = model.getProperty("connectorBindingNames");
- CollectionValueSupport valueSupport = (CollectionValueSupport) property.getValue();
+ CollectionValueSupport valueSupport = (CollectionValueSupport) property
+ .getValue();
MetaValue[] metaValues = valueSupport.getElements();
-
+
PropertyList connectorsList = new PropertyList("connectors");
configuration.put(connectorsList);
-
+
for (MetaValue value : metaValues) {
SimpleValueSupport simpleValueSupport = (SimpleValueSupport) value;
- String connectorName = (String)simpleValueSupport.getValue();
-
- PropertyMap connector = new PropertyMap("connector", new PropertySimple("name", connectorName));
+ String connectorName = (String) simpleValueSupport.getValue();
+
+ PropertyMap connector = new PropertyMap("connector",
+ new PropertySimple("name", connectorName));
connectorsList.add(connector);
}
- }
-
+ }
+
}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-04-20 19:13:08 UTC (rev 2063)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-04-20 19:17:40 UTC (rev 2064)
@@ -21,13 +21,31 @@
*/
package org.teiid.rhq.plugin;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import javax.naming.NamingException;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.GenericValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.MeasurementDataNumeric;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
@@ -42,7 +60,6 @@
import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.Platform;
import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.VDB;
-
/**
* Component class for a Teiid VDB
*
@@ -50,14 +67,16 @@
public class VDBComponent extends Facet {
private final Log LOG = LogFactory.getLog(VDBComponent.class);
-
-
- /* (non-Javadoc)
- * @see org.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.ResourceContext)
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.
+ * ResourceContext)
*/
@Override
public void start(ResourceContext context) {
- this.setComponentName(context.getPluginConfiguration().getSimpleValue("name", null));
+ this.setComponentName(context.getPluginConfiguration().getSimpleValue(
+ "name", null));
super.start(context);
}
@@ -70,7 +89,7 @@
public String getComponentName() {
return this.name;
}
-
+
@Override
protected void setOperationArguments(String name,
Configuration configuration, Map<String, Object> valueMap) {
@@ -92,27 +111,31 @@
}
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.teiid.rhq.plugin.Facet#getAvailability()
*/
@Override
public AvailabilityType getAvailability() {
- //TODO Remove vdb version after no longer viable in Teiid
- String status = DQPManagementView.getVDBStatus(this.getComponentName(), 1);
- if (status.equals("ACTIVE")){
+ // TODO Remove vdb version after no longer viable in Teiid
+ String status = DQPManagementView.getVDBStatus(this.getComponentName(),
+ 1);
+ if (status.equals("ACTIVE")) {
return AvailabilityType.UP;
}
-
- return AvailabilityType.DOWN;
+
+ return AvailabilityType.DOWN;
}
@Override
- protected void setMetricArguments(String name,
- Configuration configuration, Map<String, Object> valueMap) {
+ protected void setMetricArguments(String name, Configuration configuration,
+ Map<String, Object> valueMap) {
// Parameter logic for VDB Metrics
String key = VDB.NAME;
- valueMap.put(key, this.resourceConfiguration.getSimpleValue("name", null));
+ valueMap.put(key, this.resourceConfiguration.getSimpleValue("name",
+ null));
}
@Override
@@ -132,35 +155,51 @@
.getComponentIdentifier(), name, valueMap);
try {
- if (request
- .getName()
- .equals(
- PluginConstants.ComponentType.VDB.Metrics.QUERY_COUNT)) {
- report.addData(new MeasurementDataTrait(request, (String)metricReturnObject));
+ if (request.getName().equals(
+ PluginConstants.ComponentType.VDB.Metrics.ERROR_COUNT)) {
+ String message = "";
+ if (((Integer) metricReturnObject) > 0) {
+ message = "** There are "
+ + ((Integer) metricReturnObject)
+ + " errors reported for this VDB. See the Configuration tab for details. **";
+ } else {
+ message = "** There are no errors reported for this VDB. **";
+ }
+
+ report.addData(new MeasurementDataTrait(request, message));
} else {
if (request
.getName()
.equals(
- PluginConstants.ComponentType.VDB.Metrics.SESSION_COUNT)) {
- report.addData(new MeasurementDataNumeric(request,
- (Double) metricReturnObject));
+ PluginConstants.ComponentType.VDB.Metrics.QUERY_COUNT)) {
+ report.addData(new MeasurementDataTrait(request,
+ (String) metricReturnObject));
} else {
if (request
.getName()
.equals(
- PluginConstants.ComponentType.VDB.Metrics.STATUS)) {
- report.addData(new MeasurementDataTrait(request,
- (String) metricReturnObject));
+ PluginConstants.ComponentType.VDB.Metrics.SESSION_COUNT)) {
+ report.addData(new MeasurementDataNumeric(request,
+ (Double) metricReturnObject));
} else {
if (request
.getName()
.equals(
- PluginConstants.ComponentType.VDB.Metrics.LONG_RUNNING_QUERIES)) {
- report.addData(new MeasurementDataNumeric(
- request, (Double) metricReturnObject));
+ PluginConstants.ComponentType.VDB.Metrics.STATUS)) {
+ report.addData(new MeasurementDataTrait(
+ request, (String) metricReturnObject));
+ } else {
+ if (request
+ .getName()
+ .equals(
+ PluginConstants.ComponentType.VDB.Metrics.LONG_RUNNING_QUERIES)) {
+ report.addData(new MeasurementDataNumeric(
+ request,
+ (Double) metricReturnObject));
+ }
}
+
}
-
}
}
@@ -176,7 +215,196 @@
@Override
String getComponentType() {
return PluginConstants.ComponentType.VDB.NAME;
- }
-
+ }
+
+ @Override
+ public Configuration loadResourceConfiguration() {
+
+ ManagedComponent mcVdb = null;
+ try {
+ mcVdb = ProfileServiceUtil.getManagedComponent(
+ new org.jboss.managed.api.ComponentType(
+ PluginConstants.ComponentType.VDB.TYPE,
+ PluginConstants.ComponentType.VDB.SUBTYPE), this
+ .getComponentName());
+ } catch (NamingException e) {
+ final String msg = "NamingException in getVDBStatus(): " + e.getExplanation(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ } catch (Exception e) {
+ final String msg = "Exception in getVDBStatus(): " + e.getMessage(); //$NON-NLS-1$
+ LOG.error(msg, e);
+ }
+
+ // Get plugin config map for models
+ Configuration configuration = resourceContext.getPluginConfiguration();
+
+ // configuration.put(new PropertySimple("name", vdbName));
+ // configuration.put(new PropertySimple("version", vdbVersion));
+ // configuration
+ // .put(new PropertySimple("description", vdbDescription));
+ // configuration.put(new PropertySimple("status", vdbStatus));
+ // configuration.put(new PropertySimple("url", vdbURL));
+
+ getModels(mcVdb, configuration);
+
+ return configuration;
+
+ }
+
+ /**
+ * @param mcVdb
+ * @param configuration
+ * @throws Exception
+ */
+ private void getModels(ManagedComponent mcVdb, Configuration configuration)
+ {
+ // Get models from VDB
+ ManagedProperty property = mcVdb.getProperty("models");
+ CollectionValueSupport valueSupport = (CollectionValueSupport) property
+ .getValue();
+ MetaValue[] metaValues = valueSupport.getElements();
+
+ PropertyList sourceModelsList = new PropertyList("sourceModels");
+ configuration.put(sourceModelsList);
+
+ PropertyList multiSourceModelsList = new PropertyList("multisourceModels");
+ configuration.put(multiSourceModelsList);
+
+ PropertyList logicalModelsList = new PropertyList("logicalModels");
+ configuration.put(logicalModelsList);
+
+ PropertyList errorList = new PropertyList("errorList");
+ configuration.put(errorList);
+
+ for (MetaValue value : metaValues) {
+ GenericValueSupport genValueSupport = (GenericValueSupport) value;
+ ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+ .getValue();
+
+ Boolean isSource = Boolean.TRUE;
+ try {
+ isSource = ProfileServiceUtil.booleanValue(managedObject
+ .getProperty("source").getValue());
+ } catch (Exception e) {
+ LOG.error(e.getMessage());
+ }
+
+ Boolean supportMultiSource = Boolean.TRUE;
+ try {
+ supportMultiSource = ProfileServiceUtil
+ .booleanValue(managedObject.getProperty(
+ "supportsMultiSourceBindings").getValue());
+ } catch (Exception e) {
+ LOG.error(e.getMessage());
+ }
+
+ String modelName = managedObject.getName();
+ ManagedProperty connectorBinding = managedObject
+ .getProperty("sourceMappings");
+ Collection<Map<String, String>> sourceList = new ArrayList<Map<String, String>>();
+ getSourceMappingValue(connectorBinding.getValue(), sourceList);
+ String visibility = ((SimpleValueSupport) managedObject
+ .getProperty("visible").getValue()).getValue().toString();
+ String type = ((EnumValueSupport) managedObject.getProperty(
+ "modelType").getValue()).getValue().toString();
+
+ // Get any model errors/warnings
+ MetaValue errors = managedObject.getProperty("errors").getValue();
+ if (errors != null) {
+ CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
+ MetaValue[] errorArray = errorValueSupport.getElements();
+ for (MetaValue error : errorArray) {
+ GenericValueSupport errorGenValueSupport = (GenericValueSupport) error;
+ ManagedObject errorMo = (ManagedObject) errorGenValueSupport
+ .getValue();
+ String severity = ((SimpleValue) errorMo.getProperty(
+ "severity").getValue()).getValue().toString();
+ String message = ((SimpleValue) errorMo
+ .getProperty("value").getValue()).getValue()
+ .toString();
+ PropertyMap errorMap = new PropertyMap("errorMap",
+ new PropertySimple("severity", severity),
+ new PropertySimple("message", message));
+ errorList.add(errorMap);
+ }
+ }
+
+ for (Map<String, String> sourceMap : sourceList) {
+
+ if (isSource) {
+ String sourceName = (String) sourceMap.get("name");
+ String jndiName = (String) sourceMap.get("jndiName");
+ PropertyMap multiSourceModel = null;
+ PropertyMap multiSourceModel2 = null;
+
+ PropertyMap model = null;
+ if (supportMultiSource){
+ //TODO need to loop through multisource models
+ multiSourceModel = new PropertyMap("model",
+ new PropertySimple("name", modelName),
+ new PropertySimple("sourceName", sourceName),
+ new PropertySimple("jndiName", jndiName));
+ multiSourceModelsList.add(multiSourceModel);
+ model = new PropertyMap("model",
+ new PropertySimple("name", modelName),
+ new PropertySimple("sourceName", "See below"),
+ new PropertySimple("jndiName", "See below"),
+ new PropertySimple("visibility", visibility),
+ new PropertySimple("supportsMultiSource",
+ true));
+ sourceModelsList.add(model);
+ multiSourceModel = new PropertyMap("model",
+ new PropertySimple("name", modelName),
+ new PropertySimple("sourceName", sourceName),
+ new PropertySimple("jndiName", jndiName));
+ multiSourceModelsList.add(multiSourceModel);
+ }else{
+ model = new PropertyMap("model",
+ new PropertySimple("name", modelName),
+ new PropertySimple("sourceName", sourceName),
+ new PropertySimple("jndiName", jndiName),
+ new PropertySimple("visibility", visibility),
+ new PropertySimple("supportsMultiSource",
+ supportMultiSource));
+ sourceModelsList.add(model);
+ }
+ } else {
+ PropertyMap model = new PropertyMap("model",
+ new PropertySimple("name", modelName),
+ new PropertySimple("type", type),
+ new PropertySimple("visibility", visibility));
+
+ logicalModelsList.add(model);
+ }
+ }
+ }
+ }
+
+ /**
+ * @param <T>
+ * @param pValue
+ * @param list
+ */
+ public static <T> void getSourceMappingValue(MetaValue pValue,
+ Collection<Map<String, String>> list) {
+ Map<String, String> map = new HashMap<String, String>();
+ list.add(map);
+ MetaType metaType = pValue.getMetaType();
+ if (metaType.isCollection()) {
+ for (MetaValue value : ((CollectionValueSupport) pValue)
+ .getElements()) {
+ GenericValueSupport genValue = ((GenericValueSupport) value);
+ ManagedObject mo = (ManagedObject) genValue.getValue();
+ String sourceName = mo.getName();
+ String jndi = ((SimpleValue) mo.getProperty("jndiName")
+ .getValue()).getValue().toString();
+ map.put("name", sourceName);
+ map.put("jndiName", jndi);
+ }
+ } else {
+ throw new IllegalStateException(pValue
+ + " is not a Collection type");
+ }
+ }
+
}
-
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-04-20 19:13:08 UTC (rev 2063)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-04-20 19:17:40 UTC (rev 2064)
@@ -23,11 +23,14 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import javax.naming.NamingException;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.managed.api.ComponentType;
@@ -40,6 +43,7 @@
import org.jboss.metatype.api.values.EnumValueSupport;
import org.jboss.metatype.api.values.GenericValueSupport;
import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
import org.jboss.metatype.api.values.SimpleValue;
import org.jboss.metatype.api.values.SimpleValueSupport;
import org.rhq.core.domain.configuration.Configuration;
@@ -50,6 +54,7 @@
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.teiid.adminapi.Request;
import org.teiid.rhq.plugin.util.PluginConstants;
import org.teiid.rhq.plugin.util.ProfileServiceUtil;
@@ -97,7 +102,7 @@
vdbVersion.toString(), // Version
PluginConstants.ComponentType.VDB.DESCRIPTION, // Description
discoveryContext.getDefaultPluginConfiguration(), // Plugin
- // Config
+ // Config
null // Process info from a process scan
);
@@ -113,8 +118,7 @@
getModels(mcVdb, configuration);
- // Get VDB errors/warnings
- // getErrors(mcVdb, configuration);
+ // getProperties(mcVdb, configuration);
detail.setPluginConfiguration(configuration);
@@ -141,13 +145,16 @@
PropertyList sourceModelsList = new PropertyList("sourceModels");
configuration.put(sourceModelsList);
+
+ PropertyList multiSourceModelsList = new PropertyList("multisourceModels");
+ configuration.put(multiSourceModelsList);
PropertyList logicalModelsList = new PropertyList("logicalModels");
configuration.put(logicalModelsList);
PropertyList errorList = new PropertyList("errorList");
configuration.put(errorList);
-
+
for (MetaValue value : metaValues) {
GenericValueSupport genValueSupport = (GenericValueSupport) value;
ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
@@ -177,10 +184,9 @@
getSourceMappingValue(connectorBinding.getValue(), sourceList);
String visibility = ((SimpleValueSupport) managedObject
.getProperty("visible").getValue()).getValue().toString();
- String type = ((EnumValueSupport) managedObject
- .getProperty("modelType").getValue()).getValue().toString();
+ String type = ((EnumValueSupport) managedObject.getProperty(
+ "modelType").getValue()).getValue().toString();
-
// Get any model errors/warnings
MetaValue errors = managedObject.getProperty("errors").getValue();
if (errors != null) {
@@ -195,7 +201,9 @@
String message = ((SimpleValue) errorMo
.getProperty("value").getValue()).getValue()
.toString();
- PropertyMap errorMap = new PropertyMap("errorMap", new PropertySimple("severity", severity), new PropertySimple("message", message));
+ PropertyMap errorMap = new PropertyMap("errorMap",
+ new PropertySimple("severity", severity),
+ new PropertySimple("message", message));
errorList.add(errorMap);
}
}
@@ -205,7 +213,7 @@
if (isSource) {
String sourceName = (String) sourceMap.get("name");
String jndiName = (String) sourceMap.get("jndiName");
-
+
PropertyMap model = new PropertyMap("model",
new PropertySimple("name", modelName),
new PropertySimple("sourceName", sourceName),
@@ -255,4 +263,44 @@
}
}
+ /**
+ * @param mc
+ * @param configuration
+ * @throws Exception
+ */
+ private void getProperties(ManagedComponent mcVdb,
+ Configuration configuration) {
+
+ ManagedProperty mp = mcVdb.getProperty("JAXBProperties");
+ Collection<Object> list = new ArrayList<Object>();
+ getRequestCollectionValue(mp.getValue(), list);
+ PropertyMap vdbPropertyMap = new PropertyMap("vdbProperties");
+ configuration.put(vdbPropertyMap);
+ setProperties(mp, vdbPropertyMap);
+
+ }
+
+ /**
+ * @param mcMap
+ * @param propertyMap
+ */
+ private void setProperties(ManagedProperty mProp, PropertyMap propertyMap) {
+ //String value = ProfileServiceUtil.stringValue(mProp.getValue());
+ PropertySimple prop = new PropertySimple(mProp.getName(), "test");
+ propertyMap.put(prop);
+
+ }
+
+ public static <T> void getRequestCollectionValue(MetaValue pValue,
+ Collection<Object> list) {
+ MetaType metaType = pValue.getMetaType();
+ if (metaType.isCollection()) {
+ for (MetaValue value : ((CollectionValueSupport) pValue)
+ .getElements()) {
+ SimpleValueSupport property = (SimpleValueSupport)value;
+ list.add(property);
+ }
+ }
+ }
+
}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-04-20 19:13:08 UTC (rev 2063)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-04-20 19:17:40 UTC (rev 2064)
@@ -111,6 +111,7 @@
public final static String STATUS = "status"; //$NON-NLS-1$
public final static String QUERY_COUNT = "queryCount"; //$NON-NLS-1$
+ public final static String ERROR_COUNT = "errorCount"; //$NON-NLS-1$
public final static String SESSION_COUNT = "sessionCount"; //$NON-NLS-1$
public final static String LONG_RUNNING_QUERIES = "longRunningQueries"; //$NON-NLS-1$
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-04-20 19:13:08 UTC (rev 2063)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-04-20 19:17:40 UTC (rev 2064)
@@ -4,9 +4,8 @@
* JBoss, Home of Professional Open Source. * See the COPYRIGHT.txt
file distributed with this work for information * regarding copyright
ownership. Some portions may be licensed * to Red Hat, Inc. under one
- or more contributor license agreements. * * This library is free
- software; you can redistribute it and/or * modify it under the terms
- of the GNU Lesser General Public * License as published by the Free
+ or more contributor license agreements. * * This library is free 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 library is distributed in the hope
that it will be useful, * but WITHOUT ANY WARRANTY; without even the
@@ -17,232 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
02110-1301 USA. */
-->
-
-<!DOCTYPE plugin [
-<!ENTITY datasourceAndConnectionFactoryAdvancedResourceConfigProps '
- <c:simple-property name="allocation-retry" type="integer" required="false"
- defaultValue="0">
- <c:description>
- The number of times that allocating a connection should be tried before throwing an exception. The default
- is 0.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="allocation-retry-wait-millis" type="long" required="false" units="milliseconds"
- defaultValue="5000">
- <c:description>
- The time in milliseconds to wait between retrying to allocate a connection. The default is 5000 (5 seconds).
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="background-validation" type="boolean" required="false" defaultValue="false">
- <c:description>
- Specify if connections should be validated on a background thread versus being validated
- prior to use. Background validation is meant to reduce the overall load on the RDBMS system when validating
- a connection. The default is No.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="background-validation-millis" type="long" required="false" units="milliseconds"
- defaultValue="0">
- <c:description>
- The interval, in milliseconds, at which the ConnectionValidator will run. Set to 0 to disable background
- validation. The default is 0.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="blocking-timeout-millis" displayName="Blocking Timeout in Milliseconds"
- units="milliseconds" defaultValue="30000"
- type="integer" required="false">
- <c:description>
- Indicates the maximum time in milliseconds to block while waiting for a connection before throwing
- an exception. Note that this blocks only while waiting for a permit for a connection, and will never
- throw an exception if creating a new connection takes an inordinately long time. The default is 30000
- (30 seconds).
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-
- <c:simple-property name="idle-timeout-minutes" type="integer" activationPolicy="immediate"
- displayName="Idle Timeout" units="minutes" required="false" defaultValue="30">
- <c:description>
- The maximum time, in minutes, a connection may be idle before being closed. The default is 30.
- </c:description>
- <c:constraint>
- <c:integer-constraint minimum="0"/>
- </c:constraint>
- </c:simple-property>
-
- <c:simple-property name="isSameRM-override-value" type="boolean" required="false">
- <c:description>
- If set, unconditionally sets the boolean return value of javax.transaction.xa.XAResource.isSameRM(XAResource).
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="jmx-invoker-name" required="false">
- <c:description>
- The ObjectName of the JMX Invoker MBean associated with this datasource.
- </c:description>
- </c:simple-property>
-
- <c:map-property name="metadata" required="false" description="Metadata properties.">
- <c:simple-property required="false" name="typeMapping">
- <c:description>
- The name of the corresponding type-mapping in conf/standardjbosscmp-jdbc.xml.
- </c:description>
- <c:property-options>
- <c:option name="Cloudscape" value="Cloudscape"/>
- <c:option name="DB2" value="DB2"/>
- <c:option name="DB2/400" value="DB2/400"/>
- <c:option name="Derby" value="Derby"/>
- <c:option name="Firebird" value="Firebird"/>
- <c:option name="FirstSQL/J" value="FirstSQL/J"/>
- <c:option name="Hypersonic SQL" value="Hypersonic SQL"/>
- <c:option name="InformixDB" value="InformixDB"/>
- <c:option name="Ingres" value="Ingres"/>
- <c:option name="InterBase" value="InterBase"/>
- <c:option name="MaxDB" value="MaxDB"/>
- <c:option name="McKoi" value="McKoi"/>
- <c:option name="Mimer SQL" value="Mimer SQL"/>
- <c:option name="MS SQLSERVER" value="MS SQLSERVER"/>
- <c:option name="MS SQLSERVER2000" value="MS SQLSERVER2000"/>
- <c:option name="Oracle7" value="Oracle7"/>
- <c:option name="Oracle8" value="Oracle8"/>
- <c:option name="Oracle9i" value="Oracle9i"/>
- <c:option name="PointBase" value="PointBase"/>
- <c:option name="PostgreSQL" value="PostgreSQL"/>
- <c:option name="PostgreSQL 7.2" value="PostgreSQL 7.2"/>
- <c:option name="PostgreSQL 8.0" value="PostgreSQL 8.0"/>
- <c:option name="SapDB" value="SapDB"/>
- <c:option name="SOLID" value="SOLID"/>
- <c:option name="Sybase" value="Sybase"/>
- </c:property-options>
- </c:simple-property>
- </c:map-property>
-
- <c:simple-property name="no-tx-separate-pools" type="boolean"
- displayName="No Tx Separate Pools" required="false">
- <c:description>Whether or not to use separate pools. The default is Yes.</c:description>
- <c:property-options>
- <c:option name="True" value="true"/>
- <c:option name="False" value="false"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="prefill" type="boolean" required="false">
- <c:description>
- Whether to attempt to prefill the connection pool to the minimum number of connections. NOTE: Only
- supporting pools (OnePool) support this feature. A warning can be found in the logs if the pool does not
- support this. The default is No.
- </c:description>
- </c:simple-property>
-
- <c:map-property name="security-domain" displayName="Security Settings" required="false">
- <c:description>
- Security settings for connections in the pool.
- </c:description>
-
- <c:simple-property name="securityDeploymentType" type="string"
- required="false" defaultValue="NONE">
- <c:description>
- Indicates whether Subject (from security domain), application-supplied parameters
- (such as from getConnection(user, pw)), both Subject and app-supplied parameters,
- or neither Subject nor app-supplied parameters are used to distinguish connections
- in the pool. The default is "NONE".
- </c:description>
- <c:property-options>
- <c:option name="None" value="NONE"/>
- <c:option name="Application" value="APPLICATION"/>
- <c:option name="Domain" value="DOMAIN"/>
- <c:option name="Domain and Application" value="DOMAIN_AND_APPLICATION"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="domain" type="string"
- required="false">
- <c:description>
- The name of the JAAS security manager that will handle authentication (only required if security
- deployment type is DOMAIN or DOMAIN_AND_APPLICATION). This name correlates to the JAAS login-config.xml
- descriptor application-policy/name attribute.
- </c:description>
- </c:simple-property>
- </c:map-property>
-
- <c:simple-property name="statistics-formatter" required="false">
- <c:description>
- The fully qualified class name of the class to use for formatting managed connection pool statistics for
- this datasource. The class must implement the org.jboss.resource.statistic.formatter.StatisticsFormatter.
- interface. The default is "org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter".
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="type-mapping" displayName="Type Mapping" required="false">
- <c:description>
- The name of the corresponding type-mapping in conf/standardjbosscmp-jdbc.xml.
- </c:description>
- <c:property-options>
- <c:option name="Cloudscape" value="Cloudscape"/>
- <c:option name="DB2" value="DB2"/>
- <c:option name="DB2/400" value="DB2/400"/>
- <c:option name="Derby" value="Derby"/>
- <c:option name="Firebird" value="Firebird"/>
- <c:option name="FirstSQL/J" value="FirstSQL/J"/>
- <c:option name="Hypersonic SQL" value="Hypersonic SQL"/>
- <c:option name="InformixDB" value="InformixDB"/>
- <c:option name="Ingres" value="Ingres"/>
- <c:option name="InterBase" value="InterBase"/>
- <c:option name="MaxDB" value="MaxDB"/>
- <c:option name="McKoi" value="McKoi"/>
- <c:option name="Mimer SQL" value="Mimer SQL"/>
- <c:option name="MS SQLSERVER" value="MS SQLSERVER"/>
- <c:option name="MS SQLSERVER2000" value="MS SQLSERVER2000"/>
- <c:option name="Oracle7" value="Oracle7"/>
- <c:option name="Oracle8" value="Oracle8"/>
- <c:option name="Oracle9i" value="Oracle9i"/>
- <c:option name="PointBase" value="PointBase"/>
- <c:option name="PostgreSQL" value="PostgreSQL"/>
- <c:option name="PostgreSQL 7.2" value="PostgreSQL 7.2"/>
- <c:option name="PostgreSQL 8.0" value="PostgreSQL 8.0"/>
- <c:option name="SapDB" value="SapDB"/>
- <c:option name="SOLID" value="SOLID"/>
- <c:option name="Sybase" value="Sybase"/>
- </c:property-options>
- </c:simple-property>
-
- <c:simple-property name="use-java-context"
- displayName="Use Java Context"
- type="boolean" defaultValue="true"
- required="false">
- <c:description>
- Indicates whether the JNDI name should be bound under the "java" context,
- which causes the DataSource to only be accessible from within the JBossAS VM.
- The default is Yes.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="use-strict-min" type="boolean" required="false">
- <c:description>
- Whether idle connections below the min-pool-size should be closed. The default is No.
- </c:description>
- </c:simple-property>
-
- <c:simple-property name="validate-on-match" type="boolean" required="false" defaultValue="true">
- <c:description>
- The validate-on-match element indicates whether or not connection level validation should be done when a
- connection factory attempts to match a managed connection for a given set. This is typically exclusive to
- the use of background validation. The default is Yes.
- </c:description>
- </c:simple-property>
-'>
-
-]>
-
-<!--############################################# END OF XML ENTITIES ###############################################-->
-
-
-
+
<plugin name="TeiidPlugin" displayName="Teiid Plugin" package="org.teiid.rhq.plugin"
version="2.0.0" description="Supports management and monitoring of JBoss Teiid"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin"
@@ -251,9 +25,9 @@
<depends plugin="JMX" />
<depends plugin="JBossAS5" useClasses="true" />
- <server name="Data Services" description="JBoss Enterprise Data Services"
+ <server name="Data Services" description="Teiid Data Services"
class="PlatformComponent" discovery="PlatformDiscoveryComponent"
- singleton="true" >
+ singleton="true">
<runs-inside>
<parent-resource-type name="JBossAS Server"
@@ -412,8 +186,9 @@
description="State of this Teiid instance" required="false"
readOnly="true" />
<c:simple-property name="resultSetCacheMaxEntries"
- displayName="Result Set Cache Max Entries" description="The maximum number of result set cache entries. 0 indicates no limit. (default 1024)"
- required="false" readOnly="true" />
+ displayName="Result Set Cache Max Entries"
+ description="The maximum number of result set cache entries. 0 indicates no limit. (default 1024)"
+ required="false" readOnly="true" />
<c:simple-property name="maxRowsFetchSize"
displayName="Max Rows Fetch Size"
description="The maximum number of result set cache entries. 0 indicates no limit. (default 1024)"
@@ -433,7 +208,7 @@
description="Process pool maximum thread count. (default 16) Increase this value if your load includes a large number of XQueries or if the system's available processors is larger than 8"
required="false" readOnly="true" />
<c:simple-property name="timeSliceInMilli"
- displayName="Time Slice In Milli"
+ displayName="Time Slice In Milliseconds"
description="Query processor time slice, in milliseconds. (default 2000)"
required="false" readOnly="true" />
<c:simple-property name="processDebugAllowed"
@@ -450,22 +225,23 @@
<c:simple-property name="resultSetCacheEnabled"
displayName="Result Set Cache Enabled"
description="Denotes whether or not result set caching is enabled. (default true)"
- required="false" readOnly="true" type="boolean"/>
+ required="false" readOnly="true" type="boolean" />
<c:simple-property name="codeTablesMaxRowsPerTable"
- displayName="Code Tables Max Rows PerTable"
+ displayName="Code Tables Max Rows Per Table"
description="Maximum number of records in all lookup tables (default 200000)"
required="false" readOnly="true" />
<c:simple-property name="activeSessionsCount"
displayName="Active Session Count" description="Count of active sessions"
required="false" readOnly="true" />
</c:map-property>
- <c:map-property name="bufferServiceProperties" displayName="Buffer Service Properties"
- description="Properties for use by the Buffer Service">
+ <c:map-property name="bufferServiceProperties"
+ displayName="Buffer Service Properties" description="Properties for use by the Buffer Service">
<c:simple-property name="state" displayName="State"
description="State of this bean instance" required="false"
readOnly="true" />
<c:simple-property name="processorBatchSize"
- displayName="Processor Batch Size" description="The max row count of a batch sent internally within the query processor. Should be <= the connectorBatchSize. (default 256)"
+ displayName="Processor Batch Size"
+ description="The max row count of a batch sent internally within the query processor. Should be <= the connectorBatchSize. (default 256)"
required="false" readOnly="true" />
<c:simple-property name="connectorBatchSize"
displayName="Connector Batch Size"
@@ -483,28 +259,24 @@
description="The number of batch columns to allow in memory (default 16384). This value should be set lower or higher depending on the available memory to Teiid in the VM. 16384 is considered a good default for a dedicated 32-bit VM running Teiid with a 1 gig heap."
required="false" readOnly="true" />
</c:map-property>
- <c:map-property name="authorizationServiceProperties" displayName="Authorization Service Properties"
- description="Properties for use by the Authorization Service">
+ <c:map-property name="authorizationServiceProperties"
+ displayName="Authorization Service Properties" description="Properties for use by the Authorization Service">
<c:simple-property name="state" displayName="State"
description="State of this bean instance" required="false"
readOnly="true" />
</c:map-property>
- <c:map-property name="jdbcSocketConfigurationProperties" displayName="Jdbc Socket Configuration Properties"
- description="Properties for use by the Jdbc Socket Configuration">
+ <c:map-property name="jdbcSocketConfigurationProperties"
+ displayName="Jdbc Socket Configuration Properties" description="Properties for use by the Jdbc Socket Configuration">
<c:simple-property name="state" displayName="State"
description="State of this bean instance" required="false"
readOnly="true" />
- <c:simple-property name="portNumber"
- displayName="Port Number" description="Port Number"
- required="false" readOnly="true" />
- <c:simple-property name="enabled"
- displayName=" SSL Enabled"
- description="SSL enabled"
- required="false" readOnly="true" type="boolean" default="true" />
- <c:simple-property name="hostName"
- displayName="Host Name"
- description="Host Name"
- required="false" readOnly="true" />
+ <c:simple-property name="portNumber" displayName="Port Number"
+ description="Port Number" required="false" readOnly="true" />
+ <c:simple-property name="enabled" displayName=" SSL Enabled"
+ description="SSL enabled" required="false" readOnly="true" type="boolean"
+ default="true" />
+ <c:simple-property name="hostName" displayName="Host Name"
+ description="Host Name" required="false" readOnly="true" />
<c:simple-property name="maxSocketThreads"
displayName="Max Socket Threads" description="Max NIO threads"
required="false" readOnly="true" />
@@ -515,15 +287,16 @@
<c:simple-property name="outputBufferSize"
displayName="Output Buffer Size"
description="SO_SNDBUF size, 0 indicates that system default should be used (default 0)"
- required="false" readOnly="true" />
+ required="false" readOnly="true" />
</c:map-property>
- <c:map-property name="sessionServiceProperties" displayName="Session Service Properties"
- description="Properties for use by the Session Service">
+ <c:map-property name="sessionServiceProperties"
+ displayName="Session Service Properties" description="Properties for use by the Session Service">
<c:simple-property name="state" displayName="State"
description="State of this bean instance" required="false"
readOnly="true" />
<c:simple-property name="sessionExpirationTimeLimit"
- displayName="Session Expiration Time Limit" description="Max allowed time before the session is terminated by the system, 0 indicates unlimited (default 0)"
+ displayName="Session Expiration Time Limit"
+ description="Max allowed time before the session is terminated by the system, 0 indicates unlimited (default 0)"
required="false" readOnly="true" />
<c:simple-property name="sessionMaxLimit"
displayName="Session Max Limit"
@@ -533,10 +306,9 @@
</c:group>
</resource-configuration>
- <service name="Virtual Database (VDB)s"
- description="JBoss Enterprise Data Services Virtual Databases" class="VDBComponent"
- discovery="VDBDiscoveryComponent" createDeletePolicy="both"
- creationDataType="content">
+ <service name="Virtual Database (VDB)s" description="Teiid Data Services Virtual Databases"
+ class="VDBComponent" discovery="VDBDiscoveryComponent"
+ createDeletePolicy="both" creationDataType="content">
<operation name="getSessions" displayName="View VDB Sessions"
description="Get current sessions currently connected to this VDB">
@@ -606,11 +378,11 @@
<metric displayName="Status" defaultOn="true" dataType="trait"
displayType="summary" category="availability" property="status"
description="The status of this VDB" />
-
- <metric displayName="Error" defaultOn="true" dataType="trait"
- displayType="summary" category="availability" property="errormessages"
- description="The status of this VDB" />
+ <metric displayName="Errors" defaultOn="true" dataType="trait"
+ displayType="summary" category="availability" property="errorCount"
+ description="Whether or not errors exist for this VDB" />
+
<content name="vdb" displayName="VDB Archive" category="deployable"
isCreationType="true">
</content>
@@ -628,15 +400,15 @@
description="The Virtual Database Status" required="false"
summary="true">
<c:property-options>
- <c:option value="ACTIVE" name="ACTIVE" />
- <c:option value="INACTIVE" name="INACTIVE" default="true" />
+ <c:option value="ACTIVE" name="UP" />
+ <c:option value="INACTIVE" name="DOWN" default="true" />
</c:property-options>
</c:simple-property>
<c:simple-property name="url" type="string"
description="The Virtual Database URL" required="false" />
</c:group>
<c:group name="Models" displayName="Models" hiddenByDefault="false">
- <c:list-property name="sourceModels" readOnly="true"
+ <c:list-property name="sourceModels" readOnly="true"
description="The source models for this VDB">
<c:map-property name="model">
<c:simple-property name="name" displayName="Name"
@@ -648,13 +420,13 @@
displayName="Connector Binding JNDI Name" description="JNDI name for this connector binding"
required="false" />
<c:simple-property name="visibility"
- displayName="Visible" description="Visibility of the model"
- required="true">
+ displayName="Visible" description="Visibility of the model"
+ required="true" type="boolean">
</c:simple-property>
<c:simple-property name="supportsMultiSource"
displayName="Supports Multi-source?"
description="Determines if this model supports multi-source bindings"
- required="true" default="true" />
+ required="true" default="true" type="boolean" />
</c:map-property>
</c:list-property>
<c:list-property name="logicalModels" readOnly="true"
@@ -683,6 +455,7 @@
</c:group>
</resource-configuration>
+
</service>
</server>
14 years, 8 months