Author: markt
Date: Tue Nov 27 13:28:36 2012
New Revision: 1414179
URL: http://svn.apache.org/viewvc?rev=1414179&view=rev
Log:
Use StringManager to provide i18n support
Added:
tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java (with props)
tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
(with props)
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java
Added: tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java?rev=1414179&view=auto
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java (added)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java Tue Nov 27
13:28:36 2012
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tomcat.websocket;
+
+public class Constants {
+
+ public static final String PACKAGE_NAME = "org.apache.tomcat.websocket";
+
+ private Constants() {
+ // Hide default constructor
+ }
+}
Propchange: tomcat/trunk/java/org/apache/tomcat/websocket/Constants.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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=1414179&view=auto
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
(added)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties Tue
Nov 27 13:28:36 2012
@@ -0,0 +1,15 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+sci.newInstance.fail=Failed to create an Endpoint instance of type [{0}]
\ No newline at end of file
Propchange:
tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java?rev=1414179&r1=1414178&r2=1414179&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java Tue
Nov 27 13:28:36 2012
@@ -24,6 +24,8 @@ import javax.websocket.Endpoint;
import javax.websocket.ServerContainer;
import javax.websocket.ServerEndpointConfiguration;
+import org.apache.tomcat.util.res.StringManager;
+
/**
* Provides a per class loader (i.e. per web application) instance of a
* {@link ServerContainer}.
@@ -37,6 +39,9 @@ public class ServerContainerImpl extends
classLoaderContainerMap = new WeakHashMap<>();
private static Object classLoaderContainerMapLock = new Object();
+ private static StringManager sm = StringManager.getManager(
+ Constants.PACKAGE_NAME);
+
/**
* Intended to be used by implementations of {@link
@@ -78,9 +83,8 @@ public class ServerContainerImpl extends
System.out.println("Class [" + clazz.getName() +
"] deployed to path [" + path + "]");
} catch (InstantiationException | IllegalAccessException e) {
- // TODO i18n
throw new DeploymentException(
- "Failed to instantiate specified Endpoint", e);
+ sm.getString("sci.newInstance.fail", clazz.getName()), e);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]