From 132aa8a77685ec92bc90c03f987650d275a7b639 Mon Sep 17 00:00:00 2001 From: lresende Date: Mon, 30 Sep 2013 06:59:11 +0000 Subject: 2.0.1 RC1 release tag git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1527464 13f79535-47bb-0310-9956-ffa450edef68 --- .../remoteserviceadmin/RemoteServiceAdmin.java | 124 +++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sca-java-2.x/tags/2.0.1-RC1/modules/node-impl-osgi/src/main/java/org/osgi/service/remoteserviceadmin/RemoteServiceAdmin.java (limited to 'sca-java-2.x/tags/2.0.1-RC1/modules/node-impl-osgi/src/main/java/org/osgi/service/remoteserviceadmin/RemoteServiceAdmin.java') diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/node-impl-osgi/src/main/java/org/osgi/service/remoteserviceadmin/RemoteServiceAdmin.java b/sca-java-2.x/tags/2.0.1-RC1/modules/node-impl-osgi/src/main/java/org/osgi/service/remoteserviceadmin/RemoteServiceAdmin.java new file mode 100644 index 0000000000..98f56a07ae --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/modules/node-impl-osgi/src/main/java/org/osgi/service/remoteserviceadmin/RemoteServiceAdmin.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) OSGi Alliance (2009). All Rights Reserved. + * + * Licensed 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.osgi.service.remoteserviceadmin; + +import java.util.Collection; +import java.util.Map; + +import org.osgi.framework.ServiceReference; + +/** + * A Remote Service Admin manages the import and export of services. + * + * A Distribution Provider can expose a control interface. This interface allows + * the a remote manager to control the export and import of services. + * + * The API allows a remote manager to export a service, to import a service, and + * find out about the current imports and exports. + * + * @ThreadSafe + * @version $Revision$ + */ +public interface RemoteServiceAdmin { + + /** + * Export a service to a given Endpoint. The Remote Service Admin must + * create an Endpoint from the given description that can be used by other + * Distrbution Providers to connect to this Remote Service Admin and use the + * exported service. This method can return null if the service could not be + * exported because the Endpoint could not be implemented by this Remote + * Service Admin. + * + * The properties on a Service Reference are case insensitive while the + * properties on a properties are case sensitive. A value in + * the properties must therefore override any case variant in + * the properties of the Service Reference. + * + *

+ * If the caller does not have the appropriate + * EndpointPermission[endpoint,EXPORT] for an Endpoint, and the + * Java Runtime Environment supports permissions, then the + * {@link ExportRegistration#getException() getException} method on the + * corresponding returned {@link ExportRegistration} will return a + * SecurityException. + * + * @param reference The Service Reference to export. + * @param properties The properties to create a local Endpoint that can be + * implemented by this Remote Service Admin. If this is null, the + * Endpoint will be determined by the properties on the service. The + * properties are the same as given for an exported service. They are + * overlaid over any properties the service defines (case + * insensitive). This parameter can be null, this should + * be treated as an empty map. + * + * @return An Export Registration that combines the Endpoint Description and + * the Service Reference. Is never null. + * @throws IllegalArgumentException If any of the properties has a value + * that is not syntactically correct or if the service properties + * and the overlaid properties do not contain a + * {@link RemoteConstants#SERVICE_EXPORTED_INTERFACES} entry. + * @throws UnsupportedOperationException If any of the intents expressed + * through the properties is not supported by the distribution + * provider. + */ + Collection exportService(ServiceReference reference, + Map properties); + + /** + * Import a service from an Endpoint. The Remote Service Admin must use the + * given Endpoint to create a proxy. This method can return null if the + * service could not be imported. + * + * @param endpoint The Endpoint Description to be used for import. + * @return An Import Registration that combines the Endpoint Description and + * the Service Reference or null if the Endpoint could + * not be imported. + * @throws SecurityException If the caller does not have the appropriate + * EndpointPermission[endpoint,IMPORT] for the + * Endpoint, and the Java Runtime Environment supports permissions. + */ + ImportRegistration importService(EndpointDescription endpoint); + + /** + * Return the currently active Export References. + * + *

+ * If the caller does not have the appropriate + * EndpointPermission[endpoint,READ] for an Endpoint, and the + * Java Runtime Environment supports permissions, then returned collection + * will not contain a reference to the exported Endpoint. + * + * @return A Collection of {@link ExportReference}s that are + * currently active. + */ + Collection getExportedServices(); + + /** + * Return the currently active Import References. + * + *

+ * If the caller does not have the appropriate + * EndpointPermission[endpoint,READ] for an Endpoint, and the + * Java Runtime Environment supports permissions, then returned collection + * will not contain a reference to the imported Endpoint. + * + * @return A Collection of {@link ImportReference}s that are + * currently active. + */ + Collection getImportedEndpoints(); + +} -- cgit v1.2.3