Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-02-13 23:42:16 +0000
committerslewis2007-02-13 23:42:16 +0000
commitb1abfcad2933dcae7871b022abb4a1708ddf7a2b (patch)
treeb8bf241d7c3d111b84e9bca776bdeed0643b1867 /framework/bundles/org.eclipse.ecf.discovery/src
parentd5aa4a2a28c6dee1d71d64776758fe015cb83f7b (diff)
downloadorg.eclipse.ecf-b1abfcad2933dcae7871b022abb4a1708ddf7a2b.tar.gz
org.eclipse.ecf-b1abfcad2933dcae7871b022abb4a1708ddf7a2b.tar.xz
org.eclipse.ecf-b1abfcad2933dcae7871b022abb4a1708ddf7a2b.zip
String externalization
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.discovery/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java10
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java9
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/Messages.java36
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/messages.properties1
6 files changed, 50 insertions, 12 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java
index 3fab97ae9..789c96b2d 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java
@@ -46,8 +46,8 @@ public class ServiceContainerEvent implements IServiceEvent {
* @see java.lang.Object#toString()
*/
public String toString() {
- StringBuffer buf = new StringBuffer("ServiceContainerEvent[");
- buf.append("serviceinfo=").append(info).append("]");
+ StringBuffer buf = new StringBuffer("ServiceContainerEvent["); //$NON-NLS-1$
+ buf.append("serviceinfo=").append(info).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
return buf.toString();
}
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
index 280b418ca..40d5fa691 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
@@ -110,11 +110,11 @@ public class ServiceInfo implements IServiceInfo, Serializable {
* @see java.lang.Object#toString()
*/
public String toString() {
- StringBuffer buf = new StringBuffer("ServiceInfo[");
- buf.append("addr=").append(addr).append(";id=").append(serviceID)
- .append(";port=").append(port).append(";priority=").append(
- priority).append(";weight=").append(weight).append(
- ";props=").append(properties).append("]");
+ StringBuffer buf = new StringBuffer("ServiceInfo["); //$NON-NLS-1$
+ buf.append("addr=").append(addr).append(";id=").append(serviceID) //$NON-NLS-1$ //$NON-NLS-2$
+ .append(";port=").append(port).append(";priority=").append( //$NON-NLS-1$ //$NON-NLS-2$
+ priority).append(";weight=").append(weight).append( //$NON-NLS-1$
+ ";props=").append(properties).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
return buf.toString();
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java
index 777ef1298..bc8593912 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/identity/ServiceID.java
@@ -10,6 +10,7 @@ package org.eclipse.ecf.discovery.identity;
import org.eclipse.ecf.core.identity.BaseID;
import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.internal.discovery.Messages;
/**
* Service identity type. ServiceIDs are IDs that uniquely identify
@@ -26,7 +27,7 @@ public class ServiceID extends BaseID {
protected ServiceID(Namespace namespace, String type, String name) {
super(namespace);
if (type == null)
- throw new NullPointerException("ServiceID type cannot be null");
+ throw new NullPointerException(Messages.getString("ServiceID.ServiceID_Not_Null")); //$NON-NLS-1$
this.type = type;
this.name = name;
}
@@ -106,9 +107,9 @@ public class ServiceID extends BaseID {
* @see java.lang.Object#toString()
*/
public String toString() {
- StringBuffer buf = new StringBuffer("ServiceID[");
- buf.append("type=").append(type).append(";name=").append(name).append(
- ";full=" + getFullyQualifiedName()).append("]");
+ StringBuffer buf = new StringBuffer("ServiceID["); //$NON-NLS-1$
+ buf.append("type=").append(type).append(";name=").append(name).append( //$NON-NLS-1$ //$NON-NLS-2$
+ ";full=" + getFullyQualifiedName()).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
return buf.toString();
}
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
index e7876b045..35ef8dd68 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
@@ -77,7 +77,7 @@ public class DiscoveryPlugin extends Plugin {
try {
if (resourceBundle == null)
resourceBundle = ResourceBundle
- .getBundle("org.eclipse.ecf.discovery.DiscoveryPluginResources");
+ .getBundle("org.eclipse.ecf.discovery.DiscoveryPluginResources"); //$NON-NLS-1$
} catch (MissingResourceException x) {
resourceBundle = null;
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/Messages.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/Messages.java
new file mode 100644
index 000000000..95970e7fd
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/Messages.java
@@ -0,0 +1,36 @@
+/****************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Composent, Inc. - initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.ecf.internal.discovery;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ *
+ */
+public class Messages {
+ private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.discovery.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/messages.properties b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/messages.properties
new file mode 100644
index 000000000..24fe465ac
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/messages.properties
@@ -0,0 +1 @@
+ServiceID.ServiceID_Not_Null=ServiceID type cannot be null

Back to the top