This is an automated email from the ASF dual-hosted git repository. amichair pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit 5b32fbfdfb794d2796f608bd321bb8b6dcb7fb44 Author: Amichai Rothman <[email protected]> AuthorDate: Thu Mar 26 13:40:01 2026 +0200 ARIES-2213 Make config-type specific properties spec-compliant and documented --- .../examples/echotcp/service/EchoServiceImpl.java | 4 +- .../apache/aries/rsa/itests/felix/RsaTestBase.java | 2 +- provider/tcp/Readme.md | 22 +++---- .../org/apache/aries/rsa/provider/tcp/Config.java | 36 +++++++---- .../apache/aries/rsa/provider/tcp/TcpEndpoint.java | 7 +- .../aries/rsa/provider/tcp/TcpEndpointTest.java | 7 +- .../rsa/provider/tcp/TcpProviderPrimitiveTest.java | 5 +- .../aries/rsa/provider/tcp/TcpProviderTLSTest.java | 75 +++++++++++----------- .../aries/rsa/provider/tcp/TcpProviderTest.java | 15 +++-- .../aries/rsa/core/RemoteServiceAdminCore.java | 6 +- .../apache/aries/rsa/spi/DistributionProvider.java | 22 +++++-- 11 files changed, 110 insertions(+), 91 deletions(-) diff --git a/examples/echotcp/service/src/main/java/org/apache/aries/rsa/examples/echotcp/service/EchoServiceImpl.java b/examples/echotcp/service/src/main/java/org/apache/aries/rsa/examples/echotcp/service/EchoServiceImpl.java index b1b2bc86..3cd1f07f 100644 --- a/examples/echotcp/service/src/main/java/org/apache/aries/rsa/examples/echotcp/service/EchoServiceImpl.java +++ b/examples/echotcp/service/src/main/java/org/apache/aries/rsa/examples/echotcp/service/EchoServiceImpl.java @@ -24,8 +24,8 @@ import org.osgi.service.component.annotations.Component; @Component(// property = { "service.exported.interfaces=*", // - "aries.rsa.port=8201", // - "aries.rsa.id=echo" + "aries.tcp.port=8201", // + "aries.tcp.id=echo" }) public class EchoServiceImpl implements EchoService { diff --git a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java index ce78aeeb..d7b486d2 100644 --- a/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java +++ b/itests/felix/src/test/java/org/apache/aries/rsa/itests/felix/RsaTestBase.java @@ -127,7 +127,7 @@ public class RsaTestBase { logback(), systemProperty("pax.exam.osgi.unresolved.fail").value("true"), systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"), - systemProperty("aries.rsa.hostname").value("localhost"), + systemProperty("aries.tcp.hostname").value("localhost"), mvn("org.osgi", "org.osgi.util.function"), mvn("org.osgi", "org.osgi.util.promise"), mvn("org.osgi", "org.osgi.service.component"), diff --git a/provider/tcp/Readme.md b/provider/tcp/Readme.md index f51d6d91..7174183c 100644 --- a/provider/tcp/Readme.md +++ b/provider/tcp/Readme.md @@ -11,11 +11,11 @@ The exported endpoint service supports the following properties: | Key | Default | Description | |--------------------------|--------------------|-------------------------------------| | service.exported.configs | | Must contain "aries.tcp" | -| aries.rsa.hostname | [autodetect] | Hostname or IP address of service | -| aries.rsa.bindAddress | 0.0.0.0 (wildcard) | Address to listen on | -| aries.rsa.port | [free port] | Port to listen on | -| aries.rsa.id | [random id] | Unique id string for endpoint | -| aries.rsa.numThreads | 10 | Number of listener threads to spawn | +| aries.tcp.hostname | [autodetect] | Hostname or IP address of service | +| aries.tcp.bindAddress | 0.0.0.0 (wildcard) | Address to listen on | +| aries.tcp.port | [free port] | Port to listen on | +| aries.tcp.id | [random id] | Unique id string for endpoint | +| aries.tcp.numThreads | 10 | Number of listener threads to spawn | ## Provider Configuration @@ -23,9 +23,9 @@ The provider's configuration pid is `org.apache.aries.rsa.provider.tcp`, and sup | Key | Default | Description | |------------------------------|-----------------|--------------------------------------------------------| -| aries.rsa.keyStore | [no server TLS] | Path to the key store file (or empty to disable TLS) | -| aries.rsa.keyStorePassword | | Key store password | -| aries.rsa.trustStore | [no client TLS] | Path to the trust store file (or empty to disable TLS) | -| aries.rsa.trustStorePassword | | Trust store password | -| aries.rsa.keyAlias | [autoselect] | Alias of key within keystore to use for server TLS | -| aries.rsa.mtls | false | Whether to use MTLS (require client authentication) | +| aries.tcp.keyStore | [no server TLS] | Path to the key store file (or empty to disable TLS) | +| aries.tcp.keyStorePassword | | Key store password | +| aries.tcp.trustStore | [no client TLS] | Path to the trust store file (or empty to disable TLS) | +| aries.tcp.trustStorePassword | | Trust store password | +| aries.tcp.keyAlias | [autoselect] | Alias of key within keystore to use for server TLS | +| aries.tcp.mtls | false | Whether to use MTLS (require client authentication) | diff --git a/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/Config.java b/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/Config.java index 1442f1c5..d18cccb4 100644 --- a/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/Config.java +++ b/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/Config.java @@ -27,21 +27,25 @@ import java.util.UUID; */ public class Config { + static final String PREFIX = TcpProvider.TCP_CONFIG_TYPE + "."; + // endpoint service properties - static final String PORT = "aries.rsa.port"; - static final String HOSTNAME = "aries.rsa.hostname"; - static final String BIND_ADDRESS = "aries.rsa.bindAddress"; - static final String ID = "aries.rsa.id"; - static final String THREADS = "aries.rsa.numThreads"; - static final String TIMEOUT = "osgi.basic.timeout"; + static final String + PORT = PREFIX + "port", + HOSTNAME = PREFIX + "hostname", + BIND_ADDRESS = PREFIX + "bindAddress", + ID = PREFIX + "id", + THREADS = PREFIX + "numThreads", + TIMEOUT = "osgi.basic.timeout"; // provider component properties - static final String KEYSTORE = "aries.rsa.keyStore"; - static final String TRUSTSTORE = "aries.rsa.trustStore"; - static final String KEYSTORE_PASSWORD = "aries.rsa.keyStorePassword"; - static final String TRUSTSTORE_PASSWORD = "aries.rsa.trustStorePassword"; - static final String KEY_ALIAS = "aries.rsa.keyAlias"; - static final String MTLS = "aries.rsa.mtls"; + static final String + KEYSTORE = PREFIX + "keyStore", + TRUSTSTORE = PREFIX + "trustStore", + KEYSTORE_PASSWORD = PREFIX + "keyStorePassword", + TRUSTSTORE_PASSWORD = PREFIX + "trustStorePassword", + KEY_ALIAS = PREFIX + "keyAlias", + MTLS = PREFIX + "mtls"; static final int DYNAMIC_PORT = 0; static final int DEFAULT_TIMEOUT_MILLIS = 300000; @@ -65,7 +69,13 @@ public class Config { String getString(String key, String defaultValue) { Object value = props.get(key); - return value != null ? value.toString() : defaultValue; + if (value == null) { + return defaultValue; + } + if (!(value instanceof String)) { + throw new IllegalArgumentException(key + " is not a string"); + } + return value.toString(); } public int getPort() { diff --git a/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/TcpEndpoint.java b/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/TcpEndpoint.java index c0064a54..e2edf05a 100644 --- a/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/TcpEndpoint.java +++ b/provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/TcpEndpoint.java @@ -47,9 +47,6 @@ public class TcpEndpoint implements Endpoint { if (service == null) { throw new NullPointerException("Service must not be null"); } - if (effectiveProperties.get(TcpProvider.TCP_CONFIG_TYPE + ".id") != null) { - throw new IllegalArgumentException("For the tck .. Just to please you!"); - } this.closeCallback = closeCallback; Config config = new Config(effectiveProperties); port = config.getPort(); // this may initially be 0 for dynamic port @@ -66,8 +63,8 @@ public class TcpEndpoint implements Endpoint { effectiveProperties.put(RemoteConstants.ENDPOINT_ID, endpointId); effectiveProperties.put(RemoteConstants.SERVICE_EXPORTED_CONFIGS, ""); effectiveProperties.put(RemoteConstants.SERVICE_INTENTS, Arrays.asList("osgi.basic", "osgi.async")); - - // tck tests for one such property ... so we provide it + // tck tests require at least one config-type specific property... so we provide this one + // (it also tests that we throw IllegalArgumentException when any config-type property value is garbage) effectiveProperties.put(TcpProvider.TCP_CONFIG_TYPE + ".id", endpointId); this.epd = new EndpointDescription(effectiveProperties); } diff --git a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpEndpointTest.java b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpEndpointTest.java index 6b518f33..fdfa1a0b 100644 --- a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpEndpointTest.java +++ b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpEndpointTest.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import static org.apache.aries.rsa.provider.tcp.Config.PREFIX; import org.apache.aries.rsa.provider.tcp.myservice.MyService; import org.apache.aries.rsa.provider.tcp.myservice.MyServiceImpl; import org.junit.Assert; @@ -48,9 +49,9 @@ public class TcpEndpointTest { @Test public void testEndpointProperties() throws IOException { - props.put("aries.rsa.port", PORT); - props.put("aries.rsa.hostname", HOSTNAME); - props.put("aries.rsa.id", "testme"); + props.put(PREFIX + "port", PORT); + props.put(PREFIX + "hostname", HOSTNAME); + props.put(PREFIX + "id", "testme"); TcpEndpoint tcpEndpoint = new TcpEndpoint(service, props, null); EndpointDescription epd = tcpEndpoint.description(); Assert.assertEquals("tcp://" + HOSTNAME + ":" + PORT + "/testme", epd.getId()); diff --git a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderPrimitiveTest.java b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderPrimitiveTest.java index b67013b9..354be26f 100644 --- a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderPrimitiveTest.java +++ b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderPrimitiveTest.java @@ -19,6 +19,7 @@ package org.apache.aries.rsa.provider.tcp; import static java.util.Arrays.asList; +import static org.apache.aries.rsa.provider.tcp.Config.PREFIX; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.everyItem; @@ -62,8 +63,8 @@ public class TcpProviderPrimitiveTest { provider.activate(new HashMap<>()); Map<String, Object> props = new HashMap<>(); EndpointHelper.addObjectClass(props, exportedInterfaces); - props.put("aries.rsa.hostname", "localhost"); - props.put("aries.rsa.numThreads", "10"); + props.put(PREFIX + "hostname", "localhost"); + props.put(PREFIX + "numThreads", "10"); PrimitiveServiceImpl myService = new PrimitiveServiceImpl(); BundleContext bc = EasyMock.mock(BundleContext.class); ep = provider.exportService(myService, bc, props, exportedInterfaces); diff --git a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTLSTest.java b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTLSTest.java index df485301..17736dff 100644 --- a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTLSTest.java +++ b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTLSTest.java @@ -15,6 +15,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import static org.apache.aries.rsa.provider.tcp.Config.PREFIX; import static org.apache.aries.rsa.provider.tcp.TcpProviderTest.getFreePort; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.StringStartsWith.startsWith; @@ -85,91 +86,91 @@ public class TcpProviderTLSTest { @Test public void testNoTLS() throws IOException { HashMap<String, Object> providerProps = new HashMap<>(); - providerProps.put("aries.rsa.keyStore", ""); - providerProps.put("aries.rsa.trustStore", null); - providerProps.put("aries.rsa.keyStorePassword", "asdf"); - providerProps.put("aries.rsa.trustStorePassword", "asdf"); - providerProps.put("aries.rsa.keyAlias", "asdf"); - providerProps.put("aries.rsa.mtls", "false"); + providerProps.put(PREFIX + "keyStore", ""); + providerProps.put(PREFIX + "trustStore", null); + providerProps.put(PREFIX + "keyStorePassword", "asdf"); + providerProps.put(PREFIX + "trustStorePassword", "asdf"); + providerProps.put(PREFIX + "keyAlias", "asdf"); + providerProps.put(PREFIX + "mtls", "false"); test(providerProps); } @Test(expected = RuntimeException.class) public void testWrongPassword() throws IOException { HashMap<String, Object> providerProps = new HashMap<>(); - providerProps.put("aries.rsa.keyStore", KEYSTORE); - providerProps.put("aries.rsa.trustStore", TRUSTSTORE); - providerProps.put("aries.rsa.keyStorePassword", "asdf"); - providerProps.put("aries.rsa.trustStorePassword", "asdf"); + providerProps.put(PREFIX + "keyStore", KEYSTORE); + providerProps.put(PREFIX + "trustStore", TRUSTSTORE); + providerProps.put(PREFIX + "keyStorePassword", "asdf"); + providerProps.put(PREFIX + "trustStorePassword", "asdf"); test(providerProps); } @Test public void testTLS() throws IOException { HashMap<String, Object> providerProps = new HashMap<>(); - providerProps.put("aries.rsa.keyStore", KEYSTORE); - providerProps.put("aries.rsa.trustStore", TRUSTSTORE); - providerProps.put("aries.rsa.keyStorePassword", KEYSTORE_PASSWORD); - providerProps.put("aries.rsa.trustStorePassword", TRUSTSTORE_PASSWORD); + providerProps.put(PREFIX + "keyStore", KEYSTORE); + providerProps.put(PREFIX + "trustStore", TRUSTSTORE); + providerProps.put(PREFIX + "keyStorePassword", KEYSTORE_PASSWORD); + providerProps.put(PREFIX + "trustStorePassword", TRUSTSTORE_PASSWORD); test(providerProps); } @Test(expected = ServiceException.class) public void testWrongKey() throws IOException { HashMap<String, Object> providerProps = new HashMap<>(); - providerProps.put("aries.rsa.keyStore", KEYSTORE2); - providerProps.put("aries.rsa.trustStore", TRUSTSTORE); - providerProps.put("aries.rsa.keyStorePassword", KEYSTORE_PASSWORD); - providerProps.put("aries.rsa.trustStorePassword", TRUSTSTORE_PASSWORD); + providerProps.put(PREFIX + "keyStore", KEYSTORE2); + providerProps.put(PREFIX + "trustStore", TRUSTSTORE); + providerProps.put(PREFIX + "keyStorePassword", KEYSTORE_PASSWORD); + providerProps.put(PREFIX + "trustStorePassword", TRUSTSTORE_PASSWORD); test(providerProps); } @Test public void testKeyAlias() throws IOException { HashMap<String, Object> providerProps = new HashMap<>(); - providerProps.put("aries.rsa.keyAlias", "MyServerKey"); - providerProps.put("aries.rsa.keyStore", KEYSTORE); - providerProps.put("aries.rsa.trustStore", TRUSTSTORE); - providerProps.put("aries.rsa.keyStorePassword", KEYSTORE_PASSWORD); - providerProps.put("aries.rsa.trustStorePassword", TRUSTSTORE_PASSWORD); + providerProps.put(PREFIX + "keyAlias", "MyServerKey"); + providerProps.put(PREFIX + "keyStore", KEYSTORE); + providerProps.put(PREFIX + "trustStore", TRUSTSTORE); + providerProps.put(PREFIX + "keyStorePassword", KEYSTORE_PASSWORD); + providerProps.put(PREFIX + "trustStorePassword", TRUSTSTORE_PASSWORD); test(providerProps); } @Test(expected = RuntimeException.class) public void testWrongKeyAlias() throws IOException { HashMap<String, Object> providerProps = new HashMap<>(); - providerProps.put("aries.rsa.keyAlias", "YourService"); - providerProps.put("aries.rsa.keyStore", KEYSTORE2); - providerProps.put("aries.rsa.trustStore", TRUSTSTORE); - providerProps.put("aries.rsa.keyStorePassword", KEYSTORE_PASSWORD); - providerProps.put("aries.rsa.trustStorePassword", TRUSTSTORE_PASSWORD); + providerProps.put(PREFIX + "keyAlias", "YourService"); + providerProps.put(PREFIX + "keyStore", KEYSTORE2); + providerProps.put(PREFIX + "trustStore", TRUSTSTORE); + providerProps.put(PREFIX + "keyStorePassword", KEYSTORE_PASSWORD); + providerProps.put(PREFIX + "trustStorePassword", TRUSTSTORE_PASSWORD); test(providerProps); } @Test(expected = RuntimeException.class) public void testMTLSWithoutKeyStore() throws IOException { HashMap<String, Object> providerProps = new HashMap<>(); - providerProps.put("aries.rsa.mtls", "true"); - providerProps.put("aries.rsa.trustStore", KEYSTORE); + providerProps.put(PREFIX + "mtls", "true"); + providerProps.put(PREFIX + "trustStore", KEYSTORE); test(providerProps); } @Test(expected = RuntimeException.class) public void testMTLSWithoutTrustStore() throws IOException { HashMap<String, Object> providerProps = new HashMap<>(); - providerProps.put("aries.rsa.mtls", "true"); - providerProps.put("aries.rsa.trustStore", TRUSTSTORE); + providerProps.put(PREFIX + "mtls", "true"); + providerProps.put(PREFIX + "trustStore", TRUSTSTORE); test(providerProps); } @Test public void testMTLS() throws IOException { HashMap<String, Object> providerProps = new HashMap<>(); - providerProps.put("aries.rsa.mtls", "true"); - providerProps.put("aries.rsa.keyStore", KEYSTORE); - providerProps.put("aries.rsa.trustStore", TRUSTSTORE); - providerProps.put("aries.rsa.keyStorePassword", KEYSTORE_PASSWORD); - providerProps.put("aries.rsa.trustStorePassword", TRUSTSTORE_PASSWORD); + providerProps.put(PREFIX + "mtls", "true"); + providerProps.put(PREFIX + "keyStore", KEYSTORE); + providerProps.put(PREFIX + "trustStore", TRUSTSTORE); + providerProps.put(PREFIX + "keyStorePassword", KEYSTORE_PASSWORD); + providerProps.put(PREFIX + "trustStorePassword", TRUSTSTORE_PASSWORD); test(providerProps); } diff --git a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTest.java b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTest.java index 599e0b28..ad43dcdb 100644 --- a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTest.java +++ b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTest.java @@ -44,6 +44,7 @@ import java.util.concurrent.Future; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; +import static org.apache.aries.rsa.provider.tcp.Config.PREFIX; import org.apache.aries.rsa.provider.tcp.myservice.ExpectedTestException; import org.apache.aries.rsa.provider.tcp.myservice.MyService; import org.apache.aries.rsa.provider.tcp.myservice.MyServiceImpl; @@ -90,14 +91,14 @@ public class TcpProviderTest { Map<String, Object> props = new HashMap<>(); EndpointHelper.addObjectClass(props, exportedInterfaces); int port = getFreePort(); - props.put("aries.rsa.hostname", "localhost"); - props.put("aries.rsa.port", port); - props.put("aries.rsa.numThreads", NUM_THREADS); + props.put(PREFIX + "hostname", "localhost"); + props.put(PREFIX + "port", port); + props.put(PREFIX + "numThreads", NUM_THREADS); props.put("osgi.basic.timeout", TIMEOUT); BundleContext bc = EasyMock.mock(BundleContext.class); - props.put("aries.rsa.id", "service1"); + props.put(PREFIX + "id", "service1"); ep = provider.exportService(new MyServiceImpl("service1"), bc, props, exportedInterfaces); - props.put("aries.rsa.id", "service2"); + props.put(PREFIX + "id", "service2"); ep2 = provider.exportService(new MyServiceImpl("service2"), bc, props, exportedInterfaces); assertThat(ep.description().getId(), startsWith("tcp://localhost:")); importedService = provider.importEndpoint( @@ -164,8 +165,8 @@ public class TcpProviderTest { @Test public void testCallSharedPort() { - Object port1 = ep.description().getProperties().get("aries.rsa.port"); - Object port2 = ep2.description().getProperties().get("aries.rsa.port"); + Object port1 = ep.description().getProperties().get(PREFIX + "port"); + Object port2 = ep2.description().getProperties().get(PREFIX + "port"); assertEquals(port1, port2); assertEquals("service1", myServiceProxy.getId()); assertEquals("service2", myServiceProxy2.getId()); diff --git a/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java b/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java index bcf62eb5..77b7188d 100644 --- a/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java +++ b/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java @@ -229,9 +229,9 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin { return null; } return new ExportRegistrationImpl(serviceReference, endpoint, closeHandler, eventProducer); - } catch (IllegalArgumentException e) { - // TCK expects this for garbage input - throw e; + } catch (IllegalArgumentException iae) { + // TCK expects this for garbage input in config-type specific properties + throw iae; } catch (Exception e) { return new ExportRegistrationImpl(e, closeHandler, eventProducer); } diff --git a/spi/src/main/java/org/apache/aries/rsa/spi/DistributionProvider.java b/spi/src/main/java/org/apache/aries/rsa/spi/DistributionProvider.java index b23e9148..772add85 100644 --- a/spi/src/main/java/org/apache/aries/rsa/spi/DistributionProvider.java +++ b/spi/src/main/java/org/apache/aries/rsa/spi/DistributionProvider.java @@ -31,24 +31,32 @@ public interface DistributionProvider { /** * Called by RemoteServiceAdmin to export a service. * <p> - * The Distribution provider will be called if no config type was set or - * if it supports the config type. + * The Distribution provider will be called if it supports the + * specified config type, or if no config type was specified. + * <p> + * All config-type specific configuration properties in the returned endpoint + * must have names of the form {@code <config>.*}, i.e. the property name + * must be prefixed with the config type string itself. + * If any of the config-type specific properties are invalid, + * an IllegalArgumentException must be thrown. * - * @param serviceO service instance to be exported + * @param serviceObject service instance to be exported * @param serviceContext bundle context of the bundle exporting the service * @param effectiveProperties combined properties of the service and additional properties from rsa * @param exportedInterfaces name of the interface to be exported + * @throws IllegalArgumentException if any of the config-type specific properties are invalid * @return Endpoint that represents the service that is exposed to the outside world */ - Endpoint exportService(Object serviceO, + Endpoint exportService(Object serviceObject, BundleContext serviceContext, Map<String, Object> effectiveProperties, Class[] exportedInterfaces); /** - * Called by RemoteServiceAdmin to import a service, - * i.e. get a proxy that can be used to access the remote service. - * <p> + * Imports a remote endpoint by providing a proxy object that can be + * used by a local consumer bundle, whose provider-specific + * implementation accesses the remote service behind the scenes. + * * @param cl classloader of the consumer bundle * @param consumerContext bundle context of the consumer bundle * @param interfaces interfaces of the service to proxy
