You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2009/09/16 01:24:14 UTC
svn commit: r815562 [2/2] -
/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/
Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteConstants.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteConstants.java?rev=815562&r1=815561&r2=815562&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteConstants.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteConstants.java Tue Sep 15 23:24:13 2009
@@ -5,152 +5,153 @@
*
*/
public class RemoteConstants {
- private RemoteConstants() {
- }
+ private RemoteConstants() {
+ }
- /**
- * The configuration types supported by this Distribution Provider.
- *
- * Services that are suitable for distribution list the configuration types
- * that describe the configuration information for that service in the
- * {@link #SERVICE_EXPORTED_CONFIGS} or {@link #SERVICE_IMPORTED_CONFIGS}
- * property.
- *
- * A distribution provider must register a service that has this property
- * and enumerate all configuration types that it supports.
- *
- * The type of this property <code>String+</code>
- *
- * @see #SERVICE_EXPORTED_CONFIGS
- * @see #SERVICE_IMPORTED_CONFIGS
- */
- public final static String REMOTE_CONFIGS_SUPPORTED = "remote.configs.supported";
-
- /**
- * Service property that lists the intents supported by the distribution
- * provider.
- *
- * Each distribution provider must register a service that has this property
- * and enumerate all the supported intents, having any qualified intents
- * expanded.
- *
- * The value of this property is of type <code>String+</code>.
- *
- * @see #SERVICE_INTENTS
- * @see #SERVICE_EXPORTED_INTENTS
- * @see #SERVICE_EXPORTED_INTENTS_EXTRA
- */
- public final static String REMOTE_INTENTS_SUPPORTED = "remote.intents.supported";
-
- /**
- * Defines the interfaces under which this service can be exported.
- *
- * This list must be a subset of the types listed in the objectClass service
- * property. The single value of an asterisk ('*' \u002A) indicates all
- * interfaces in the registration's objectClass property (not classes). It
- * is highly recommended to only export interfaces and not concrete classes
- * due to the complexity of creating proxies for some type of classes.
- *
- * The value of this property is of type String+.
- */
- public final static String SERVICE_EXPORTED_INTERFACES = "service.exported.interfaces";
-
- /**
- * A list of intents that the distribution provider must implement to
- * distribute the service. Intents listed in this property are reserved for
- * intents that are critical for the code to function correctly, for
- * example, ordering of messages. These intents should not be configurable.
- *
- * The value of this property is of type <code>String+</code>.
- */
- public final static String SERVICE_EXPORTED_INTENTS = "service.exported.intents";
-
- /**
- * Extra intents configured in addition to the the intents specified in
- * {@link #SERVICE_EXPORTED_INTENTS}.
- *
- * These intents are merged with the service.exported.intents and therefore
- * have the same semantics. They are extra, so that the
- * {@link #SERVICE_EXPORTED_INTENTS} can be set by the bundle developer and
- * this property is then set by the administrator/deployer. Bundles should
- * make this property configurable, for example through the Configuration
- * Admin service.
- *
- * The value of this property is of type <code>String+</code>.
- */
- public final static String SERVICE_EXPORTED_INTENTS_EXTRA = "service.exported.intents.extra";
-
- /**
- * A list of configuration types that should be used to export the service.
- *
- * Configuration types can be <em>synonymous</em> or <em>alternatives</em>.
- * In principle, a distribution provider should create an endpoint for each
- * recognized configuration type, the deployer is responsible that synonyms
- * do not clash.
- *
- * Each configuration type has an associated specification that describes
- * how the configuration data for the exported service is represented in an
- * OSGi framework.
- *
- * The value of this property is of type <code>String+</code>.
- */
- public final static String SERVICE_EXPORTED_CONFIGS = "service.exported.configs";
-
- /**
- * Must be set by a distribution provider to <code>true</code> when it
- * registers the end-point proxy as an imported service. Can be used by a
- * bundle to prevent it from getting an imported service.
- *
- * The value of this property is not defined, setting it is sufficient.
- */
- public final static String SERVICE_IMPORTED = "service.imported";
-
- /**
- * The configuration type used to import this services, as described in
- * {@link #SERVICE_EXPORTED_CONFIGS}. Any associated properties for this
- * configuration types must be properly mapped to the importing system. For
- * example, a URL in these properties must point to a valid resource when
- * used in the importing framework. Configuration types in this property
- * must be synonymous.
- *
- * The value of this property is of type <code>String+</code>.
- */
- public final String SERVICE_IMPORTED_CONFIGS = "service.imported.configs";
-
- /**
- * A list of intents that this service implements. This property has dual
- * purpose. A bundle can use this service property to notify the
- * distribution provider that these intents are already implemented by the
- * exported service object. For an imported service, a distribution provider
- * must use this property to convey the combined intents of the exporting
- * service and the intents that the distribution providers add. To export a
- * service, a distribution provider must recognize all these intents and
- * expand any qualified intents.
- *
- * The value of this property is of type <code>String+</code>.
- */
- public final static String SERVICE_INTENTS = "service.intents";
-
- /**
- * The property key for the endpoint URI. This is a unique id for an
- * endpoint following the URI syntax. As far as this specification is
- * concerned, this unique id is opaque.
- */
- final public static String ENDPOINT_URI = "endpoint.uri";
-
- /**
- * The property key for the endpoint service id. This is a unique id for a
- * service based on the framework id '.' service id or another model. As far as this specification is
- * concerned, this unique id is opaque.
- */
- final public static String ENDPOINT_REMOTE_SERVICE_ID = "endpoint.remote.service.id";
-
- /**
- * The key for a framework property that defines the UUID of the framework.
- *
- * The property must be set by the framework or through configuration before
- * the VM is started or some bundle. The value must be a Universally Unique
- * Id, it must not contain any dots ('.' \u002E).
- */
- public final static String FRAMEWORK_UUID = "org.osgi.framework.uuid";
+ /**
+ * The configuration types supported by this Distribution Provider.
+ *
+ * Services that are suitable for distribution list the configuration types
+ * that describe the configuration information for that service in the
+ * {@link #SERVICE_EXPORTED_CONFIGS} or {@link #SERVICE_IMPORTED_CONFIGS}
+ * property.
+ *
+ * A distribution provider must register a service that has this property
+ * and enumerate all configuration types that it supports.
+ *
+ * The type of this property <code>String+</code>
+ *
+ * @see #SERVICE_EXPORTED_CONFIGS
+ * @see #SERVICE_IMPORTED_CONFIGS
+ */
+ public final static String REMOTE_CONFIGS_SUPPORTED = "remote.configs.supported";
+
+ /**
+ * Service property that lists the intents supported by the distribution
+ * provider.
+ *
+ * Each distribution provider must register a service that has this property
+ * and enumerate all the supported intents, having any qualified intents
+ * expanded.
+ *
+ * The value of this property is of type <code>String+</code>.
+ *
+ * @see #SERVICE_INTENTS
+ * @see #SERVICE_EXPORTED_INTENTS
+ * @see #SERVICE_EXPORTED_INTENTS_EXTRA
+ */
+ public final static String REMOTE_INTENTS_SUPPORTED = "remote.intents.supported";
+
+ /**
+ * Defines the interfaces under which this service can be exported.
+ *
+ * This list must be a subset of the types listed in the objectClass service
+ * property. The single value of an asterisk ('*' \u002A) indicates all
+ * interfaces in the registration's objectClass property (not classes). It
+ * is highly recommended to only export interfaces and not concrete classes
+ * due to the complexity of creating proxies for some type of classes.
+ *
+ * The value of this property is of type String+.
+ */
+ public final static String SERVICE_EXPORTED_INTERFACES = "service.exported.interfaces";
+
+ /**
+ * A list of intents that the distribution provider must implement to
+ * distribute the service. Intents listed in this property are reserved for
+ * intents that are critical for the code to function correctly, for
+ * example, ordering of messages. These intents should not be configurable.
+ *
+ * The value of this property is of type <code>String+</code>.
+ */
+ public final static String SERVICE_EXPORTED_INTENTS = "service.exported.intents";
+
+ /**
+ * Extra intents configured in addition to the the intents specified in
+ * {@link #SERVICE_EXPORTED_INTENTS}.
+ *
+ * These intents are merged with the service.exported.intents and therefore
+ * have the same semantics. They are extra, so that the
+ * {@link #SERVICE_EXPORTED_INTENTS} can be set by the bundle developer and
+ * this property is then set by the administrator/deployer. Bundles should
+ * make this property configurable, for example through the Configuration
+ * Admin service.
+ *
+ * The value of this property is of type <code>String+</code>.
+ */
+ public final static String SERVICE_EXPORTED_INTENTS_EXTRA = "service.exported.intents.extra";
+
+ /**
+ * A list of configuration types that should be used to export the service.
+ *
+ * Configuration types can be <em>synonymous</em> or <em>alternatives</em>.
+ * In principle, a distribution provider should create an endpoint for each
+ * recognized configuration type, the deployer is responsible that synonyms
+ * do not clash.
+ *
+ * Each configuration type has an associated specification that describes
+ * how the configuration data for the exported service is represented in an
+ * OSGi framework.
+ *
+ * The value of this property is of type <code>String+</code>.
+ */
+ public final static String SERVICE_EXPORTED_CONFIGS = "service.exported.configs";
+
+ /**
+ * Must be set by a distribution provider to <code>true</code> when it
+ * registers the end-point proxy as an imported service. Can be used by a
+ * bundle to prevent it from getting an imported service.
+ *
+ * The value of this property is not defined, setting it is sufficient.
+ */
+ public final static String SERVICE_IMPORTED = "service.imported";
+
+ /**
+ * The configuration type used to import this services, as described in
+ * {@link #SERVICE_EXPORTED_CONFIGS}. Any associated properties for this
+ * configuration types must be properly mapped to the importing system. For
+ * example, a URL in these properties must point to a valid resource when
+ * used in the importing framework. Configuration types in this property
+ * must be synonymous.
+ *
+ * The value of this property is of type <code>String+</code>.
+ */
+ public final String SERVICE_IMPORTED_CONFIGS = "service.imported.configs";
+
+ /**
+ * A list of intents that this service implements. This property has dual
+ * purpose. A bundle can use this service property to notify the
+ * distribution provider that these intents are already implemented by the
+ * exported service object. For an imported service, a distribution provider
+ * must use this property to convey the combined intents of the exporting
+ * service and the intents that the distribution providers add. To export a
+ * service, a distribution provider must recognize all these intents and
+ * expand any qualified intents.
+ *
+ * The value of this property is of type <code>String+</code>.
+ */
+ public final static String SERVICE_INTENTS = "service.intents";
+
+
+ /**
+ * The property key for the endpoint URI. This is a unique id for an
+ * endpoint following the URI syntax. As far as this specification is
+ * concerned, this unique id is opaque.
+ */
+ final public static String ENDPOINT_URI = "endpoint.uri";
+
+ /**
+ * The property key for the endpoint service id. This is a unique id for a
+ * service based on the framework id '.' service id or another model. As far as this specification is
+ * concerned, this unique id is opaque.
+ */
+ final public static String ENDPOINT_REMOTE_SERVICE_ID = "endpoint.remote.service.id";
+
+ /**
+ * The key for a framework property that defines the UUID of the framework.
+ *
+ * The property must be set by the framework or through configuration before
+ * the VM is started or some bundle. The value must be a Universally Unique
+ * Id, it must not contain any dots ('.' \u002E).
+ */
+ public final static String FRAMEWORK_UUID = "org.osgi.framework.uuid";
}
Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdmin.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdmin.java?rev=815562&r1=815561&r2=815562&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdmin.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdmin.java Tue Sep 15 23:24:13 2009
@@ -1,8 +1,10 @@
package org.apache.tuscany.sca.osgi.service.remoteadmin;
-import java.util.*;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
-import org.osgi.framework.*;
+import org.osgi.framework.ServiceReference;
/**
* A Remote Service Admin manages the import and export of services.
@@ -17,75 +19,76 @@
*/
public interface RemoteServiceAdmin {
- /**
- * Export a service to an endpoint. The Remote Service Admin must create an
- * endpoint 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. ### do we need
- * exceptions?
- *
- * @param ref
- * The Service Reference to export
- * @return An Export Registration that combines the Endpoint Description and
- * the Service Reference or
- * <code>null</code> if the service could not be exported
- * @throws IllegalArgumentException
- * @throws UnsupportedOperationException
- */
- List/*<ExportRegistration>*/exportService(ServiceReference ref) throws IllegalArgumentException,
- UnsupportedOperationException;
-
- /**
- * 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. ### do we need exceptions?
- *
- * @param ref
- * 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, see
- * {@link #exportService(ServiceReference)}. The properties are
- * the same as given for an exported service. They are overlaid
- * over any properties the service defines.
- * @return An Export Registration that combines the Endpoint Description and
- * the Service Reference or
- * <code>null</code> if the service could not be exported
- * @throws IllegalArgumentException
- * @throws UnsupportedOperationException
- */
- List/*<ExportRegistration>*/exportService(ServiceReference ref, Map/*<String,Object>*/properties)
- throws IllegalArgumentException, UnsupportedOperationException;
-
- /**
- * 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. ### do we need exceptions?
- *
- * @param endpoint
- * The Endpoint Description to be used for import
- * @return An Import Registration that combines the Endpoint Description and
- * the Service Reference or
- * <code>null</code> if the endpoint could not be imported
- */
- ImportRegistration importService(EndpointDescription endpoint);
-
- /**
- * Answer the currently active Export Registrations.
- *
- * @return A collection of Export Registrations that are currently active.
- */
- Collection/*<? extends ExportRegistration>*/getExportedServices();
-
- /**
- * Answer the currently active Import Registrations.
- *
- * @return A collection of Import Registrations that are currently active.
- */
- Collection/*<? extends ImportRegistration>*/getImportedEndpoints();
+ /**
+ * Export a service to an endpoint. The Remote Service Admin must create an
+ * endpoint 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. ### do we need
+ * exceptions?
+ *
+ * @param ref
+ * The Service Reference to export
+ * @return An Export Registration that combines the Endpoint Description and
+ * the Service Reference or
+ * <code>null</code> if the service could not be exported
+ * @throws IllegalArgumentException
+ * @throws UnsupportedOperationException
+ */
+ List/*<ExportRegistration>*/ exportService(ServiceReference ref) throws IllegalArgumentException, UnsupportedOperationException;
+
+ /**
+ * 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. ### do we need exceptions?
+ *
+ * @param ref
+ * 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, see
+ * {@link #exportService(ServiceReference)}. The properties are
+ * the same as given for an exported service. They are overlaid
+ * over any properties the service defines.
+ * @return An Export Registration that combines the Endpoint Description and
+ * the Service Reference or
+ * <code>null</code> if the service could not be exported
+ * @throws IllegalArgumentException
+ * @throws UnsupportedOperationException
+ */
+ List/*<ExportRegistration>*/ exportService(ServiceReference ref,
+ Map/*<String,Object>*/ properties) throws IllegalArgumentException, UnsupportedOperationException;
+
+
+ /**
+ * 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. ### do we need exceptions?
+ *
+ * @param endpoint
+ * The Endpoint Description to be used for import
+ * @return An Import Registration that combines the Endpoint Description and
+ * the Service Reference or
+ * <code>null</code> if the endpoint could not be imported
+ */
+ ImportRegistration importService(EndpointDescription endpoint);
+
+
+ /**
+ * Answer the currently active Export Registrations.
+ *
+ * @return A collection of Export Registrations that are currently active.
+ */
+ Collection/*<? extends ExportRegistration>*/ getExportedServices();
+
+ /**
+ * Answer the currently active Import Registrations.
+ *
+ * @return A collection of Import Registrations that are currently active.
+ */
+ Collection/*<? extends ImportRegistration>*/ getImportedEndpoints();
}