Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis@composent.com2010-11-25 15:46:18 +0000
committerslewis@composent.com2010-11-25 15:46:18 +0000
commit2ef378097670473c6342241f31c56d18313fdef8 (patch)
tree1ce7e123ba73ca81dd70595ba23061d5d24f7ccb /incubation
parent57cc00f4f3cf233e52a551ccccf5a19704366c8b (diff)
downloadorg.eclipse.ecf-2ef378097670473c6342241f31c56d18313fdef8.tar.gz
org.eclipse.ecf-2ef378097670473c6342241f31c56d18313fdef8.tar.xz
org.eclipse.ecf-2ef378097670473c6342241f31c56d18313fdef8.zip
rsa additions
Diffstat (limited to 'incubation')
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractContainerSelector.java9
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractHostContainerSelector.java351
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java9
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportRegistration.java2
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/HostContainerSelector.java63
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java9
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteConstants.java12
7 files changed, 441 insertions, 14 deletions
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractContainerSelector.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractContainerSelector.java
index 6022474e1..8ee16e0fd 100644
--- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractContainerSelector.java
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractContainerSelector.java
@@ -50,8 +50,8 @@ public abstract class AbstractContainerSelector {
}
protected ContainerTypeDescription[] getContainerTypeDescriptions() {
- return (ContainerTypeDescription[]) getContainerFactory().getDescriptions()
- .toArray(new ContainerTypeDescription[] {});
+ return (ContainerTypeDescription[]) getContainerFactory()
+ .getDescriptions().toArray(new ContainerTypeDescription[] {});
}
protected IContainer[] getContainers() {
@@ -66,7 +66,8 @@ public abstract class AbstractContainerSelector {
protected ContainerTypeDescription getContainerTypeDescription(
IContainer container) {
- return getContainerManager().getContainerTypeDescription(container.getID());
+ return getContainerManager().getContainerTypeDescription(
+ container.getID());
}
protected IRemoteServiceContainer[] getRemoteServiceContainers(
@@ -120,7 +121,7 @@ public abstract class AbstractContainerSelector {
IContainerFactory containerFactory = getContainerFactory();
Object containerFactoryArguments = serviceReference
- .getProperty(RemoteConstants.SERVICE_EXPORTED_CONTAINER_FACTORY_ARGUMENTS);
+ .getProperty(RemoteConstants.EXPORTED_CONTAINER_FACTORY_ARGS);
if (containerFactoryArguments instanceof String) {
return containerFactory.createContainer(containerTypeDescription,
(String) containerFactoryArguments);
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractHostContainerSelector.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractHostContainerSelector.java
new file mode 100644
index 000000000..62699738c
--- /dev/null
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractHostContainerSelector.java
@@ -0,0 +1,351 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.osgi.services.remoteserviceadmin;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.ecf.core.ContainerConnectException;
+import org.eclipse.ecf.core.ContainerCreateException;
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.IContainer;
+import org.eclipse.ecf.core.identity.ID;
+import org.eclipse.ecf.core.identity.IDCreateException;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.security.IConnectContext;
+import org.eclipse.ecf.remoteservice.IRemoteServiceContainer;
+import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter;
+import org.eclipse.ecf.remoteservice.RemoteServiceContainer;
+import org.osgi.framework.ServiceReference;
+
+public abstract class AbstractHostContainerSelector extends
+ AbstractContainerSelector {
+
+ private static final String NODEFAULT = "<<nodefault>>"; //$NON-NLS-1$
+ protected String[] defaultConfigTypes;
+
+ public AbstractHostContainerSelector(String[] defaultConfigTypes) {
+ this.defaultConfigTypes = defaultConfigTypes;
+ }
+
+ protected Collection findExistingHostContainers(
+ ServiceReference serviceReference,
+ String[] serviceExportedInterfaces,
+ String[] serviceExportedConfigs, String[] serviceIntents) {
+ List results = new ArrayList();
+ // Get all existing containers
+ IContainer[] containers = getContainers();
+ // If nothing there, then return empty array
+ if (containers == null || containers.length == 0)
+ return results;
+
+ for (int i = 0; i < containers.length; i++) {
+ // Check to make sure it's a rs container adapter. If it's not go
+ // onto next one
+ IRemoteServiceContainerAdapter adapter = hasRemoteServiceContainerAdapter(containers[i]);
+ if (adapter == null)
+ continue;
+ // Get container type description and intents
+ ContainerTypeDescription description = getContainerTypeDescription(containers[i]);
+ // If it has no description go onto next
+ if (description == null)
+ continue;
+
+ if (matchExistingHostContainer(serviceReference, containers[i],
+ adapter, description, serviceExportedConfigs,
+ serviceIntents)) {
+ trace("findExistingContainers", "INCLUDING containerID=" //$NON-NLS-1$ //$NON-NLS-2$
+ + containers[i].getID()
+ + "configs=" //$NON-NLS-1$
+ + ((serviceExportedConfigs == null) ? "null" : Arrays //$NON-NLS-1$
+ .asList(serviceExportedConfigs).toString())
+ + "intents=" //$NON-NLS-1$
+ + ((serviceIntents == null) ? "null" : Arrays.asList( //$NON-NLS-1$
+ serviceIntents).toString()));
+ results.add(new RemoteServiceContainer(containers[i], adapter));
+ } else {
+ trace("findExistingContainers", "EXCLUDING containerID=" //$NON-NLS-1$ //$NON-NLS-2$
+ + containers[i].getID()
+ + "configs=" //$NON-NLS-1$
+ + ((serviceExportedConfigs == null) ? "null" : Arrays //$NON-NLS-1$
+ .asList(serviceExportedConfigs).toString())
+ + "intents=" //$NON-NLS-1$
+ + ((serviceIntents == null) ? "null" : Arrays.asList( //$NON-NLS-1$
+ serviceIntents).toString()));
+ }
+ }
+ return results;
+ }
+
+ protected boolean matchHostContainerToConnectTarget(
+ ServiceReference serviceReference, IContainer container) {
+ Object target = serviceReference
+ .getProperty(RemoteConstants.EXPORTED_CONTAINER_CONNECT_TARGET);
+ if (target == null)
+ return true;
+ // If a targetID is specified, make sure it either matches what the
+ // container
+ // is already connected to, or that we connect an unconnected container
+ ID connectedID = container.getConnectedID();
+ // If the container is not already connected to anything
+ // then we connect it to the given target
+ if (connectedID == null) {
+ // connect to the target and we have a match
+ try {
+ connectHostContainer(serviceReference, container, target);
+ } catch (Exception e) {
+ logException("doConnectContainer containerID=" //$NON-NLS-1$
+ + container.getID() + " target=" + target, e); //$NON-NLS-1$
+ return false;
+ }
+ return true;
+ } else {
+ ID targetID = createTargetID(container, target);
+ // We check here if the currently connectedID equals the target.
+ // If it does we have a match
+ if (connectedID.equals(targetID))
+ return true;
+ }
+ return false;
+ }
+
+ protected boolean matchExistingHostContainer(
+ ServiceReference serviceReference, IContainer container,
+ IRemoteServiceContainerAdapter adapter,
+ ContainerTypeDescription description, String[] requiredConfigTypes,
+ String[] requiredServiceIntents) {
+
+ return matchHostSupportedConfigTypes(requiredConfigTypes, description)
+ && matchHostSupportedIntents(requiredServiceIntents,
+ description)
+ && matchHostContainerID(serviceReference, container)
+ && matchHostContainerToConnectTarget(serviceReference,
+ container);
+ }
+
+ protected boolean matchHostContainerID(ServiceReference serviceReference,
+ IContainer container) {
+
+ ID containerID = container.getID();
+ // No match if the container has no ID
+ if (containerID == null)
+ return false;
+
+ // Then get containerid if specified directly by user in properties
+ ID requiredContainerID = (ID) serviceReference
+ .getProperty(RemoteConstants.EXPORTED_CONTAINER_ID);
+ // If the CONTAINER_I
+ if (requiredContainerID != null) {
+ return requiredContainerID.equals(containerID);
+ }
+ // Else get the container factory arguments, create an ID from the
+ // arguments
+ // and check if the ID matches that
+ Namespace ns = containerID.getNamespace();
+ Object cid = serviceReference
+ .getProperty(RemoteConstants.EXPORTED_CONTAINER_FACTORY_ARGS);
+ // If no arguments are present, then any container ID should match
+ if (cid == null)
+ return true;
+ ID cID = null;
+ if (cid instanceof ID) {
+ cID = (ID) cid;
+ } else if (cid instanceof String) {
+ cID = getIDFactory().createID(ns, (String) cid);
+ } else if (cid instanceof Object[]) {
+ Object cido = ((Object[]) cid)[0];
+ cID = getIDFactory().createID(ns, new Object[] { cido });
+ }
+ if (cID == null)
+ return true;
+ return containerID.equals(cID);
+ }
+
+ protected boolean matchHostSupportedConfigTypes(
+ String[] requiredConfigTypes,
+ ContainerTypeDescription containerTypeDescription) {
+ // if no config type is set the spec requires to create a default
+ // endpoint (see section 122.5.1)
+ if (requiredConfigTypes == null)
+ return true;
+ // Get supported config types for this description
+ String[] supportedConfigTypes = getSupportedConfigTypes(containerTypeDescription);
+ // If it doesn't support anything, return false
+ if (supportedConfigTypes == null || supportedConfigTypes.length == 0)
+ return false;
+ // Turn supported config types for this description into list
+ List supportedConfigTypesList = Arrays.asList(supportedConfigTypes);
+ List requiredConfigTypesList = Arrays.asList(requiredConfigTypes);
+ // We check all of the required config types and make sure
+ // that they are present in the supportedConfigTypes
+ boolean result = true;
+ for (Iterator i = requiredConfigTypesList.iterator(); i.hasNext();)
+ result &= supportedConfigTypesList.contains(i.next());
+ return result;
+ }
+
+ protected Collection createAndConfigureHostContainers(
+ ServiceReference serviceReference,
+ String[] serviceExportedInterfaces, String[] requiredConfigs,
+ String[] requiredIntents) {
+
+ List results = new ArrayList();
+ ContainerTypeDescription[] descriptions = getContainerTypeDescriptions();
+ if (descriptions == null)
+ return results;
+ // If there are no required configs specified, then create any defaults
+ if (requiredConfigs == null || requiredConfigs.length == 0)
+ createDefaultRSContainers(serviceReference, descriptions, results);
+ else {
+ // See if we have a match
+ for (int i = 0; i < descriptions.length; i++) {
+ IRemoteServiceContainer rsContainer = createMatchingContainer(
+ descriptions[i], serviceReference,
+ serviceExportedInterfaces, requiredConfigs,
+ requiredIntents);
+ if (rsContainer != null)
+ results.add(rsContainer);
+ }
+ }
+ // we still haven't created one then we check for no default and if
+ // not present then we
+ // create default ones
+ if (results.size() == 0 && requiredConfigs != null
+ && requiredConfigs.length > 0) {
+ List requiredConfigsList = Arrays.asList(requiredConfigs);
+ if (!requiredConfigsList.contains(NODEFAULT))
+ createDefaultRSContainers(serviceReference, descriptions,
+ results);
+ }
+ return results;
+ }
+
+ private void createDefaultRSContainers(ServiceReference serviceReference,
+ ContainerTypeDescription[] descriptions, List results) {
+ ContainerTypeDescription[] ctds = getContainerTypeDescriptionsForDefaultConfigTypes(descriptions);
+ if (ctds != null) {
+ for (int i = 0; i < ctds.length; i++) {
+ IRemoteServiceContainer rsContainer = createRSContainer(
+ serviceReference, ctds[i]);
+ if (rsContainer != null)
+ results.add(rsContainer);
+ }
+ }
+ }
+
+ protected ContainerTypeDescription[] getContainerTypeDescriptionsForDefaultConfigTypes(
+ ContainerTypeDescription[] descriptions) {
+ String[] defaultConfigTypes = getDefaultConfigTypes();
+ if (defaultConfigTypes == null || defaultConfigTypes.length == 0)
+ return null;
+ List results = new ArrayList();
+ for (int i = 0; i < descriptions.length; i++) {
+ // For each description, get supported config types
+ String[] supportedConfigTypes = descriptions[i]
+ .getSupportedConfigs();
+ if (supportedConfigTypes != null
+ && matchDefaultConfigTypes(defaultConfigTypes,
+ supportedConfigTypes))
+ results.add(descriptions[i]);
+ }
+ return (ContainerTypeDescription[]) results
+ .toArray(new ContainerTypeDescription[] {});
+ }
+
+ protected boolean matchDefaultConfigTypes(String[] defaultConfigTypes,
+ String[] supportedConfigTypes) {
+ List supportedConfigTypesList = Arrays.asList(supportedConfigTypes);
+ for (int i = 0; i < defaultConfigTypes.length; i++) {
+ if (supportedConfigTypesList.contains(defaultConfigTypes[i]))
+ return true;
+ }
+ return false;
+ }
+
+ protected String[] getDefaultConfigTypes() {
+ return defaultConfigTypes;
+ }
+
+ protected IRemoteServiceContainer createMatchingContainer(
+ ContainerTypeDescription containerTypeDescription,
+ ServiceReference serviceReference,
+ String[] serviceExportedInterfaces, String[] requiredConfigs,
+ String[] requiredIntents) {
+
+ if (matchHostSupportedConfigTypes(requiredConfigs,
+ containerTypeDescription)
+ && matchHostSupportedIntents(requiredIntents,
+ containerTypeDescription)) {
+ return createRSContainer(serviceReference, containerTypeDescription);
+ }
+ return null;
+ }
+
+ protected IRemoteServiceContainer createRSContainer(
+ ServiceReference serviceReference,
+ ContainerTypeDescription containerTypeDescription) {
+ try {
+ IContainer container = createContainer(serviceReference,
+ containerTypeDescription);
+ IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) container
+ .getAdapter(IRemoteServiceContainerAdapter.class);
+ if (adapter == null)
+ throw new ContainerCreateException(
+ "Container does not implement IRemoteServiceContainerAdapter"); //$NON-NLS-1$
+ return new RemoteServiceContainer(container, adapter);
+ } catch (Exception e) {
+ logException(
+ "Exception creating container from ContainerTypeDescription=" //$NON-NLS-1$
+ + containerTypeDescription, e);
+ return null;
+ }
+ }
+
+ protected void connectHostContainer(ServiceReference serviceReference,
+ IContainer container, Object target)
+ throws ContainerConnectException, IDCreateException {
+ ID targetID = createTargetID(container, target);
+ Object context = serviceReference
+ .getProperty(RemoteConstants.EXPORTED_CONTAINER_CONNECT_CONTEXT);
+ IConnectContext connectContext = null;
+ if (context != null) {
+ connectContext = createConnectContext(serviceReference, container,
+ context);
+ }
+ // connect the container
+ container.connect(targetID, connectContext);
+ }
+
+ protected boolean matchHostSupportedIntents(
+ String[] serviceRequiredIntents,
+ ContainerTypeDescription containerTypeDescription) {
+ // If there are no required intents then we have a match
+ if (serviceRequiredIntents == null)
+ return true;
+
+ String[] supportedIntents = getSupportedIntents(containerTypeDescription);
+
+ if (supportedIntents == null)
+ return false;
+
+ List supportedIntentsList = Arrays.asList(supportedIntents);
+
+ boolean result = true;
+ for (int i = 0; i < serviceRequiredIntents.length; i++)
+ result = result
+ && supportedIntentsList.contains(serviceRequiredIntents[i]);
+
+ return result;
+ }
+
+}
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java
index fdccf71e7..7a3cb7a83 100644
--- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractRemoteServiceAdmin.java
@@ -70,18 +70,17 @@ public abstract class AbstractRemoteServiceAdmin {
IRemoteServiceContainer container) {
ID endpointID = registration.getContainerID();
ID connectTargetID = (ID) getPropertyValue(
- RemoteConstants.ENDPOINT_CONNECTTARGET_ID, serviceReference,
- properties);
+ RemoteConstants.EXPORTED_CONTAINER_CONNECT_TARGET,
+ serviceReference, properties);
if (connectTargetID == null) {
ID connectedID = container.getContainer().getConnectedID();
if (connectedID != null && !connectedID.equals(endpointID))
connectTargetID = connectedID;
}
ID[] idFilter = (ID[]) getPropertyValue(
- RemoteConstants.ENDPOINT_IDFILTER_IDS, serviceReference,
- properties);
+ RemoteConstants.EXPORTED_IDFILTER, serviceReference, properties);
String rsFilter = (String) getPropertyValue(
- RemoteConstants.ENDPOINT_REMOTESERVICE_FILTER,
+ RemoteConstants.EXPORTED_REMOTESERVICE_FILTER,
serviceReference, properties);
IRemoteServiceID rsID = registration.getID();
return new EndpointDescription(serviceReference, properties,
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportRegistration.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportRegistration.java
index 606f528f9..4f8b03c2e 100644
--- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportRegistration.java
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportRegistration.java
@@ -18,7 +18,7 @@ public class ExportRegistration implements
private IRemoteServiceRegistration rsRegistration;
private ExportReference exportReference;
-
+
private Throwable throwable;
private final Object closeLock = new Object();
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/HostContainerSelector.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/HostContainerSelector.java
index 37d9842ad..05684a4b7 100644
--- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/HostContainerSelector.java
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/HostContainerSelector.java
@@ -1,16 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.osgi.services.remoteserviceadmin;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.ecf.core.IContainer;
import org.eclipse.ecf.remoteservice.IRemoteServiceContainer;
import org.osgi.framework.ServiceReference;
-public class HostContainerSelector implements IHostContainerSelector {
+public class HostContainerSelector extends AbstractHostContainerSelector
+ implements IHostContainerSelector {
+
+ private boolean autoCreateContainer = false;
+
+ public HostContainerSelector(String[] defaultConfigTypes,
+ boolean autoCreateContainer) {
+ super(defaultConfigTypes);
+ this.autoCreateContainer = autoCreateContainer;
+ }
public IRemoteServiceContainer[] selectHostContainers(
ServiceReference serviceReference,
String[] serviceExportedInterfaces,
String[] serviceExportedConfigs, String[] serviceIntents) {
- // TODO Auto-generated method stub
- return null;
+ // Find previously created containers that match the given
+ // serviceExportedConfigs and serviceIntents
+ Collection rsContainers = findExistingHostContainers(serviceReference,
+ serviceExportedInterfaces, serviceExportedConfigs,
+ serviceIntents);
+
+ if (rsContainers.size() == 0 && autoCreateContainer) {
+ // If no existing containers are found we'll go through
+ // finding/creating/configuring/connecting
+ rsContainers = createAndConfigureHostContainers(serviceReference,
+ serviceExportedInterfaces, serviceExportedConfigs,
+ serviceIntents);
+
+ // if SERVICE_EXPORTED_CONTAINER_CONNECT_TARGET service property is
+ // specified, then
+ // connect the host container(s)
+ Object target = serviceReference
+ .getProperty(RemoteConstants.EXPORTED_CONTAINER_CONNECT_TARGET);
+ if (target != null) {
+ for (Iterator i = rsContainers.iterator(); i.hasNext();) {
+ IContainer container = ((IRemoteServiceContainer) i.next())
+ .getContainer();
+ try {
+ connectHostContainer(serviceReference, container,
+ target);
+ } catch (Exception e) {
+ logException("doConnectContainer failure containerID=" //$NON-NLS-1$
+ + container.getID() + " target=" + target, e); //$NON-NLS-1$
+ }
+ }
+
+ }
+ }
+
+ // return result
+ return (IRemoteServiceContainer[]) rsContainers
+ .toArray(new IRemoteServiceContainer[] {});
}
}
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java
index 57584ea89..99d650616 100644
--- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ImportRegistration.java
@@ -1,3 +1,12 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.osgi.services.remoteserviceadmin;
import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter;
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteConstants.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteConstants.java
index b2ec1065e..4c400936d 100644
--- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteConstants.java
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteConstants.java
@@ -44,6 +44,16 @@ public class RemoteConstants {
public static final String RSA_EXPORTED_INTERFACES = "ecf.rsa.exportedInterfaces";
- public static final String SERVICE_EXPORTED_CONTAINER_FACTORY_ARGUMENTS = "ecf.service.exported.containerfactoryargs";
+ public static final String EXPORTED_CONTAINER_FACTORY_ARGS = "ecf.exported.containerfactoryargs";
+
+ public static final String EXPORTED_CONTAINER_CONNECT_CONTEXT = "ecf.exported.containerconnectcontext";
+
+ public static final String EXPORTED_CONTAINER_ID = "ecf.exported.containerid";
+
+ public static final String EXPORTED_CONTAINER_CONNECT_TARGET = "ecf.exported.connecttarget";
+
+ public static final String EXPORTED_IDFILTER = "ecf.exported.idfilter";
+
+ public static final String EXPORTED_REMOTESERVICE_FILTER = "ecf.exported.remoteservicefilter";
}

Back to the top