Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2009-12-11 18:15:03 +0000
committerslewis2009-12-11 18:15:03 +0000
commitd9c06341820f4f88e986a7d6cb54eb73aaa7f2ef (patch)
treea3085f437125d8b578411c2d94dd42cdde1adf1d
parent860dd89339a6c367dbd829e4db2623eace33e748 (diff)
downloadorg.eclipse.ecf-d9c06341820f4f88e986a7d6cb54eb73aaa7f2ef.tar.gz
org.eclipse.ecf-d9c06341820f4f88e986a7d6cb54eb73aaa7f2ef.tar.xz
org.eclipse.ecf-d9c06341820f4f88e986a7d6cb54eb73aaa7f2ef.zip
Additions and changes for addressing bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=290446
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java19
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseContainerInstantiator.java6
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseRemoteServiceContainerInstantiator.java29
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IContainerInstantiator.java12
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IRemoteServiceContainerInstantiator.java36
5 files changed, 84 insertions, 18 deletions
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java
index cd2b09f67..cdec6ffdb 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java
@@ -12,6 +12,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.*;
import org.eclipse.ecf.core.provider.IContainerInstantiator;
+import org.eclipse.ecf.core.provider.IRemoteServiceContainerInstantiator;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.core.ECFDebugOptions;
import org.eclipse.ecf.internal.core.ECFPlugin;
@@ -219,9 +220,8 @@ public class ContainerTypeDescription {
Trace.entering(ECFPlugin.PLUGIN_ID, ECFDebugOptions.METHODS_ENTERING, this.getClass(), method);
String[] result = new String[0];
try {
- String[] r = getInstantiator().getSupportedIntents(this);
- if (r != null)
- result = r;
+ IContainerInstantiator ci = getInstantiator();
+ return (ci instanceof IRemoteServiceContainerInstantiator) ? ((IRemoteServiceContainerInstantiator) ci).getSupportedIntents(this) : result;
} catch (Exception e) {
traceAndLogException(IStatus.ERROR, method, e);
}
@@ -229,4 +229,17 @@ public class ContainerTypeDescription {
return result;
}
+ public String[] getSupportedConfigTypes() {
+ String method = "getSupportedConfigTypes"; //$NON-NLS-1$
+ Trace.entering(ECFPlugin.PLUGIN_ID, ECFDebugOptions.METHODS_ENTERING, this.getClass(), method);
+ String[] result = new String[0];
+ try {
+ IContainerInstantiator ci = getInstantiator();
+ return (ci instanceof IRemoteServiceContainerInstantiator) ? ((IRemoteServiceContainerInstantiator) ci).getSupportedConfigTypes(this) : result;
+ } catch (Exception e) {
+ traceAndLogException(IStatus.ERROR, method, e);
+ }
+ Trace.exiting(ECFPlugin.PLUGIN_ID, ECFDebugOptions.METHODS_EXITING, this.getClass(), method, result);
+ return result;
+ }
} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseContainerInstantiator.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseContainerInstantiator.java
index 41c7a4869..cb27c8d89 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseContainerInstantiator.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseContainerInstantiator.java
@@ -18,7 +18,8 @@ import org.eclipse.ecf.internal.core.ECFPlugin;
import org.eclipse.ecf.internal.core.Messages;
/**
- *
+ * Default implemenation of {@link IContainerInstantiator}. ECF provider implementers
+ * may subclass as desired.
*/
public class BaseContainerInstantiator implements IContainerInstantiator {
@@ -78,7 +79,4 @@ public class BaseContainerInstantiator implements IContainerInstantiator {
return EMPTY_CLASS_ARRAY;
}
- public String[] getSupportedIntents(ContainerTypeDescription description) {
- return EMPTY_STRING_ARRAY;
- }
}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseRemoteServiceContainerInstantiator.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseRemoteServiceContainerInstantiator.java
new file mode 100644
index 000000000..2992e7da9
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseRemoteServiceContainerInstantiator.java
@@ -0,0 +1,29 @@
+/****************************************************************************
+ * 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.core.provider;
+
+import org.eclipse.ecf.core.ContainerTypeDescription;
+
+/**
+ * Default implemenation of {@link IRemoteServiceContainerInstantiator}. ECF provider implementers
+ * may subclass as desired.
+ */
+public class BaseRemoteServiceContainerInstantiator extends BaseContainerInstantiator implements IRemoteServiceContainerInstantiator {
+
+ public String[] getSupportedIntents(ContainerTypeDescription description) {
+ return EMPTY_STRING_ARRAY;
+ }
+
+ public String[] getSupportedConfigTypes(ContainerTypeDescription description) {
+ return new String[] {description.getName()};
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IContainerInstantiator.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IContainerInstantiator.java
index 9987b409e..eb4bf353c 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IContainerInstantiator.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IContainerInstantiator.java
@@ -11,8 +11,7 @@ package org.eclipse.ecf.core.provider;
import org.eclipse.ecf.core.*;
/**
- * Interface that must be implemented by extensions of the containerFactory
- * extension point
+ * Interface that must be implemented by ECF provider implementations.
*
*/
public interface IContainerInstantiator {
@@ -120,13 +119,4 @@ public interface IContainerInstantiator {
*/
public Class[][] getSupportedParameterTypes(ContainerTypeDescription description);
- /**
- * Get supported intents for the container instantiated by this instantiator.
- *
- * @param description the ContainerTypeDescription to return the intents for
- * @return String[] supported intents. <code>null</code> may be returned by
- * the provider if no intents are supported for this description.
- */
- public String[] getSupportedIntents(ContainerTypeDescription description);
-
} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IRemoteServiceContainerInstantiator.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IRemoteServiceContainerInstantiator.java
new file mode 100644
index 000000000..16853fc8a
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IRemoteServiceContainerInstantiator.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+* Copyright (c) 2009 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.core.provider;
+
+import org.eclipse.ecf.core.ContainerTypeDescription;
+
+/**
+ * Interface that must be implemented by ECF remote service provider implementations.
+ *
+ */
+public interface IRemoteServiceContainerInstantiator {
+
+ /**
+ * Get supported configs for the container type handled by this intantiator.
+ * @param description the ContainerTypeDescription to return the supported configs for
+ * @return String[] the supported config types.
+ */
+ public String[] getSupportedConfigTypes(ContainerTypeDescription description);
+
+ /**
+ * Get supported intents for the container instantiated by this instantiator.
+ *
+ * @param description the ContainerTypeDescription to return the intents for
+ * @return String[] supported intents. <code>null</code> may be returned by
+ * the provider if no intents are supported for this description.
+ */
+ public String[] getSupportedIntents(ContainerTypeDescription description);
+
+}

Back to the top