Author: markt
Date: Thu Mar 7 14:15:05 2013
New Revision: 1453881
URL: http://svn.apache.org/r1453881
Log:
Don't always create a new POJO instance for a Server endpoint.
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpoint.java
Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpoint.java?rev=1453881&r1=1453880&r2=1453881&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpoint.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoEndpoint.java Thu
Mar 7 14:15:05 2013
@@ -44,15 +44,14 @@ public class PojoEndpoint extends Endpoi
@Override
- public void onOpen(Session session,
- EndpointConfig endpointConfiguration) {
+ public void onOpen(Session session, EndpointConfig endpointConfig) {
- ServerEndpointConfig sec =
- (ServerEndpointConfig) endpointConfiguration;
+ ServerEndpointConfig sec = (ServerEndpointConfig) endpointConfig;
try {
- pojo = sec.getEndpointClass().newInstance();
- } catch (InstantiationException | IllegalAccessException e) {
+ pojo = sec.getConfigurator().getEndpointInstance(
+ sec.getEndpointClass());
+ } catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]