[Bug 54571] Race condition when handling comet event in thread other than the serving servlet
https://issues.apache.org/bugzilla/show_bug.cgi?id=54571 --- Comment #5 from David Wang --- (In reply to comment #4) > Similar, but significantly different. The demo code uses flush() and does > not close the writer on a different thread in the BEGIN event. > > Something you might like to try is making the closed field in > org.apache.catalina.connector.OutputBuffer volatile. If that fixes the issue > we can look at including that change. Thank you for your great support~! But I have tried the solution above, it dose not work -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 53871] java.lang.StackOverflowError on deploying a web application
https://issues.apache.org/bugzilla/show_bug.cgi?id=53871 pascal.cadet+bugzi...@pressinnov.com changed: What|Removed |Added CC||pascal.cadet+bugzilla@press ||innov.com -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448099 - in /tomcat/trunk/java/org/apache/tomcat/util/http: Cookies.java HttpMessages.java MimeHeaders.java Parameters.java
Author: markt Date: Wed Feb 20 11:42:38 2013 New Revision: 1448099 URL: http://svn.apache.org/r1448099 Log: UCDetector - use final - reduce visibility - remove unused code Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java?rev=1448099&r1=1448098&r2=1448099&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/Cookies.java Wed Feb 20 11:42:38 2013 @@ -50,7 +50,7 @@ public final class Cookies { int cookieCount=0; boolean unprocessed=true; -MimeHeaders headers; +private final MimeHeaders headers; /** * Construct a new cookie collection, that will extract Modified: tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java?rev=1448099&r1=1448098&r2=1448099&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java Wed Feb 20 11:42:38 2013 @@ -29,13 +29,13 @@ import org.apache.tomcat.util.res.String */ public class HttpMessages { // XXX move message resources in this package -protected static final StringManager sm = +private static final StringManager sm = StringManager.getManager("org.apache.tomcat.util.http.res"); -static String st_200=null; -static String st_302=null; -static String st_400=null; -static String st_404=null; +private static String st_200=null; +private static String st_302=null; +private static String st_400=null; +private static String st_404=null; /** Get the status string associated with a status code. * No I18N - return the messages defined in the HTTP spec. Modified: tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java?rev=1448099&r1=1448098&r2=1448099&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java Wed Feb 20 11:42:38 2013 @@ -385,10 +385,10 @@ public class MimeHeaders { we want to keep add O(1). */ class NamesEnumerator implements Enumeration { -int pos; -int size; -String next; -MimeHeaders headers; +private int pos; +private final int size; +private String next; +private final MimeHeaders headers; public NamesEnumerator(MimeHeaders headers) { this.headers=headers; @@ -435,11 +435,11 @@ class NamesEnumerator implements Enumera value element. */ class ValuesEnumerator implements Enumeration { -int pos; -int size; -MessageBytes next; -MimeHeaders headers; -String name; +private int pos; +private final int size; +private MessageBytes next; +private final MimeHeaders headers; +private final String name; ValuesEnumerator(MimeHeaders headers, String name) { this.name=name; @@ -476,8 +476,8 @@ class ValuesEnumerator implements Enumer class MimeHeaderField { -protected final MessageBytes nameB = MessageBytes.newInstance(); -protected final MessageBytes valueB = MessageBytes.newInstance(); +private final MessageBytes nameB = MessageBytes.newInstance(); +private final MessageBytes valueB = MessageBytes.newInstance(); /** * Creates a new, uninitialized header field. Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java?rev=1448099&r1=1448098&r2=1448099&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Wed Feb 20 11:42:38 2013 @@ -27,7 +27,6 @@ import java.util.Map; import org.apache.tomcat.util.buf.B2CConverter; import org.apache.tomcat.util.buf.ByteChunk; -import org.apache.tomcat.util.buf.CharChunk; import org.apache.tomcat.util.buf.MessageBytes; import org.apache.tomcat.util.buf.UDecoder; import org.apache.tomcat.util.log.UserDataHelper; @@ -46,20 +45,20 @@ public final class Parameters { private static final UserDataHelpe
svn commit: r1448103 - in /tomcat/trunk/java/org/apache/tomcat/util/log: CaptureLog.java SystemLogHandler.java UserDataHelper.java
Author: markt Date: Wed Feb 20 11:48:02 2013 New Revision: 1448103 URL: http://svn.apache.org/r1448103 Log: UCDetector - use final - reduce visibility - remove unused code Modified: tomcat/trunk/java/org/apache/tomcat/util/log/CaptureLog.java tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java tomcat/trunk/java/org/apache/tomcat/util/log/UserDataHelper.java Modified: tomcat/trunk/java/org/apache/tomcat/util/log/CaptureLog.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/log/CaptureLog.java?rev=1448103&r1=1448102&r2=1448103&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/log/CaptureLog.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/log/CaptureLog.java Wed Feb 20 11:48:02 2013 @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.tomcat.util.log; import java.io.ByteArrayOutputStream; @@ -33,8 +32,8 @@ class CaptureLog { ps = new PrintStream(baos); } -private ByteArrayOutputStream baos; -private PrintStream ps; +private final ByteArrayOutputStream baos; +private final PrintStream ps; protected PrintStream getStream() { return ps; Modified: tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java?rev=1448103&r1=1448102&r2=1448103&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java Wed Feb 20 11:48:02 2013 @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.tomcat.util.log; import java.io.IOException; @@ -53,19 +52,19 @@ public class SystemLogHandler extends Pr /** * Wrapped PrintStream. */ -protected PrintStream out = null; +private final PrintStream out; /** * Thread <-> CaptureLog associations. */ -protected static ThreadLocal> logs = new ThreadLocal<>(); +private final static ThreadLocal> logs = new ThreadLocal<>(); /** * Spare CaptureLog ready for reuse. */ -protected static Stack reuse = new Stack<>(); +private final static Stack reuse = new Stack<>(); // - Public Methods Modified: tomcat/trunk/java/org/apache/tomcat/util/log/UserDataHelper.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/log/UserDataHelper.java?rev=1448103&r1=1448102&r2=1448103&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/log/UserDataHelper.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/log/UserDataHelper.java Wed Feb 20 11:48:02 2013 @@ -142,16 +142,8 @@ public class UserDataHelper { * Log mode for the next log message. */ public static enum Mode { -DEBUG(false), INFO_THEN_DEBUG(true), INFO(false); - -private final boolean fallToDebug; - -Mode(boolean fallToDebug) { -this.fallToDebug = fallToDebug; -} - -public boolean fallToDebug() { -return fallToDebug; -} +DEBUG, +INFO_THEN_DEBUG, +INFO; } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448108 - in /tomcat/trunk/java/org/apache/tomcat/util/modeler: Registry.java modules/MbeansDescriptorsSerSource.java
Author: markt Date: Wed Feb 20 11:54:55 2013 New Revision: 1448108 URL: http://svn.apache.org/r1448108 Log: Tomcat doesn't use .ser files for MBeans Removed: tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java?rev=1448108&r1=1448107&r2=1448108&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java Wed Feb 20 11:54:55 2013 @@ -553,15 +553,15 @@ public class Registry implements Registr location=url.toString(); type=param; inputsource=url.openStream(); -if( sourceType == null ) { -sourceType = sourceTypeFromExt(location); +if (sourceType == null && location.endsWith(".xml")) { +sourceType = "MbeansDescriptorsDigesterSource"; } } else if( source instanceof File ) { location=((File)source).getAbsolutePath(); inputsource=new FileInputStream((File)source); type=param; -if( sourceType == null ) { -sourceType = sourceTypeFromExt(location); +if (sourceType == null && location.endsWith(".xml")) { +sourceType = "MbeansDescriptorsDigesterSource"; } } else if( source instanceof InputStream ) { type=param; @@ -585,15 +585,6 @@ public class Registry implements Registr return mbeans; } -private String sourceTypeFromExt( String s ) { -if( s.endsWith( ".ser")) { -return "MbeansDescriptorsSerSource"; -} -else if( s.endsWith(".xml")) { -return "MbeansDescriptorsDigesterSource"; -} -return null; -} /** Register a component * XXX make it private - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448116 - in /tomcat/trunk/java/org/apache/tomcat/util/modeler: BaseModelMBean.java BaseNotificationBroadcaster.java ManagedBean.java
Author: markt Date: Wed Feb 20 12:20:30 2013 New Revision: 1448116 URL: http://svn.apache.org/r1448116 Log: UCDetector: Remove unused code Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/BaseModelMBean.java tomcat/trunk/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java tomcat/trunk/java/org/apache/tomcat/util/modeler/ManagedBean.java Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/BaseModelMBean.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/BaseModelMBean.java?rev=1448116&r1=1448115&r2=1448116&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/modeler/BaseModelMBean.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/modeler/BaseModelMBean.java Wed Feb 20 12:20:30 2013 @@ -144,7 +144,6 @@ public class BaseModelMBean implements D // --- DynamicMBean Methods // TODO: move to ManagedBean static final Object[] NO_ARGS_PARAM = new Object[0]; -static final Class[] NO_ARGS_PARAM_SIG = new Class[0]; protected String resourceType = null; @@ -635,28 +634,6 @@ public class BaseModelMBean implements D /** - * Remove an attribute change notification event listener from - * this MBean. - * - * @param listener The listener to be removed - * @param attributeName The attribute name for which no more events are required - * @param handback Handback object to be sent along with event - * notifications - * - * - * @exception ListenerNotFoundException if this listener is not - * registered in the MBean - */ -public void removeAttributeChangeNotificationListener -(NotificationListener listener, String attributeName, Object handback) -throws ListenerNotFoundException { - -removeAttributeChangeNotificationListener(listener, attributeName); - -} - - -/** * Send an AttributeChangeNotification to all registered * listeners. * @@ -891,170 +868,6 @@ public class BaseModelMBean implements D } -/** - * Remove a notification event listener from this MBean. - * - * @param listener The listener to be removed (any and all registrations - * for this listener will be eliminated) - * @param handback Handback object to be sent along with event - * notifications - * - * @exception ListenerNotFoundException if this listener is not - * registered in the MBean - */ -public void removeNotificationListener(NotificationListener listener, - Object handback) -throws ListenerNotFoundException { - -removeNotificationListener(listener); - -} - - -/** - * Remove a notification event listener from this MBean. - * - * @param listener The listener to be removed (any and all registrations - * for this listener will be eliminated) - * @param filter Filter object used to filter event notifications - * actually delivered, or null for no filtering - * @param handback Handback object to be sent along with event - * notifications - * - * @exception ListenerNotFoundException if this listener is not - * registered in the MBean - */ -public void removeNotificationListener(NotificationListener listener, - NotificationFilter filter, - Object handback) -throws ListenerNotFoundException { - -removeNotificationListener(listener); - -} - - -// PersistentMBean Methods - - -///** -// * Instantiates this MBean instance from data found in the persistent -// * store. The data loaded could include attribute and operation values. -// * This method should be called during construction or initialization -// * of the instance, and before the MBean is registered with the -// * MBeanServer. -// * -// * IMPLEMENTATION NOTE - This implementation does -// * not support persistence. -// * -// * @exception InstanceNotFoundException if the managed resource object -// * cannot be found -// * @exception MBeanException if the initializer of the object throws -// * an exception -// * @exception RuntimeOperationsException if an exception is reported -// * by the persistence mechanism -// */ -//public void load() throws InstanceNotFoundException, -//MBeanException, RuntimeOperationsException { -//// XXX If a context was set, use it to load the data -//throw new MBeanException -//(new IllegalStateException("Persistence is not supported"), -// "Persistence is not supported"); -// -//} - - -///** -// * Capture the current state of this MBean instance and write
svn commit: r1448117 - /tomcat/trunk/java/org/apache/tomcat/util/net/URL.java
Author: markt Date: Wed Feb 20 12:27:16 2013 New Revision: 1448117 URL: http://svn.apache.org/r1448117 Log: Deprecate prior to removal Modified: tomcat/trunk/java/org/apache/tomcat/util/net/URL.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/URL.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/URL.java?rev=1448117&r1=1448116&r2=1448117&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/net/URL.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/URL.java Wed Feb 20 12:27:16 2013 @@ -185,7 +185,10 @@ public final class URL implements Serial * * @exception MalformedURLException is never thrown, but present for * compatible APIs + * + * @deprecated Unused. Will be removed in Tomcat 8.0.x */ +@Deprecated public URL(String protocol, String host, String file) throws MalformedURLException { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448118 - /tomcat/trunk/java/org/apache/tomcat/util/net/URL.java
Author: markt Date: Wed Feb 20 12:27:46 2013 New Revision: 1448118 URL: http://svn.apache.org/r1448118 Log: UCDetector: Remove unused code Modified: tomcat/trunk/java/org/apache/tomcat/util/net/URL.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/URL.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/URL.java?rev=1448118&r1=1448117&r2=1448118&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/net/URL.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/URL.java Wed Feb 20 12:27:46 2013 @@ -176,28 +176,6 @@ public final class URL implements Serial /** - * Create a URL object from the specified components. The default port - * number for the specified protocol will be used. - * - * @param protocol Name of the protocol to use - * @param host Name of the host addressed by this protocol - * @param file Filename on the specified host - * - * @exception MalformedURLException is never thrown, but present for - * compatible APIs - * - * @deprecated Unused. Will be removed in Tomcat 8.0.x - */ -@Deprecated -public URL(String protocol, String host, String file) -throws MalformedURLException { - -this(protocol, host, -1, file); - -} - - -/** * Create a URL object from the specified components. Specifying a port * number of -1 indicates that the URL should use the default port for * that protocol. Based on logic from JDK 1.3.1's - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448121 - /tomcat/trunk/java/org/apache/tomcat/util/net/URL.java
Author: markt Date: Wed Feb 20 12:28:52 2013 New Revision: 1448121 URL: http://svn.apache.org/r1448121 Log: Deprecate prior to removal Modified: tomcat/trunk/java/org/apache/tomcat/util/net/URL.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/URL.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/URL.java?rev=1448121&r1=1448120&r2=1448121&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/net/URL.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/URL.java Wed Feb 20 12:28:52 2013 @@ -188,7 +188,10 @@ public final class URL implements Serial * * @exception MalformedURLException is never thrown, but present for * compatible APIs + * + * @deprecated Unused. Will be removed in Tomcat 8.0.x */ +@Deprecated public URL(String protocol, String host, int port, String file) throws MalformedURLException { @@ -524,7 +527,9 @@ public final class URL implements Serial /** * Return a string representation of this URL. This follow the rules in * RFC 2396, Section 5.2, Step 7. + * @deprecated Unused. Will be removed in Tomcat 8.0.x */ +@Deprecated public String toExternalForm() { StringBuilder sb = new StringBuilder(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448122 - /tomcat/trunk/java/org/apache/tomcat/util/net/URL.java
Author: markt Date: Wed Feb 20 12:30:14 2013 New Revision: 1448122 URL: http://svn.apache.org/r1448122 Log: Remove unused code Modified: tomcat/trunk/java/org/apache/tomcat/util/net/URL.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/URL.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/URL.java?rev=1448122&r1=1448121&r2=1448122&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/net/URL.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/URL.java Wed Feb 20 12:30:14 2013 @@ -175,46 +175,6 @@ public final class URL implements Serial } -/** - * Create a URL object from the specified components. Specifying a port - * number of -1 indicates that the URL should use the default port for - * that protocol. Based on logic from JDK 1.3.1's - * java.net.URL. - * - * @param protocol Name of the protocol to use - * @param host Name of the host addressed by this protocol - * @param port Port number, or -1 for the default port for this protocol - * @param file Filename on the specified host - * - * @exception MalformedURLException is never thrown, but present for - * compatible APIs - * - * @deprecated Unused. Will be removed in Tomcat 8.0.x - */ -@Deprecated -public URL(String protocol, String host, int port, String file) -throws MalformedURLException { - -this.protocol = protocol; -this.host = host; -this.port = port; - -int hash = file.indexOf('#'); -this.file = hash < 0 ? file : file.substring(0, hash); -this.ref = hash < 0 ? null : file.substring(hash + 1); -int question = file.lastIndexOf('?'); -if (question >= 0) { -query = file.substring(question + 1); -path = file.substring(0, question); -} else -path = file; - -if ((host != null) && (host.length() > 0)) -authority = (port == -1) ? host : host + ":" + port; - -} - - // - Instance Variables @@ -525,38 +485,6 @@ public final class URL implements Serial /** - * Return a string representation of this URL. This follow the rules in - * RFC 2396, Section 5.2, Step 7. - * @deprecated Unused. Will be removed in Tomcat 8.0.x - */ -@Deprecated -public String toExternalForm() { - -StringBuilder sb = new StringBuilder(); -if (protocol != null) { -sb.append(protocol); -sb.append(":"); -} -if (authority != null) { -sb.append("//"); -sb.append(authority); -} -if (path != null) -sb.append(path); -if (query != null) { -sb.append('?'); -sb.append(query); -} -if (ref != null) { -sb.append('#'); -sb.append(ref); -} -return (sb.toString()); - -} - - -/** * Return a string representation of this object. */ @Override - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448123 - in /tomcat/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketWrapper.java
Author: markt Date: Wed Feb 20 12:31:25 2013 New Revision: 1448123 URL: http://svn.apache.org/r1448123 Log: Remove unused code Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1448123&r1=1448122&r2=1448123&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Feb 20 12:31:25 2013 @@ -1382,7 +1382,6 @@ public class NioEndpoint extends Abstrac setComet(false); timeout = soTimeout; error = false; -lastRegistered = 0; sendfileData = null; if (readLatch != null) { try { Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java?rev=1448123&r1=1448122&r2=1448123&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java Wed Feb 20 12:31:25 2013 @@ -23,7 +23,6 @@ public class SocketWrapper { protected volatile long lastAccess = -1; protected long timeout = -1; protected boolean error = false; -protected long lastRegistered = 0; protected volatile int keepAliveLeft = 100; private boolean comet = false; protected boolean async = false; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448125 - /tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
Author: markt Date: Wed Feb 20 12:36:07 2013 New Revision: 1448125 URL: http://svn.apache.org/r1448125 Log: UCDetector: Use some unused code so log messages can report the acceptor thread name Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1448125&r1=1448124&r2=1448125&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Wed Feb 20 12:36:07 2013 @@ -626,7 +626,9 @@ public abstract class AbstractEndpoint { for (int i = 0; i < count; i++) { acceptors[i] = createAcceptor(); -Thread t = new Thread(acceptors[i], getName() + "-Acceptor-" + i); +String threadName = getName() + "-Acceptor-" + i; +acceptors[i].setThreadName(threadName); +Thread t = new Thread(acceptors[i], threadName); t.setPriority(getAcceptorThreadPriority()); t.setDaemon(getDaemon()); t.start(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448126 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java
Author: markt Date: Wed Feb 20 12:42:19 2013 New Revision: 1448126 URL: http://svn.apache.org/r1448126 Log: Remove unused method. Add Javadoc to the meothd that is used. Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java?rev=1448126&r1=1448125&r2=1448126&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java Wed Feb 20 12:42:19 2013 @@ -153,22 +153,21 @@ public class NioSelectorPool { } /** - * Performs a blocking write using the bytebuffer for data to be written and a selector to block. - * If the selector parameter is null, then it will perform a busy write that could - * take up a lot of CPU cycles. - * @param buf ByteBuffer - the buffer containing the data, we will write as long as (buf.hasRemaining()==true) - * @param socket SocketChannel - the socket to write data to - * @param selector Selector - the selector to use for blocking, if null then a busy write will be initiated - * @param writeTimeout long - the timeout for this write operation in milliseconds, -1 means no timeout + * Performs a write using the bytebuffer for data to be written and a + * selector to block (if blocking is requested). If the + * selector parameter is null, and blocking is requested then + * it will perform a busy write that could take up a lot of CPU cycles. + * @param buf The buffer containing the data, we will write as long as (buf.hasRemaining()==true) + * @param socketThe socket to write data to + * @param selector The selector to use for blocking, if null then a busy write will be initiated + * @param writeTimeout The timeout for this write operation in milliseconds, -1 means no timeout + * @param block true to perform a blocking write + * otherwise a non-blocking write will be performed * @return int - returns the number of bytes written * @throws EOFException if write returns -1 * @throws SocketTimeoutException if the write times out * @throws IOException if an IO Exception occurs in the underlying socket logic */ -public int write(ByteBuffer buf, NioChannel socket, Selector selector, long writeTimeout) throws IOException { -return write(buf,socket,selector,writeTimeout,true); -} - public int write(ByteBuffer buf, NioChannel socket, Selector selector, long writeTimeout, boolean block) throws IOException { if ( SHARED && block ) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448132 - in /tomcat/trunk/java/org/apache/tomcat: spdy/SpdyConnection.java util/log/SystemLogHandler.java
Author: markt Date: Wed Feb 20 12:48:32 2013 New Revision: 1448132 URL: http://svn.apache.org/r1448132 Log: Fix modifier order Modified: tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java Modified: tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java?rev=1448132&r1=1448131&r2=1448132&view=diff == --- tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java (original) +++ tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java Wed Feb 20 12:48:32 2013 @@ -74,7 +74,7 @@ public abstract class SpdyConnection { / static final int FLAG_HALF_CLOSE = 1; -private final static String[] RST_ERRORS = { +private static final String[] RST_ERRORS = { // This is a generic error, and should only be used if a more // specific error is not available. "PROTOCOL_ERROR", "INVALID_STREAM", Modified: tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java?rev=1448132&r1=1448131&r2=1448132&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/log/SystemLogHandler.java Wed Feb 20 12:48:32 2013 @@ -58,13 +58,13 @@ public class SystemLogHandler extends Pr /** * Thread <-> CaptureLog associations. */ -private final static ThreadLocal> logs = new ThreadLocal<>(); +private static final ThreadLocal> logs = new ThreadLocal<>(); /** * Spare CaptureLog ready for reuse. */ -private final static Stack reuse = new Stack<>(); +private static final Stack reuse = new Stack<>(); // - Public Methods - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448133 - /tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
Author: markt Date: Wed Feb 20 12:48:51 2013 New Revision: 1448133 URL: http://svn.apache.org/r1448133 Log: UCDetector Modified: tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java Modified: tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java?rev=1448133&r1=1448132&r2=1448133&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java Wed Feb 20 12:48:51 2013 @@ -298,7 +298,7 @@ public final class IntrospectionUtils { objectMethods.clear(); } -static Hashtable,Method[]> objectMethods = new Hashtable<>(); +private static final Hashtable,Method[]> objectMethods = new Hashtable<>(); public static Method[] findMethods(Class c) { Method methods[] = objectMethods.get(c); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448136 - in /tomcat/trunk/java/org/apache/tomcat/util/scan: FileUrlJar.java UrlJar.java
Author: markt Date: Wed Feb 20 12:53:31 2013 New Revision: 1448136 URL: http://svn.apache.org/r1448136 Log: UCDetector: use final Modified: tomcat/trunk/java/org/apache/tomcat/util/scan/FileUrlJar.java tomcat/trunk/java/org/apache/tomcat/util/scan/UrlJar.java Modified: tomcat/trunk/java/org/apache/tomcat/util/scan/FileUrlJar.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/scan/FileUrlJar.java?rev=1448136&r1=1448135&r2=1448136&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/scan/FileUrlJar.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/scan/FileUrlJar.java Wed Feb 20 12:53:31 2013 @@ -31,7 +31,7 @@ import java.util.zip.ZipEntry; */ public class FileUrlJar implements Jar { -private JarFile jarFile; +private final JarFile jarFile; private Enumeration entries; private JarEntry entry = null; Modified: tomcat/trunk/java/org/apache/tomcat/util/scan/UrlJar.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/scan/UrlJar.java?rev=1448136&r1=1448135&r2=1448136&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/scan/UrlJar.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/scan/UrlJar.java Wed Feb 20 12:53:31 2013 @@ -30,7 +30,7 @@ import java.util.jar.JarEntry; public class UrlJar implements Jar { private NonClosingJarInputStream jarInputStream = null; -private URL url = null; +private final URL url; private JarEntry entry = null; public UrlJar(URL url) throws IOException { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448141 - in /tomcat/trunk/java/org/apache/tomcat/websocket: WsFrameBase.java WsFrameClient.java server/ServerContainerImpl.java server/UriTemplate.java server/WsRemoteEndpointServer.java
Author: markt Date: Wed Feb 20 12:58:46 2013 New Revision: 1448141 URL: http://svn.apache.org/r1448141 Log: UCDetector: use final Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java tomcat/trunk/java/org/apache/tomcat/websocket/server/ServerContainerImpl.java tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java tomcat/trunk/java/org/apache/tomcat/websocket/server/WsRemoteEndpointServer.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java?rev=1448141&r1=1448140&r2=1448141&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameBase.java Wed Feb 20 12:58:46 2013 @@ -67,7 +67,7 @@ public abstract class WsFrameBase { private boolean fin = false; private int rsv = 0; private byte opCode = 0; -private byte[] mask = new byte[4]; +private final byte[] mask = new byte[4]; private int maskIndex = 0; private long payloadLength = 0; private long payloadWritten = 0; Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java?rev=1448141&r1=1448140&r2=1448141&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrameClient.java Wed Feb 20 12:58:46 2013 @@ -26,8 +26,8 @@ import javax.websocket.CloseReason.Close public class WsFrameClient extends WsFrameBase { -private ByteBuffer response; -private AsynchronousSocketChannel channel; +private final ByteBuffer response; +private final AsynchronousSocketChannel channel; private final CompletionHandler handler; public WsFrameClient(ByteBuffer response, AsynchronousSocketChannel channel, Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/ServerContainerImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/ServerContainerImpl.java?rev=1448141&r1=1448140&r2=1448141&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/ServerContainerImpl.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/ServerContainerImpl.java Wed Feb 20 12:58:46 2013 @@ -51,12 +51,12 @@ public class ServerContainerImpl extends // Needs to be a WeakHashMap to prevent memory leaks when a context is // stopped -private static Map classLoaderContainerMap = -new WeakHashMap<>(); -private static Object classLoaderContainerMapLock = new Object(); -private static StringManager sm = +private static final Map +classLoaderContainerMap = new WeakHashMap<>(); +private static final Object classLoaderContainerMapLock = new Object(); +private static final StringManager sm = StringManager.getManager(Constants.PACKAGE_NAME); -protected final Log log = LogFactory.getLog(ServerContainerImpl.class); +private final Log log = LogFactory.getLog(ServerContainerImpl.class); public static ServerContainerImpl getServerContainer() { @@ -75,12 +75,12 @@ public class ServerContainerImpl extends private final WsWriteTimeout wsWriteTimeout = new WsWriteTimeout(); private volatile ServletContext servletContext = null; -private Map configMap = +private final Map configMap = new ConcurrentHashMap<>(); -private Map templateMap = +private final Map templateMap = new ConcurrentHashMap<>(); -private Map> pojoMap = new ConcurrentHashMap<>(); -private Map,PojoMethodMapping> pojoMethodMap = +private final Map> pojoMap = new ConcurrentHashMap<>(); +private final Map,PojoMethodMapping> pojoMethodMap = new ConcurrentHashMap<>(); Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java?rev=1448141&r1=1448140&r2=1448141&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java Wed Feb 20 12:58:46 2013 @@ -32,7 +32,7 @@ import org.apache.tomcat.util.res.String */ public class UriTemplate { -private static StringManager sm = +private static final StringManager sm = StringManager.getManager(Constants.PACKAGE_N
svn commit: r1448143 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/net/AbstractEndpoint.java
Author: markt Date: Wed Feb 20 13:00:30 2013 New Revision: 1448143 URL: http://svn.apache.org/r1448143 Log: UCDetector: Use some unused code so log messages can report the acceptor thread name Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1447817,1448125 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1448143&r1=1448142&r2=1448143&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Wed Feb 20 13:00:30 2013 @@ -626,7 +626,9 @@ public abstract class AbstractEndpoint { for (int i = 0; i < count; i++) { acceptors[i] = createAcceptor(); -Thread t = new Thread(acceptors[i], getName() + "-Acceptor-" + i); +String threadName = getName() + "-Acceptor-" + i; +acceptors[i].setThreadName(threadName); +Thread t = new Thread(acceptors[i], threadName); t.setPriority(getAcceptorThreadPriority()); t.setDaemon(getDaemon()); t.start(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448144 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/net/URL.java
Author: markt Date: Wed Feb 20 13:01:47 2013 New Revision: 1448144 URL: http://svn.apache.org/r1448144 Log: Deprecate Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/URL.java Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1448117,1448121 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/URL.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/URL.java?rev=1448144&r1=1448143&r2=1448144&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/URL.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/URL.java Wed Feb 20 13:01:47 2013 @@ -185,7 +185,10 @@ public final class URL implements Serial * * @exception MalformedURLException is never thrown, but present for * compatible APIs + * + * @deprecated Unused. Will be removed in Tomcat 8.0.x */ +@Deprecated public URL(String protocol, String host, String file) throws MalformedURLException { @@ -207,7 +210,10 @@ public final class URL implements Serial * * @exception MalformedURLException is never thrown, but present for * compatible APIs + * + * @deprecated Unused. Will be removed in Tomcat 8.0.x */ +@Deprecated public URL(String protocol, String host, int port, String file) throws MalformedURLException { @@ -543,7 +549,9 @@ public final class URL implements Serial /** * Return a string representation of this URL. This follow the rules in * RFC 2396, Section 5.2, Step 7. + * @deprecated Unused. Will be removed in Tomcat 8.0.x */ +@Deprecated public String toExternalForm() { StringBuilder sb = new StringBuilder(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448145 - /tomcat/trunk/TOMCAT-NEXT.txt
Author: markt Date: Wed Feb 20 13:02:33 2013 New Revision: 1448145 URL: http://svn.apache.org/r1448145 Log: UCDetector pass of trunk complete Modified: tomcat/trunk/TOMCAT-NEXT.txt Modified: tomcat/trunk/TOMCAT-NEXT.txt URL: http://svn.apache.org/viewvc/tomcat/trunk/TOMCAT-NEXT.txt?rev=1448145&r1=1448144&r2=1448145&view=diff == --- tomcat/trunk/TOMCAT-NEXT.txt (original) +++ tomcat/trunk/TOMCAT-NEXT.txt Wed Feb 20 13:02:33 2013 @@ -34,9 +34,7 @@ but possibly 7.1.x). 5. Run the unused code detector and remove everything that isn't currently used. Add deprecation markers for the removed code to Tomcat 7.0.x -- Complete for javax.* -- Complete for o.a.[catalina|coyote|el|jasper|juli|naming].* -- Remaining code in progress +- Complete 6. Change the default URIEncoding on the connector to UTF-8. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot success in ASF Buildbot on tomcat-7-trunk
The Buildbot has detected a restored build on builder tomcat-7-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-7-trunk/builds/1079 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/tc7.0.x/trunk] 1448144 Blamelist: markt Build succeeded! sincerely, -The Buildbot
svn commit: r1448300 - /tomcat/trunk/java/org/apache/tomcat/websocket/pojo/
Author: markt Date: Wed Feb 20 17:07:35 2013 New Revision: 1448300 URL: http://svn.apache.org/r1448300 Log: Make parameter name consistent Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointConfiguration.java tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBase.java tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBinary.java tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncString.java tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBasicBase.java tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBasicBinary.java tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBasicPong.java tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerBasicString.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointConfiguration.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointConfiguration.java?rev=1448300&r1=1448299&r2=1448300&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointConfiguration.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpointConfiguration.java Wed Feb 20 17:07:35 2013 @@ -34,7 +34,8 @@ public class PojoEndpointConfiguration e public PojoEndpointConfiguration(Class pojoClass, -PojoMethodMapping methodMapping, Map pathParameters) { +PojoMethodMapping methodMapping, +Map pathParameters) { super(PojoEndpoint.class, methodMapping.getWsPath()); this.pojoClass = pojoClass; this.methodMapping = methodMapping; Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBase.java?rev=1448300&r1=1448299&r2=1448300&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBase.java Wed Feb 20 17:07:35 2013 @@ -36,8 +36,8 @@ public abstract class PojoMessageHandler public PojoMessageHandlerAsyncBase(Object pojo, Method method, Session session, Object[] params, int indexPayload, -boolean wrap, int indexBoolean, int indexSession) { -super(pojo, method, session, params, indexPayload, wrap, +boolean unwrap, int indexBoolean, int indexSession) { +super(pojo, method, session, params, indexPayload, unwrap, indexSession); this.indexBoolean = indexBoolean; } Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBinary.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBinary.java?rev=1448300&r1=1448299&r2=1448300&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBinary.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncBinary.java Wed Feb 20 17:07:35 2013 @@ -28,9 +28,9 @@ public class PojoMessageHandlerAsyncBina extends PojoMessageHandlerAsyncBase{ public PojoMessageHandlerAsyncBinary(Object pojo, Method method, -Session session, Object[] params, int indexPayload, boolean wrap, +Session session, Object[] params, int indexPayload, boolean unwrap, int indexBoolean, int indexSession) { -super(pojo, method, session, params, indexPayload, wrap, indexBoolean, +super(pojo, method, session, params, indexPayload, unwrap, indexBoolean, indexSession); } } Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncString.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncString.java?rev=1448300&r1=1448299&r2=1448300&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncString.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerAsyncString.java Wed Feb 20 17:07:35 2013 @@ -27,9 +27,9 @@ public class PojoMessageHandlerAsyncStri extends PojoMessageHandlerAsyncBase{ public PojoMessageHandlerAsyncString(Object pojo, Method method, -Session session, Object[] params, int indexPayload, boolean wrap, +Session session, Object[] params, int indexPayload, boolean unwrap, int inde
svn commit: r1448332 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java
Author: markt Date: Wed Feb 20 18:08:24 2013 New Revision: 1448332 URL: http://svn.apache.org/r1448332 Log: First step in refactoring as it isn't just message handlers we need to determine the generic types for Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1448332&r1=1448331&r2=1448332&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Wed Feb 20 18:08:24 2013 @@ -407,11 +407,11 @@ public class WsSession implements Sessio // Protected so unit tests can use it protected static Class getMessageType(MessageHandler listener) { -return (Class) getMessageType(listener.getClass()); +return (Class) getGenericType(listener.getClass()); } -private static Object getMessageType(Class clazz) { +private static Object getGenericType(Class clazz) { // Look to see if this class implements the generic MessageHandler<> // interface @@ -423,12 +423,12 @@ public class WsSession implements Sessio if (iface instanceof ParameterizedType) { ParameterizedType pi = (ParameterizedType) iface; // Look for the MessageHandler<> interface -if (pi.getRawType().equals(MessageHandler.Basic.class) -|| pi.getRawType().equals(MessageHandler.Async.class)) { -// Whichever interface it is, there is only one generic -// type. -return getTypeParameter( -clazz, pi.getActualTypeArguments()[0]); +if (pi.getRawType() instanceof Class) { +if (MessageHandler.class.isAssignableFrom( +(Class) pi.getRawType())) { +return getTypeParameter( +clazz, pi.getActualTypeArguments()[0]); +} } } } @@ -437,7 +437,7 @@ public class WsSession implements Sessio Class superClazz = (Class) clazz.getSuperclass(); -Object result = getMessageType(superClazz); +Object result = getGenericType(superClazz); if (result instanceof Class) { // Superclass implements interface and defines explicit type for // MessageHandler<> - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448338 - in /tomcat/trunk: java/org/apache/tomcat/websocket/Util.java java/org/apache/tomcat/websocket/WsSession.java test/org/apache/tomcat/websocket/TestUtil.java test/org/apache/tomca
Author: markt Date: Wed Feb 20 18:22:32 2013 New Revision: 1448338 URL: http://svn.apache.org/r1448338 Log: Complete generic type ID refactoring Added: tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java - copied, changed from r1447682, tomcat/trunk/test/org/apache/tomcat/websocket/TestWsSession.java Removed: tomcat/trunk/test/org/apache/tomcat/websocket/TestWsSession.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/Util.java tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/Util.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/Util.java?rev=1448338&r1=1448337&r2=1448338&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/Util.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/Util.java Wed Feb 20 18:22:32 2013 @@ -16,6 +16,9 @@ */ package org.apache.tomcat.websocket; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.lang.reflect.TypeVariable; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Queue; @@ -23,6 +26,7 @@ import java.util.concurrent.ConcurrentLi import javax.websocket.CloseReason.CloseCode; import javax.websocket.CloseReason.CloseCodes; +import javax.websocket.MessageHandler; /** * Utility class for internal use only within the @@ -129,4 +133,76 @@ class Util { return result; } + + +static Class getMessageType(MessageHandler listener) { +return (Class) Util.getGenericType(MessageHandler.class, +listener.getClass()); +} + + +private static Object getGenericType(Class type, +Class clazz) { + +// Look to see if this class implements the generic MessageHandler<> +// interface + +// Get all the interfaces +Type[] interfaces = clazz.getGenericInterfaces(); +for (Type iface : interfaces) { +// Only need to check interfaces that use generics +if (iface instanceof ParameterizedType) { +ParameterizedType pi = (ParameterizedType) iface; +// Look for the MessageHandler<> interface +if (pi.getRawType() instanceof Class) { +if (type.isAssignableFrom((Class) pi.getRawType())) { +return getTypeParameter( +clazz, pi.getActualTypeArguments()[0]); +} +} +} +} + +// Interface not found on this class. Look at the superclass. +Class superClazz = +(Class) clazz.getSuperclass(); + +Object result = getGenericType(type, superClazz); +if (result instanceof Class) { +// Superclass implements interface and defines explicit type for +// MessageHandler<> +return result; +} else if (result instanceof Integer) { +// Superclass implements interface and defines unknown type for +// MessageHandler<> +// Map that unknown type to the generic types defined in this class +ParameterizedType superClassType = +(ParameterizedType) clazz.getGenericSuperclass(); +return getTypeParameter(clazz, +superClassType.getActualTypeArguments()[ +((Integer) result).intValue()]); +} else { +// Error will be logged further up the call stack +return null; +} +} + + +/* + * For a generic parameter, return either the Class used or if the type + * is unknown, the index for the type in definition of the class + */ +private static Object getTypeParameter(Class clazz, Type argType) { +if (argType instanceof Class) { +return argType; +} else { +TypeVariable[] tvs = clazz.getTypeParameters(); +for (int i = 0; i < tvs.length; i++) { +if (tvs[i].equals(argType)) { +return Integer.valueOf(i); +} +} +return null; +} +} } Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1448338&r1=1448337&r2=1448338&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Wed Feb 20 18:22:32 2013 @@ -17,9 +17,7 @@ package org.apache.tomcat.websocket; import java.io.IOException; -import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; -import java.lang.reflect.TypeVariable; import java.net.URI;
svn commit: r1448342 - in /tomcat/trunk: java/org/apache/tomcat/websocket/Util.java test/org/apache/tomcat/websocket/TestUtil.java
Author: markt Date: Wed Feb 20 18:35:39 2013 New Revision: 1448342 URL: http://svn.apache.org/r1448342 Log: Add tests for Encoders Modified: tomcat/trunk/java/org/apache/tomcat/websocket/Util.java tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/Util.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/Util.java?rev=1448342&r1=1448341&r2=1448342&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/Util.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/Util.java Wed Feb 20 18:35:39 2013 @@ -26,6 +26,7 @@ import java.util.concurrent.ConcurrentLi import javax.websocket.CloseReason.CloseCode; import javax.websocket.CloseReason.CloseCodes; +import javax.websocket.Encoder; import javax.websocket.MessageHandler; /** @@ -141,6 +142,12 @@ class Util { } +static Class getEncoderType(Encoder encoder) { +return (Class) Util.getGenericType(Encoder.class, +encoder.getClass()); +} + + private static Object getGenericType(Class type, Class clazz) { Modified: tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java?rev=1448342&r1=1448341&r2=1448342&view=diff == --- tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java (original) +++ tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java Wed Feb 20 18:35:39 2013 @@ -16,6 +16,8 @@ */ package org.apache.tomcat.websocket; +import javax.websocket.EncodeException; +import javax.websocket.Encoder; import javax.websocket.MessageHandler; import org.junit.Assert; @@ -26,39 +28,75 @@ public class TestUtil { @Test public void testGetMessageTypeSimple() { Assert.assertEquals( -String.class, Util.getMessageType(new Simple())); +String.class, Util.getMessageType(new SimpleMessageHandler())); } @Test public void testGetMessageTypeSubclass() { Assert.assertEquals(String.class, -Util.getMessageType(new SubSimple())); +Util.getMessageType(new SubSimpleMessageHandler())); } @Test public void testGetMessageTypeGenericSubclass() { Assert.assertEquals(String.class, -Util.getMessageType(new GenericSub())); +Util.getMessageType(new GenericSubMessageHandler())); } @Test public void testGetMessageTypeGenericMultipleSubclass() { Assert.assertEquals(String.class, -Util.getMessageType(new GenericMultipleSubSub())); +Util.getMessageType(new GenericMultipleSubSubMessageHandler())); } @Test public void testGetMessageTypeGenericMultipleSubclassSwap() { Assert.assertEquals(String.class, -Util.getMessageType(new GenericMultipleSubSubSwap())); +Util.getMessageType(new GenericMultipleSubSubSwapMessageHandler())); } -private static class Simple implements MessageHandler.Basic { +@Test +public void testGetEncoderTypeSimple() { +Assert.assertEquals( +String.class, Util.getEncoderType(new SimpleEncoder())); +} + + +@Test +public void testGetEncoderTypeSubclass() { +Assert.assertEquals(String.class, +Util.getEncoderType(new SubSimpleEncoder())); +} + + +@Test +public void testGetEncoderTypeGenericSubclass() { +Assert.assertEquals(String.class, +Util.getEncoderType(new GenericSubEncoder())); +} + + +@Test +public void testGetEncoderTypeGenericMultipleSubclass() { +Assert.assertEquals(String.class, +Util.getEncoderType(new GenericMultipleSubSubEncoder())); +} + + +@Test +public void testGetEncoderTypeGenericMultipleSubclassSwap() { +Assert.assertEquals(String.class, +Util.getEncoderType(new GenericMultipleSubSubSwapEncoder())); +} + + +private static class SimpleMessageHandler +implements MessageHandler.Basic { @Override public void onMessage(String message) { // NO-OP @@ -66,16 +104,17 @@ public class TestUtil { } -private static class SubSimple extends Simple { +private static class SubSimpleMessageHandler extends SimpleMessageHandler { } -private abstract static class Generic +private abstract static class GenericMessageHandler implements MessageHandler.Basic { } -private static class GenericSub extends Generic{ +private static class GenericSubMessageHandler +extends GenericMessageHandler{ @Override public void onMessage(Strin
svn commit: r1448343 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java
Author: markt Date: Wed Feb 20 18:36:11 2013 New Revision: 1448343 URL: http://svn.apache.org/r1448343 Log: Remove old comment Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1448343&r1=1448342&r2=1448343&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Wed Feb 20 18:36:11 2013 @@ -402,6 +402,4 @@ public class WsSession implements Sessio } } } - -// Protected so unit tests can use it } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448384 - /tomcat/maven-plugin/trunk/pom.xml
Author: olamy Date: Wed Feb 20 20:39:13 2013 New Revision: 1448384 URL: http://svn.apache.org/r1448384 Log: use non versionned path to deploy current trunk doc: snapshot doc history is not needed Modified: tomcat/maven-plugin/trunk/pom.xml Modified: tomcat/maven-plugin/trunk/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/pom.xml?rev=1448384&r1=1448383&r2=1448384&view=diff == --- tomcat/maven-plugin/trunk/pom.xml (original) +++ tomcat/maven-plugin/trunk/pom.xml Wed Feb 20 20:39:13 2013 @@ -62,7 +62,8 @@ apache.snapshots.https scp://people.apache.org/www/tomcat.apache.org/maven-plugin-${project.version} -http://tomcat.apache.org/maven-plugin-${project.version} +maven-plugin-trunk +http://tomcat.apache.org/${sitePath} 1973 @@ -725,7 +726,7 @@ maven-scm-publish-plugin 1.0-beta-2 - scm:svn:https://svn.apache.org/repos/asf/tomcat/site/trunk/docs/maven-plugin-${project.version} + scm:svn:https://svn.apache.org/repos/asf/tomcat/site/trunk/docs/${sitePath} Apache Tomcat Maven Plugin site documentation for ${project.version} ${tomcat-maven.siteFilePath} ${tomcat-maven.scmPubCheckoutDirectory} @@ -870,6 +871,12 @@ + site-release + +maven-plugin-${project.version} + + + reporting - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448389 - /tomcat/site/trunk/docs/maven-plugin-trunk/
Author: olamy Date: Wed Feb 20 20:44:01 2013 New Revision: 1448389 URL: http://svn.apache.org/r1448389 Log: Automatic svn path creation: https://svn.apache.org/repos/asf/tomcat/site/trunk/docs/maven-plugin-trunk Added: tomcat/site/trunk/docs/maven-plugin-trunk/ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448392 - in /tomcat/site/trunk/docs/maven-plugin-trunk: ./ apidocs/ apidocs/class-use/ apidocs/org/ apidocs/org/apache/ apidocs/org/apache/tomcat/ apidocs/org/apache/tomcat/maven/ apidoc
Author: olamy Date: Wed Feb 20 20:46:41 2013 New Revision: 1448392 URL: http://svn.apache.org/r1448392 Log: Apache Tomcat Maven Plugin site documentation for 2.1-SNAPSHOT [This commit notification would consist of 119 parts, which exceeds the limit of 50 ones, so it was shortened to the summary.] - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448394 - in /tomcat/site/trunk: docs/maven-plugin.html xdocs/maven-plugin.xml
Author: olamy Date: Wed Feb 20 20:50:07 2013 New Revision: 1448394 URL: http://svn.apache.org/r1448394 Log: update with new path of trunk tomcat plugin doc path Modified: tomcat/site/trunk/docs/maven-plugin.html tomcat/site/trunk/xdocs/maven-plugin.xml Modified: tomcat/site/trunk/docs/maven-plugin.html URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/maven-plugin.html?rev=1448394&r1=1448393&r2=1448394&view=diff == --- tomcat/site/trunk/docs/maven-plugin.html (original) +++ tomcat/site/trunk/docs/maven-plugin.html Wed Feb 20 20:50:07 2013 @@ -203,7 +203,7 @@ -Version 2.1-SNAPSHOT (under development) +Trunk documentation (under development) Version 2.0 (released version: 2012-09-14) Modified: tomcat/site/trunk/xdocs/maven-plugin.xml URL: http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/maven-plugin.xml?rev=1448394&r1=1448393&r2=1448394&view=diff == --- tomcat/site/trunk/xdocs/maven-plugin.xml (original) +++ tomcat/site/trunk/xdocs/maven-plugin.xml Wed Feb 20 20:50:07 2013 @@ -21,7 +21,7 @@ More details are available in the Maven generated site: -Version 2.1-SNAPSHOT (under development) +Trunk documentation (under development) Version 2.0 (released version: 2012-09-14) Version 2.0-beta-1 (released version: 2012-02-01) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448395 - /tomcat/site/trunk/docs/maven-plugin-2.1-SNAPSHOT/
Author: olamy Date: Wed Feb 20 20:50:47 2013 New Revision: 1448395 URL: http://svn.apache.org/r1448395 Log: remove versionned snapshot doc: not needed anymore Removed: tomcat/site/trunk/docs/maven-plugin-2.1-SNAPSHOT/ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448407 - /tomcat/maven-plugin/trunk/README.txt
Author: olamy Date: Wed Feb 20 20:58:49 2013 New Revision: 1448407 URL: http://svn.apache.org/r1448407 Log: fix README site deployment with svnpubsub Modified: tomcat/maven-plugin/trunk/README.txt Modified: tomcat/maven-plugin/trunk/README.txt URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/README.txt?rev=1448407&r1=1448406&r2=1448407&view=diff == --- tomcat/maven-plugin/trunk/README.txt (original) +++ tomcat/maven-plugin/trunk/README.txt Wed Feb 20 20:58:49 2013 @@ -25,17 +25,9 @@ Checkstyle: this project uses the Apache Site: to test site generation, just run: mvn site. If you want more reporting (javadoc, pmd, checkstyle, jxr, changelog from jira entries), use: mvn site -Preporting. -To deploy site, use: mvn clean site-deploy -Preporting. The site will be deployed to http://tomcat.apache.org/maven-plugin-${project.version} +To deploy site, use: mvn clean site-deploy scm-publish:publish-scm -Dusername=$svnuid -Dpassword=$svnpwd -Preporting . The site will be deployed to http://tomcat.apache.org/maven-plugin-trunk($svnuid is your asf id, $svnpwd is your asf password) -Note you need some configuration in ~/.m2/settings.xml: - - apache.website - your asf id - 664 - 775 - - -If you have a nice ssh key in ~/.ssh/ no need of configuring password, privateKey, passphrase. +When releasing deploy with -Psite-release Releasing -- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448417 - /tomcat/maven-plugin/tags/tomcat-maven-plugin-2.1/
Author: olamy Date: Wed Feb 20 21:11:15 2013 New Revision: 1448417 URL: http://svn.apache.org/r1448417 Log: [maven-release-plugin] copy for tag tomcat-maven-plugin-2.1 Added: tomcat/maven-plugin/tags/tomcat-maven-plugin-2.1/ - copied from r1448416, tomcat/maven-plugin/trunk/ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448416 - in /tomcat/maven-plugin/trunk: common-tomcat-maven-plugin/pom.xml pom.xml tomcat-maven-archetype/pom.xml tomcat-maven-plugin-it/pom.xml tomcat6-maven-plugin/pom.xml tomcat7-mave
Author: olamy Date: Wed Feb 20 21:11:10 2013 New Revision: 1448416 URL: http://svn.apache.org/r1448416 Log: [maven-release-plugin] prepare release tomcat-maven-plugin-2.1 Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml tomcat/maven-plugin/trunk/pom.xml tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml?rev=1448416&r1=1448415&r2=1448416&view=diff == --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml Wed Feb 20 21:11:10 2013 @@ -24,7 +24,7 @@ tomcat-maven-plugin org.apache.tomcat.maven -2.1-SNAPSHOT +2.1 common-tomcat-maven-plugin Apache Tomcat Maven Plugin :: Common API Modified: tomcat/maven-plugin/trunk/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/pom.xml?rev=1448416&r1=1448415&r2=1448416&view=diff == --- tomcat/maven-plugin/trunk/pom.xml (original) +++ tomcat/maven-plugin/trunk/pom.xml Wed Feb 20 21:11:10 2013 @@ -32,7 +32,7 @@ tomcat-maven-plugin pom Apache Tomcat Maven Plugin - 2.1-SNAPSHOT + 2.1 The Tomcat Maven Plugin provides goals to manipulate WAR projects within the Tomcat servlet container. @@ -248,9 +248,9 @@ - scm:svn:http://svn.apache.org/repos/asf/tomcat/maven-plugin/trunk/ - scm:svn:https://svn.apache.org/repos/asf/tomcat/maven-plugin/trunk/ -http://svn.apache.org/viewvc/tomcat/maven-plugin/ + scm:svn:http://svn.apache.org/repos/asf/tomcat/maven-plugin/tags/tomcat-maven-plugin-2.1 + scm:svn:https://svn.apache.org/repos/asf/tomcat/maven-plugin/tags/tomcat-maven-plugin-2.1 + http://svn.apache.org/viewvc/tomcat/maven-plugin/tags/tomcat-maven-plugin-2.1 Modified: tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml?rev=1448416&r1=1448415&r2=1448416&view=diff == --- tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml Wed Feb 20 21:11:10 2013 @@ -23,7 +23,7 @@ org.apache.tomcat.maven tomcat-maven-plugin -2.1-SNAPSHOT +2.1 ../pom.xml Modified: tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml?rev=1448416&r1=1448415&r2=1448416&view=diff == --- tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml Wed Feb 20 21:11:10 2013 @@ -22,7 +22,7 @@ org.apache.tomcat.maven tomcat-maven-plugin -2.1-SNAPSHOT +2.1 4.0.0 Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml?rev=1448416&r1=1448415&r2=1448416&view=diff == --- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml Wed Feb 20 21:11:10 2013 @@ -21,7 +21,7 @@ org.apache.tomcat.maven tomcat-maven-plugin -2.1-SNAPSHOT +2.1 ../pom.xml Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml?rev=1448416&r1=1448415&r2=1448416&view=diff == --- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml Wed Feb 20 21:11:10 2013 @@ -23,7 +23,7 @@ tomcat-maven-plugin org.apache.tomcat.maven -2.1-SNAPSHOT +2.1 tomcat7-maven-plugin maven-plugin Modified: tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml?rev=1448416&r1=1448415&r2=1448416&view=diff == --- tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml Wed Feb 20 21:11:10 2013 @
svn commit: r1448418 - in /tomcat/maven-plugin/trunk: common-tomcat-maven-plugin/pom.xml pom.xml tomcat-maven-archetype/pom.xml tomcat-maven-plugin-it/pom.xml tomcat6-maven-plugin/pom.xml tomcat7-mave
Author: olamy Date: Wed Feb 20 21:11:20 2013 New Revision: 1448418 URL: http://svn.apache.org/r1448418 Log: [maven-release-plugin] prepare for next development iteration Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml tomcat/maven-plugin/trunk/pom.xml tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml?rev=1448418&r1=1448417&r2=1448418&view=diff == --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml (original) +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml Wed Feb 20 21:11:20 2013 @@ -24,7 +24,7 @@ tomcat-maven-plugin org.apache.tomcat.maven -2.1 +2.2-SNAPSHOT common-tomcat-maven-plugin Apache Tomcat Maven Plugin :: Common API Modified: tomcat/maven-plugin/trunk/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/pom.xml?rev=1448418&r1=1448417&r2=1448418&view=diff == --- tomcat/maven-plugin/trunk/pom.xml (original) +++ tomcat/maven-plugin/trunk/pom.xml Wed Feb 20 21:11:20 2013 @@ -32,7 +32,7 @@ tomcat-maven-plugin pom Apache Tomcat Maven Plugin - 2.1 + 2.2-SNAPSHOT The Tomcat Maven Plugin provides goals to manipulate WAR projects within the Tomcat servlet container. @@ -248,9 +248,9 @@ - scm:svn:http://svn.apache.org/repos/asf/tomcat/maven-plugin/tags/tomcat-maven-plugin-2.1 - scm:svn:https://svn.apache.org/repos/asf/tomcat/maven-plugin/tags/tomcat-maven-plugin-2.1 - http://svn.apache.org/viewvc/tomcat/maven-plugin/tags/tomcat-maven-plugin-2.1 + scm:svn:http://svn.apache.org/repos/asf/tomcat/maven-plugin/trunk/ + scm:svn:https://svn.apache.org/repos/asf/tomcat/maven-plugin/trunk/ +http://svn.apache.org/viewvc/tomcat/maven-plugin/ Modified: tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml?rev=1448418&r1=1448417&r2=1448418&view=diff == --- tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat-maven-archetype/pom.xml Wed Feb 20 21:11:20 2013 @@ -23,7 +23,7 @@ org.apache.tomcat.maven tomcat-maven-plugin -2.1 +2.2-SNAPSHOT ../pom.xml Modified: tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml?rev=1448418&r1=1448417&r2=1448418&view=diff == --- tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/pom.xml Wed Feb 20 21:11:20 2013 @@ -22,7 +22,7 @@ org.apache.tomcat.maven tomcat-maven-plugin -2.1 +2.2-SNAPSHOT 4.0.0 Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml?rev=1448418&r1=1448417&r2=1448418&view=diff == --- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml Wed Feb 20 21:11:20 2013 @@ -21,7 +21,7 @@ org.apache.tomcat.maven tomcat-maven-plugin -2.1 +2.2-SNAPSHOT ../pom.xml Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml?rev=1448418&r1=1448417&r2=1448418&view=diff == --- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml Wed Feb 20 21:11:20 2013 @@ -23,7 +23,7 @@ tomcat-maven-plugin org.apache.tomcat.maven -2.1 +2.2-SNAPSHOT tomcat7-maven-plugin maven-plugin Modified: tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml?rev=1448418&r1=1448417&r2=1448418&view=diff == --- tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml (original) +++ tomcat/maven-plugin/trunk/tomcat7-war-runner/pom.xml Wed Feb 20 21:11:20 2013 @@
svn commit: r1448429 - /tomcat/site/trunk/docs/maven-plugin-2.1/
Author: olamy Date: Wed Feb 20 21:34:41 2013 New Revision: 1448429 URL: http://svn.apache.org/r1448429 Log: Automatic svn path creation: https://svn.apache.org/repos/asf/tomcat/site/trunk/docs/maven-plugin-2.1 Added: tomcat/site/trunk/docs/maven-plugin-2.1/ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448430 - in /tomcat/site/trunk/docs/maven-plugin-2.1: ./ apidocs/ apidocs/org/ apidocs/org/apache/ apidocs/org/apache/tomcat/ apidocs/org/apache/tomcat/maven/ apidocs/org/apache/tomcat/m
Author: olamy Date: Wed Feb 20 21:43:24 2013 New Revision: 1448430 URL: http://svn.apache.org/r1448430 Log: Apache Tomcat Maven Plugin site documentation for 2.1 [This commit notification would consist of 124 parts, which exceeds the limit of 50 ones, so it was shortened to the summary.] - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1462 - in /dev/tomcat/maven-plugin/v2.1: ./ tomcat-maven-plugin-2.1-source-release.zip tomcat-maven-plugin-2.1-source-release.zip.asc
Author: olamy Date: Wed Feb 20 21:48:33 2013 New Revision: 1462 Log: 2.1 source release zip Added: dev/tomcat/maven-plugin/v2.1/ dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip (with props) dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip.asc Added: dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip == Binary file - no diff available. Propchange: dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip -- svn:mime-type = application/octet-stream Added: dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip.asc == --- dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip.asc (added) +++ dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip.asc Wed Feb 20 21:48:33 2013 @@ -0,0 +1,7 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1.4.12 (Darwin) + +iEYEABECAAYFAlElPCAACgkQhzqOhrQ3IUYujgCfcPOGOHZeONPt95LEvnmHCVjn +v8IAmgOhJxSIth8s4h9IpctIvS0IYwEA +=VuLp +-END PGP SIGNATURE- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1462 - in /dev/tomcat/maven-plugin/v2.1: ./ tomcat-maven-plugin-2.1-source-release.zip tomcat-maven-plugin-2.1-source-release.zip.asc
Author: olamy Date: Wed Feb 20 21:48:33 2013 New Revision: 1462 Log: 2.1 source release zip Added: dev/tomcat/maven-plugin/v2.1/ dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip (with props) dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip.asc Added: dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip == Binary file - no diff available. Propchange: dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip -- svn:mime-type = application/octet-stream Added: dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip.asc == --- dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip.asc (added) +++ dev/tomcat/maven-plugin/v2.1/tomcat-maven-plugin-2.1-source-release.zip.asc Wed Feb 20 21:48:33 2013 @@ -0,0 +1,7 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1.4.12 (Darwin) + +iEYEABECAAYFAlElPCAACgkQhzqOhrQ3IUYujgCfcPOGOHZeONPt95LEvnmHCVjn +v8IAmgOhJxSIth8s4h9IpctIvS0IYwEA +=VuLp +-END PGP SIGNATURE- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[VOTE] Apache Tomcat Maven Plugin 2.1
Hi, I'd like to release Apache Tomcat Maven Plugin 2.1. 24 issues fixed (see changelog: http://tomcat.apache.org/maven-plugin-2.1/jira-report.html) Staging maven repository: https://repository.apache.org/content/repositories/orgapachetomcat-282/ Source release files: https://dist.apache.org/repos/dist/dev/tomcat/maven-plugin/v2.1/ Documentation site: http://tomcat.apache.org/maven-plugin-2.1/ Vote open for 72H [+1] [0] [-1] Thanks -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1448432 - in /tomcat/trunk/java/org/apache/tomcat/websocket: WsRemoteEndpointBase.java WsSession.java WsWebSocketContainer.java server/WsProtocolHandler.java
Author: markt Date: Wed Feb 20 21:51:56 2013 New Revision: 1448432 URL: http://svn.apache.org/r1448432 Log: Make the list of encoders available where they are needed Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java tomcat/trunk/java/org/apache/tomcat/websocket/server/WsProtocolHandler.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java?rev=1448432&r1=1448431&r2=1448432&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java Wed Feb 20 21:51:56 2013 @@ -25,6 +25,8 @@ import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.nio.charset.CoderResult; import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.List; import java.util.Queue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; @@ -34,6 +36,7 @@ import java.util.concurrent.TimeoutExcep import java.util.concurrent.atomic.AtomicBoolean; import javax.websocket.EncodeException; +import javax.websocket.Encoder; import javax.websocket.RemoteEndpoint; import javax.websocket.SendHandler; import javax.websocket.SendResult; @@ -69,6 +72,7 @@ public abstract class WsRemoteEndpointBa private final AtomicBoolean batchingAllowed = new AtomicBoolean(false); private volatile long asyncSendTimeout = -1; private WsSession wsSession; +private List encoderEntries = new ArrayList<>(); @Override @@ -447,6 +451,15 @@ public abstract class WsRemoteEndpointBa } +protected void setEncoders(List encoders) { +encoderEntries.clear(); +for (Encoder encoder : encoders) { +EncoderEntry entry = +new EncoderEntry(Util.getEncoderType(encoder), encoder); +encoderEntries.add(entry); +} +} + protected abstract void doWrite(SendHandler handler, ByteBuffer... data); protected abstract boolean isMasked(); protected abstract void close(); @@ -772,4 +785,24 @@ public abstract class WsRemoteEndpointBa buffer.clear(); } } + + +private static class EncoderEntry { + +private final Class clazz; +private final Encoder encoder; + +public EncoderEntry(Class clazz, Encoder encoder) { +this.clazz = clazz; +this.encoder = encoder; +} + +public Class getClazz() { +return clazz; +} + +public Encoder getEncoder() { +return encoder; +} +} } Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1448432&r1=1448431&r2=1448432&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Wed Feb 20 21:51:56 2013 @@ -31,6 +31,7 @@ import java.util.concurrent.ConcurrentHa import javax.websocket.CloseReason; import javax.websocket.CloseReason.CloseCodes; +import javax.websocket.Encoder; import javax.websocket.Endpoint; import javax.websocket.Extension; import javax.websocket.MessageHandler; @@ -88,7 +89,7 @@ public class WsSession implements Sessio WsWebSocketContainer wsWebSocketContainer, WsRequest request, String subProtocol, Map pathParameters, -boolean secure) { +boolean secure, List encoders) { this.localEndpoint = localEndpoint; this.wsRemoteEndpoint = wsRemoteEndpoint; this.wsRemoteEndpoint.setSession(this); @@ -106,6 +107,7 @@ public class WsSession implements Sessio this.subProtocol = subProtocol; this.pathParameters = pathParameters; this.secure = secure; +this.wsRemoteEndpoint.setEncoders(encoders); } @@ -387,6 +389,7 @@ public class WsSession implements Sessio lastActive = System.currentTimeMillis(); } + protected void expire() { long timeout = sessionIdleTimeout; if (timeout < 1) { Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java?rev=1448432&r1=1448431&r2=1448432&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer
svn commit: r1448455 - in /tomcat/trunk/java/org/apache/tomcat/websocket: LocalStrings.properties WsRemoteEndpointBase.java
Author: markt Date: Wed Feb 20 22:48:46 2013 New Revision: 1448455 URL: http://svn.apache.org/r1448455 Log: First draft (untested) of sendObject implementation Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1448455&r1=1448454&r2=1448455&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties Wed Feb 20 22:48:46 2013 @@ -36,6 +36,7 @@ wsRemoteEndpoint.changeType=When sending wsRemoteEndpoint.concurrentMessageSend=Messages may not be sent concurrently even when using the asynchronous send messages. The client must wait for the previous message to complete before sending the next. wsRemoteEndpoint.flushOnCloseFailed=Flushing batched messages before closing the session failed wsRemoteEndpoint.inProgress=Message will not be sent because the WebSocket session is currently sending another message +wsRemoteEndpoint.noEncoder=No encoder specified for object of class [{0}] # Note the following message is used as a close reason in a WebSocket control # frame and therefore must be 123 bytes (not characters) or less in length. Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java?rev=1448455&r1=1448454&r2=1448455&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java Wed Feb 20 22:48:46 2013 @@ -428,21 +428,50 @@ public abstract class WsRemoteEndpointBa @Override -public void sendObject(Object o) throws IOException, EncodeException { -// TODO Auto-generated method stub - +public void sendObject(Object obj) throws IOException, EncodeException { +Future f = sendObjectByFuture(obj); +try { +f.get(); +} catch (InterruptedException | ExecutionException e) { +throw new IOException(e); +} } @Override public Future sendObjectByFuture(Object obj) { -// TODO Auto-generated method stub -return null; +FutureToSendHandler f2sh = new FutureToSendHandler(); +sendObjectByCompletion(obj, f2sh); +return f2sh; } + +@SuppressWarnings({"unchecked", "rawtypes"}) @Override public void sendObjectByCompletion(Object obj, SendHandler completion) { -// TODO Auto-generated method stub +Encoder encoder = findEncoder(obj); + +try { +if (encoder instanceof Encoder.Text) { +String msg = ((Encoder.Text) encoder).encode(obj); +sendStringByCompletion(msg, completion); +} else if (encoder instanceof Encoder.TextStream) { +Writer w = getSendWriter(); +((Encoder.TextStream) encoder).encode(obj, w); +} else if (encoder instanceof Encoder.Binary) { +ByteBuffer msg = ((Encoder.Binary) encoder).encode(obj); +sendBytesByCompletion(msg, completion); +} else if (encoder instanceof Encoder.BinaryStream) { +OutputStream os = getSendStream(); +((Encoder.BinaryStream) encoder).encode(obj, os); +} else { +throw new EncodeException(obj, sm.getString( +"wsRemoteEndpoint.noEncoder", obj.getClass())); +} +} catch (EncodeException | IOException e) { +SendResult sr = new SendResult(e); +completion.setResult(sr); +} } @@ -460,11 +489,38 @@ public abstract class WsRemoteEndpointBa } } + +private Encoder findEncoder(Object obj) { +for (EncoderEntry entry : encoderEntries) { +if (entry.getClazz().isAssignableFrom(obj.getClass())) { +return entry.getEncoder(); +} +} + +if (obj instanceof Byte || obj instanceof Short || +obj instanceof Integer || obj instanceof Long || +obj instanceof Float || obj instanceof Double || +obj instanceof Character || obj instanceof Boolean) { +return new ToStringEncoder(); +} +return null; +} + + protected abstract void doWrite(SendHandler handler, ByteBuffer... data); protected abstract boolean isMasked(); protected abstract void close(); +private static class ToStringEnc
Re: [ANN] Apache Tomcat Native 1.1.27 released
Henri, On 2/14/13 4:14 AM, Henri Gomez wrote: > I build Tomcat Native on various machine, CentOS 5/6, openSUSE/SLES and > notice this error on CentOS 5.9 : On CentOS 6.2: First, some prerequisites: $ sudo yum install gcc make \ apr apr-devel \ java-1.7.0-openjdk java-1.7.0-openjdk-devel $ wget ... $ tar xzf ... $ cd ... [...] $ ./configure --with-apr=`which apr-1-config` \ --with-java-home=/usr/lib/jvm/java-1.7.0/ [...] $ make [...] $ find . -name "*.so" ./.libs/libtcnative-1.so > /bin/sh /usr/lib/apr-1/build/libtool --silent --mode=compile gcc -pthread > -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector > --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic > -fasynchronous-unwind-tables -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT > -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -DHAVE_OPENSSL > -I/home/cijenka/workspace/cilibtcnative/noarch/centos5-i386-builder/BUILD/tomcat-native-1.1.27-src/jni/native/include > -I/opt/axway/jvm/java-1.6.0-sun-i586/include > -I/opt/axway/jvm/java-1.6.0-sun-i586/include/linux -I/usr/include/apr-1 > -o src/network.lo -c src/network.c && touch src/network.lo Mine looks like this: /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -I/home/tom/tomcat-native-1.1.27-src/jni/native/include -I/usr/lib/jvm/java-1.7.0//include -I/usr/lib/jvm/java-1.7.0//include/linux -I/usr/include/apr-1 -o src/network.lo -c src/network.c && touch src/network.lo Now, there are obviously a few differences between our two environments: I'm building a vanilla x86_64 and it looks like you have an IA32 architecture with some i586 components (maybe just the JVM). Can you post your whole ./configure command? -chris signature.asc Description: OpenPGP digital signature
svn commit: r1448458 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java
Author: markt Date: Wed Feb 20 23:01:23 2013 New Revision: 1448458 URL: http://svn.apache.org/r1448458 Log: Re-reading the spec, this is not required. Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java?rev=1448458&r1=1448457&r2=1448458&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointBase.java Wed Feb 20 23:01:23 2013 @@ -496,13 +496,6 @@ public abstract class WsRemoteEndpointBa return entry.getEncoder(); } } - -if (obj instanceof Byte || obj instanceof Short || -obj instanceof Integer || obj instanceof Long || -obj instanceof Float || obj instanceof Double || -obj instanceof Character || obj instanceof Boolean) { -return new ToStringEncoder(); -} return null; } @@ -512,15 +505,6 @@ public abstract class WsRemoteEndpointBa protected abstract void close(); -private static class ToStringEncoder implements Encoder.Text { - -@Override -public String encode(Object object) throws EncodeException { -return object.toString(); -} -} - - private static void writeHeader(ByteBuffer headerBuffer, byte opCode, ByteBuffer payload, boolean first, boolean last, boolean masked, byte[] mask) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org