[jboss-cvs] JBossAS SVN: r107231 - in projects/jboss-jca/branches/performance/extensions/src/main: java/org/jboss/jca/performance/ext/stdio and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jul 30 06:52:01 EDT 2010
Author: jeff.zhang
Date: 2010-07-30 06:52:01 -0400 (Fri, 30 Jul 2010)
New Revision: 107231
Added:
projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/stdio/
projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/stdio/ExtLoggingOutputStream.java
projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/stdio/ExtWriterOutputStream.java
Removed:
projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtLoggingOutputStream.java
projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtWriterOutputStream.java
Modified:
projects/jboss-jca/branches/performance/extensions/src/main/resources/stdio.xml
Log:
[JBJCA-386] move java files extends from stdio to stdio sub-directory
Deleted: projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtLoggingOutputStream.java
===================================================================
--- projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtLoggingOutputStream.java 2010-07-30 10:36:14 UTC (rev 107230)
+++ projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtLoggingOutputStream.java 2010-07-30 10:52:01 UTC (rev 107231)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.performance.ext;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.jboss.stdio.LoggingWriter;
-/**
- * ExtLoggingOutputStream
- *
- * @author Jeff Zhang
- * @version $Revision: $
- */
-public class ExtLoggingOutputStream extends ExtWriterOutputStream
-{
- /**
- * Construct a new instance.
- *
- * @param category the log category to use
- * @param levelName the name of the level at which to log messages
- */
- public ExtLoggingOutputStream(final String category, final String levelName) {
- this(category, Level.parse(levelName));
- }
-
- /**
- * Construct a new instance.
- *
- * @param category the log category to use
- * @param level the level at which to log messages
- */
- public ExtLoggingOutputStream(final String category, final Level level) {
- this(Logger.getLogger(category), level);
- }
-
- /**
- * Construct a new instance.
- *
- * @param log the logger to use
- * @param level the level at which to log messages
- */
- public ExtLoggingOutputStream(final Logger log, final Level level) {
- super(new LoggingWriter(log, level));
- }
-
-}
Deleted: projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtWriterOutputStream.java
===================================================================
--- projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtWriterOutputStream.java 2010-07-30 10:36:14 UTC (rev 107230)
+++ projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtWriterOutputStream.java 2010-07-30 10:52:01 UTC (rev 107231)
@@ -1,128 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.performance.ext;
-
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Writer;
-
-import org.jboss.stdio.WriterOutputStream;
-
-/**
- * ExtWriterOutputStream
- *
- * @author Jeff Zhang
- * @version $Revision: $
- */
-public class ExtWriterOutputStream extends WriterOutputStream
-{
- /** output data filename */
- private String dataFile;
-
- /** file to output data */
- private FileWriter data = null;
-
- /**
- * Create a new ExtWriterOutputStream.
- *
- * @param writer
- */
- public ExtWriterOutputStream(Writer writer)
- {
- super(writer);
- }
-
- /**
- * Writes a portion of an array of characters.
- *
- * @param cbuf Buffer of characters
- * @param off Offset from which to start writing characters
- * @param len Number of characters to write
- *
- * @exception IOException If an I/O error occurs
- */
- @Override
- public void write(byte[] b, int off, int len) throws IOException
- {
- super.write(b, off, len);
-
- if (b[0] == '@')
- {
- if (b[2] == 'W' && b[3] == 'A')
- return;
- String str = new String(b, off, len);
- System.out.println();
-
- if (data == null)
- {
- if (dataFile != null && !dataFile.equals(""))
- {
- data = new FileWriter(dataFile);
- }
-
- if (data == null)
- throw new IOException("Can't create file" + dataFile);
- }
-
- data.write(str, off + 2, len - 2);
- data.write('\n');
- data.flush();
-
- }
- }
-
- /**
- * close
- *
- * @exception IOException If an I/O error occurs
- */
- @Override
- public void close() throws IOException
- {
- super.close();
- if (data != null)
- {
- data.close();
- }
- }
-
- /**
- * Set the dataFile.
- *
- * @param dataFile The dataFile to set.
- */
- public void setDataFile(String dataFile)
- {
- this.dataFile = dataFile;
- }
-
- /**
- * Get the dataFile.
- *
- * @return the dataFile.
- */
- public String getDataFile()
- {
- return dataFile;
- }
-
-}
Copied: projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/stdio/ExtLoggingOutputStream.java (from rev 107226, projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtLoggingOutputStream.java)
===================================================================
--- projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/stdio/ExtLoggingOutputStream.java (rev 0)
+++ projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/stdio/ExtLoggingOutputStream.java 2010-07-30 10:52:01 UTC (rev 107231)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.performance.ext.stdio;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.jboss.stdio.LoggingWriter;
+/**
+ * ExtLoggingOutputStream
+ *
+ * @author Jeff Zhang
+ * @version $Revision: $
+ */
+public class ExtLoggingOutputStream extends ExtWriterOutputStream
+{
+ /**
+ * Construct a new instance.
+ *
+ * @param category the log category to use
+ * @param levelName the name of the level at which to log messages
+ */
+ public ExtLoggingOutputStream(final String category, final String levelName) {
+ this(category, Level.parse(levelName));
+ }
+
+ /**
+ * Construct a new instance.
+ *
+ * @param category the log category to use
+ * @param level the level at which to log messages
+ */
+ public ExtLoggingOutputStream(final String category, final Level level) {
+ this(Logger.getLogger(category), level);
+ }
+
+ /**
+ * Construct a new instance.
+ *
+ * @param log the logger to use
+ * @param level the level at which to log messages
+ */
+ public ExtLoggingOutputStream(final Logger log, final Level level) {
+ super(new LoggingWriter(log, level));
+ }
+
+}
Copied: projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/stdio/ExtWriterOutputStream.java (from rev 107226, projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/ExtWriterOutputStream.java)
===================================================================
--- projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/stdio/ExtWriterOutputStream.java (rev 0)
+++ projects/jboss-jca/branches/performance/extensions/src/main/java/org/jboss/jca/performance/ext/stdio/ExtWriterOutputStream.java 2010-07-30 10:52:01 UTC (rev 107231)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.performance.ext.stdio;
+
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.jboss.stdio.WriterOutputStream;
+
+/**
+ * ExtWriterOutputStream
+ *
+ * @author Jeff Zhang
+ * @version $Revision: $
+ */
+public class ExtWriterOutputStream extends WriterOutputStream
+{
+ /** output data filename */
+ private String dataFile;
+
+ /** file to output data */
+ private FileWriter data = null;
+
+ /**
+ * Create a new ExtWriterOutputStream.
+ *
+ * @param writer
+ */
+ public ExtWriterOutputStream(Writer writer)
+ {
+ super(writer);
+ }
+
+ /**
+ * Writes a portion of an array of characters.
+ *
+ * @param cbuf Buffer of characters
+ * @param off Offset from which to start writing characters
+ * @param len Number of characters to write
+ *
+ * @exception IOException If an I/O error occurs
+ */
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException
+ {
+ super.write(b, off, len);
+
+ if (b[0] == '@')
+ {
+ if (b[2] == 'W' && b[3] == 'A')
+ return;
+ String str = new String(b, off, len);
+ System.out.println();
+
+ if (data == null)
+ {
+ if (dataFile != null && !dataFile.equals(""))
+ {
+ data = new FileWriter(dataFile);
+ }
+
+ if (data == null)
+ throw new IOException("Can't create file" + dataFile);
+ }
+
+ data.write(str, off + 2, len - 2);
+ data.write('\n');
+ data.flush();
+
+ }
+ }
+
+ /**
+ * close
+ *
+ * @exception IOException If an I/O error occurs
+ */
+ @Override
+ public void close() throws IOException
+ {
+ super.close();
+ if (data != null)
+ {
+ data.close();
+ }
+ }
+
+ /**
+ * Set the dataFile.
+ *
+ * @param dataFile The dataFile to set.
+ */
+ public void setDataFile(String dataFile)
+ {
+ this.dataFile = dataFile;
+ }
+
+ /**
+ * Get the dataFile.
+ *
+ * @return the dataFile.
+ */
+ public String getDataFile()
+ {
+ return dataFile;
+ }
+
+}
Modified: projects/jboss-jca/branches/performance/extensions/src/main/resources/stdio.xml
===================================================================
--- projects/jboss-jca/branches/performance/extensions/src/main/resources/stdio.xml 2010-07-30 10:36:14 UTC (rev 107230)
+++ projects/jboss-jca/branches/performance/extensions/src/main/resources/stdio.xml 2010-07-30 10:52:01 UTC (rev 107231)
@@ -1,6 +1,6 @@
<deployment>
- <bean name="JBossStdioSystemOutStream" class="org.jboss.jca.performance.ext.ExtLoggingOutputStream">
+ <bean name="JBossStdioSystemOutStream" class="org.jboss.jca.performance.ext.stdio.ExtLoggingOutputStream">
<constructor>
<parameter>STDOUT</parameter>
<parameter>INFO</parameter>
More information about the jboss-cvs-commits
mailing list