Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis@composent.com2010-11-18 01:05:24 +0000
committerslewis@composent.com2010-11-18 01:05:24 +0000
commit46617f8cc54953c2c0dab94b664fee31411a1522 (patch)
treeb9bec1cf1a8901d226cbc115f6b87dc38cf044fb /incubation
parentba3f6b91bbd698a8c5e44265717a2870324bfec3 (diff)
downloadorg.eclipse.ecf-46617f8cc54953c2c0dab94b664fee31411a1522.tar.gz
org.eclipse.ecf-46617f8cc54953c2c0dab94b664fee31411a1522.tar.xz
org.eclipse.ecf-46617f8cc54953c2c0dab94b664fee31411a1522.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/ContainerRemoteServiceAdmin.java53
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportReference.java40
-rw-r--r--incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportRegistration.java60
3 files changed, 153 insertions, 0 deletions
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ContainerRemoteServiceAdmin.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ContainerRemoteServiceAdmin.java
new file mode 100644
index 000000000..9444ee1d2
--- /dev/null
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ContainerRemoteServiceAdmin.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.Map;
+
+import org.eclipse.ecf.remoteservice.IRemoteServiceContainer;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.remoteserviceadmin.EndpointDescription;
+import org.osgi.service.remoteserviceadmin.ExportReference;
+import org.osgi.service.remoteserviceadmin.ExportRegistration;
+import org.osgi.service.remoteserviceadmin.ImportReference;
+import org.osgi.service.remoteserviceadmin.ImportRegistration;
+import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin;
+
+public class ContainerRemoteServiceAdmin implements RemoteServiceAdmin {
+
+ private IRemoteServiceContainer rsContainer;
+
+ public ContainerRemoteServiceAdmin(IRemoteServiceContainer container) {
+ this.rsContainer = null;
+ }
+
+ public Collection<ExportRegistration> exportService(
+ ServiceReference reference, Map<String, Object> properties) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ImportRegistration importService(EndpointDescription endpoint) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Collection<ExportReference> getExportedServices() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Collection<ImportReference> getImportedEndpoints() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportReference.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportReference.java
new file mode 100644
index 000000000..7753bbc2b
--- /dev/null
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportReference.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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.core.runtime.Assert;
+import org.osgi.framework.ServiceReference;
+
+public class ExportReference implements
+ org.osgi.service.remoteserviceadmin.ExportReference {
+
+ private ServiceReference serviceReference;
+ private EndpointDescription endpointDescription;
+
+ protected ExportReference(ServiceReference serviceReference, EndpointDescription endpointDescription) {
+ Assert.isNotNull(serviceReference);
+ this.serviceReference = serviceReference;
+ Assert.isNotNull(endpointDescription);
+ this.endpointDescription = endpointDescription;
+ }
+
+ public synchronized ServiceReference getExportedService() {
+ return serviceReference;
+ }
+
+ public synchronized org.osgi.service.remoteserviceadmin.EndpointDescription getExportedEndpoint() {
+ return endpointDescription;
+ }
+
+ public synchronized void close() {
+ this.serviceReference = null;
+ this.endpointDescription = null;
+ }
+}
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
new file mode 100644
index 000000000..5447b9283
--- /dev/null
+++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/ExportRegistration.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.core.runtime.Assert;
+import org.eclipse.ecf.remoteservice.IRemoteServiceRegistration;
+import org.osgi.framework.ServiceReference;
+
+public class ExportRegistration implements
+ org.osgi.service.remoteserviceadmin.ExportRegistration {
+
+ private IRemoteServiceRegistration rsRegistration;
+ private ExportReference exportReference;
+ private Throwable throwable;
+
+ private final Object closeLock = new Object();
+
+ public ExportRegistration(IRemoteServiceRegistration rsRegistration, ServiceReference serviceReference, EndpointDescription endpointDescription) {
+ Assert.isNotNull(rsRegistration);
+ this.rsRegistration = rsRegistration;
+ this.exportReference = new ExportReference(serviceReference,endpointDescription);
+ }
+
+ public ExportRegistration(Throwable t) {
+ this.throwable = t;
+ }
+
+ public org.osgi.service.remoteserviceadmin.ExportReference getExportReference() {
+ synchronized (closeLock) {
+ Throwable t = getException();
+ if (t != null) throw new IllegalStateException("Cannot get export reference as registration not properly initialized",t);
+ return exportReference;
+ }
+ }
+
+ public void close() {
+ synchronized (closeLock) {
+ if (rsRegistration != null) {
+ rsRegistration.unregister();
+ rsRegistration = null;
+ }
+ exportReference = null;
+ throwable = null;
+ }
+ }
+
+ public Throwable getException() {
+ synchronized (closeLock) {
+ return throwable;
+ }
+ }
+
+}

Back to the top