Author: davidb
Date: Thu Apr 23 10:04:23 2009
New Revision: 767877
URL: http://svn.apache.org/viewvc?rev=767877&view=rev
Log:
Added the DistributionConstants as defined by OSGi.
Added:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/osgi/service/distribution/DistributionConstants.java
(with props)
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandlerTest.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHookTest.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java
Thu Apr 23 10:04:23 2009
@@ -40,6 +40,7 @@
import org.osgi.framework.hooks.service.ListenerHook;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
+import org.osgi.service.distribution.DistributionConstants;
import org.osgi.service.distribution.DistributionProvider;
public class Activator implements BundleActivator, ServiceListener,
ManagedService {
@@ -123,7 +124,7 @@
private void checkExistingServices() throws InvalidSyntaxException {
ServiceReference[] references = bc.getServiceReferences(null,
- "(" +
org.apache.cxf.dosgi.dsw.Constants.REMOTE_INTERFACES_PROPERTY + "=*)");
+ "(" + DistributionConstants.PROP_KEY_SERVICE_REMOTE_INTERFACES +
"=*)");
if (references != null) {
for (ServiceReference sref : references) {
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java
Thu Apr 23 10:04:23 2009
@@ -19,36 +19,22 @@
package org.apache.cxf.dosgi.dsw;
public class Constants {
- public static final String INTENTS_PROPERTY = "deployment.intents";
-
- public static final String REMOTE_PROPERTY_PREFIX = "osgi.remote";
-
- public static final String REMOTE_INTERFACES_PROPERTY =
REMOTE_PROPERTY_PREFIX + ".interfaces";
- public static final String REQUIRES_INTENTS_PROPERTY =
REMOTE_PROPERTY_PREFIX + ".requires.intents";
- public static final String CONFIGURATION_PROPERTY = ".configuration";
+ public static final String CONFIGURATION_PROPERTY =
"osgi.remote.configuration";
- public static final String CONFIG_TYPE_PROPERTY =
- REMOTE_PROPERTY_PREFIX + CONFIGURATION_PROPERTY + ".type";
-
- // TODO : these config type properties should better be enums ?
-
// SCA
public static final String SCA_CONFIG_TYPE = "sca";
- public static final String SCA_CONFIG_PREFIX =
- REMOTE_PROPERTY_PREFIX + CONFIGURATION_PROPERTY + ".sca";
+ public static final String SCA_CONFIG_PREFIX = CONFIGURATION_PROPERTY +
"." + SCA_CONFIG_TYPE;
public static final String SCA_REMOTE_BINDINGS = SCA_CONFIG_PREFIX +
".bindings";
public static final String SCA_REMOTE_POLICIES = SCA_CONFIG_PREFIX +
".policies";
// WSDL
public static final String WSDL_CONFIG_TYPE = "wsdl";
- public static final String WSDL_CONFIG_PREFIX =
- REMOTE_PROPERTY_PREFIX + CONFIGURATION_PROPERTY + "." +
WSDL_CONFIG_TYPE;
+ public static final String WSDL_CONFIG_PREFIX = CONFIGURATION_PROPERTY +
"." + WSDL_CONFIG_TYPE;
public static final String SERVICE_NAMESPACE = WSDL_CONFIG_PREFIX +
".service.ns";
// POJO
public static final String POJO_CONFIG_TYPE = "pojo";
- public static final String POJO_CONFIG_PREFIX =
- REMOTE_PROPERTY_PREFIX + CONFIGURATION_PROPERTY + "." +
POJO_CONFIG_TYPE;
+ public static final String POJO_CONFIG_PREFIX = CONFIGURATION_PROPERTY +
"." + POJO_CONFIG_TYPE;
public static final String POJO_ADDRESS_PROPERTY = POJO_CONFIG_PREFIX +
".address";
public static final String POJO_HTTP_SERVICE_CONTEXT = POJO_CONFIG_PREFIX
+ ".httpservice.context";
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
Thu Apr 23 10:04:23 2009
@@ -46,6 +46,7 @@
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.discovery.ServiceEndpointDescription;
+import org.osgi.service.distribution.DistributionConstants;
import
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
@@ -90,7 +91,7 @@
Map<String, Object> userProperties = new HashMap<String, Object>();
for (String key : sref.getPropertyKeys()) {
// we're after remote properties only
- if (key.startsWith(Constants.REMOTE_PROPERTY_PREFIX)) {
+ if (key.startsWith(DistributionConstants.PROP_KEY_REMOTE_SERVICE))
{
userProperties.put(key, sref.getProperty(key));
}
}
@@ -154,9 +155,9 @@
sd.getProvidedInterfaces().toArray(new
String[interfaceNameCount]);
list = new ServiceEndpointDescription[iNames.length];
for (int i = 0; i < iNames.length; i++) {
- Map<String, Object> props =
- excludeProperty(sd.getProperties(),
- Constants.REMOTE_INTERFACES_PROPERTY);
+ Map<String, Object> props =
excludeProperty(sd.getProperties(),
+
DistributionConstants.PROP_KEY_SERVICE_REMOTE_INTERFACES);
+
String keys[] = props.keySet().toArray(new
String[props.size()]);
for (int j = 0; j < keys.length; j++) {
int sep = keys[j].indexOf(INTERFACE_SEPARATOR);
@@ -264,7 +265,7 @@
String interfaceName, Filter filter, boolean matchAll) {
Dictionary props = new Hashtable();
for (Object key : sd.getPropertyKeys()) {
- if (matchAll ||
key.toString().startsWith(Constants.REMOTE_PROPERTY_PREFIX)) {
+ if (matchAll ||
key.toString().startsWith(DistributionConstants.PROP_KEY_REMOTE_SERVICE)) {
props.put(key, sd.getProperty(key.toString()));
}
}
@@ -469,7 +470,7 @@
public static String[] getPublishableInterfaces(ServiceEndpointDescription
sd,
ServiceReference sref) {
Object publishProperty =
- sd.getProperty(Constants.REMOTE_INTERFACES_PROPERTY);
+
sd.getProperty(DistributionConstants.PROP_KEY_SERVICE_REMOTE_INTERFACES);
String[] actualInterfaces =
(String[])sref.getProperty(org.osgi.framework.Constants.OBJECTCLASS);
String[] publishableInterfaces = null;
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
Thu Apr 23 10:04:23 2009
@@ -18,6 +18,8 @@
*/
package org.apache.cxf.dosgi.dsw.handlers;
+import static
org.osgi.service.discovery.ServicePublication.PROP_KEY_ENDPOINT_LOCATION;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -42,8 +44,7 @@
import org.apache.cxf.frontend.ServerFactoryBean;
import org.osgi.framework.BundleContext;
import org.osgi.service.discovery.ServiceEndpointDescription;
-
-import static
org.osgi.service.discovery.ServicePublication.PROP_KEY_ENDPOINT_LOCATION;
+import org.osgi.service.distribution.DistributionConstants;
public abstract class AbstractPojoConfigurationTypeHandler extends
AbstractConfigurationHandler {
private static final Logger LOG =
Logger.getLogger(AbstractPojoConfigurationTypeHandler.class.getName());
@@ -69,11 +70,12 @@
Map<String, String> registerPublication(Server server, String[] intents) {
Map<String, String> publicationProperties = new HashMap<String,
String>();
- publicationProperties.put(Constants.CONFIG_TYPE_PROPERTY,
Constants.POJO_CONFIG_TYPE);
+
publicationProperties.put(DistributionConstants.PROP_KEY_SERVICE_REMOTE_CONFIG_TYPE,
+ Constants.POJO_CONFIG_TYPE);
String intentsValue = OsgiUtils.formatIntents(intents);
if (intentsValue.length() > 0) {
- publicationProperties.put(Constants.INTENTS_PROPERTY,
intentsValue);
+
publicationProperties.put(DistributionConstants.PROP_KEY_DEPLOYMENT_INTENTS,
intentsValue);
}
return publicationProperties;
}
@@ -176,8 +178,9 @@
}
private static String[] getRequestedIntents(ServiceEndpointDescription sd)
{
- String property =
- OsgiUtils.getProperty(sd, Constants.REQUIRES_INTENTS_PROPERTY);
+ String property = OsgiUtils.getProperty(sd,
+
DistributionConstants.PROP_KEY_SERVICE_REMOTE_REQUIRES_INTENTS);
+
String[] intents = OsgiUtils.parseIntents(property);
for (int i = 0; i < intents.length; i++) {
LOG.fine("Intent asserted: " + intents[i]);
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
Thu Apr 23 10:04:23 2009
@@ -26,6 +26,7 @@
import org.apache.cxf.dosgi.dsw.service.CxfDistributionProvider;
import org.osgi.framework.BundleContext;
import org.osgi.service.discovery.ServiceEndpointDescription;
+import org.osgi.service.distribution.DistributionConstants;
public final class ConfigTypeHandlerFactory {
@@ -41,7 +42,7 @@
public ConfigurationTypeHandler getHandler(BundleContext dswBC,
ServiceEndpointDescription sd,
CxfDistributionProvider dp,
Map<String, Object>
handlerProperties) {
- String type = OsgiUtils.getProperty(sd,
Constants.CONFIG_TYPE_PROPERTY);
+ String type = OsgiUtils.getProperty(sd,
DistributionConstants.PROP_KEY_SERVICE_REMOTE_CONFIG_TYPE);
if (type == null || Constants.POJO_CONFIG_TYPE.equalsIgnoreCase(type))
{
if (type == null) {
LOG.info("Defaulting to pojo configuration type ");
@@ -49,8 +50,6 @@
if (OsgiUtils.getProperty(sd, Constants.POJO_HTTP_SERVICE_CONTEXT)
!= null) {
if (OsgiUtils.getProperty(sd, Constants.POJO_ADDRESS_PROPERTY)
!= null) {
-
-
return null;
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
Thu Apr 23 10:04:23 2009
@@ -26,13 +26,12 @@
import static
org.osgi.service.discovery.ServicePublication.PROP_KEY_ENDPOINT_ID;
import static
org.osgi.service.discovery.ServicePublication.PROP_KEY_SERVICE_INTERFACE_NAME;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Dictionary;
-import java.util.Iterator;
import java.util.HashMap;
import java.util.Hashtable;
+import java.util.Iterator;
import java.util.Map;
import java.util.logging.Logger;
@@ -43,11 +42,11 @@
import org.osgi.framework.BundleContext;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.discovery.DiscoveredServiceNotification;
import org.osgi.service.discovery.DiscoveredServiceTracker;
import org.osgi.service.discovery.ServiceEndpointDescription;
+import org.osgi.service.distribution.DistributionConstants;
public class AbstractClientHook extends AbstractHook {
@@ -74,9 +73,9 @@
ServiceEndpointDescription sd =
notification.getServiceEndpointDescription();
- if (sd.getProperty(Constants.REMOTE_INTERFACES_PROPERTY) == null) {
+ if
(sd.getProperty(DistributionConstants.PROP_KEY_SERVICE_REMOTE_INTERFACES) ==
null) {
LOG.info("not proxifying service, enabling property not set: "
- + Constants.REMOTE_INTERFACES_PROPERTY);
+ + DistributionConstants.PROP_KEY_SERVICE_REMOTE_INTERFACES);
return;
}
@@ -134,8 +133,7 @@
}
}
- private Collection<String>
getMatchingInterfaces(DiscoveredServiceNotification notification, BundleContext
context) {
-
+ private Collection<String>
getMatchingInterfaces(DiscoveredServiceNotification notification, BundleContext
context) {
Collection<String> matches = new ArrayList<String>();
Iterator interfaces =
notification.getServiceEndpointDescription().getProvidedInterfaces().iterator();
@@ -188,7 +186,7 @@
Map<String, Object> props = new HashMap<String, Object>();
props.putAll(sd.getProperties());
props.put(Constants.DSW_CLIENT_ID, getIdentificationProperty());
- props.put(Constants.REMOTE_PROPERTY_PREFIX, "true");
+ props.put(DistributionConstants.PROP_KEY_REMOTE_SERVICE, "true");
return props;
}
Added:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/osgi/service/distribution/DistributionConstants.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/osgi/service/distribution/DistributionConstants.java?rev=767877&view=auto
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/osgi/service/distribution/DistributionConstants.java
(added)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/osgi/service/distribution/DistributionConstants.java
Thu Apr 23 10:04:23 2009
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) OSGi Alliance (2000, 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.distribution;
+
+/**
+ * Defines standard names for distribution-related service properties.
+ */
+public class DistributionConstants {
+ /** This class only contains static constants and should not be
instantiated.
+ */
+ private DistributionConstants() {}
+
+ /**
+ * This service registration property indicates that the provided service
is
+ * to be made available remotely, which implies that it is suitable for
+ * remote invocations. This property lists a subset of service interface
+ * names specified in the <tt>BundleContext.registerService</tt> call,
+ * denoting the interfaces that are suitable for remoting.
+ * If the list contains only one value, which is set to *, all of the
interfaces
+ * specified in the <tt>BundleContext.registerService</tt> call are being
exposed
+ * remotely.
+ * <p>
+ * The value of this property is of type String, String[] or a Collection
of Strings.
+ */
+ public static final String PROP_KEY_SERVICE_REMOTE_INTERFACES =
"osgi.remote.interfaces";
+
+ /**
+ * This optional service registration property contains a list of intents
+ * that should be satisfied when publishing this service remotely. If a
+ * Distribution Provider implementation cannot satisfy these intents when
+ * exposing the service remotely, it should not expose the service.
+ * <p>
+ * The value of this property is of type String, String[] or a Collection
of Strings.
+ */
+ public static final String PROP_KEY_SERVICE_REMOTE_REQUIRES_INTENTS =
"osgi.remote.requires.intents";
+
+ /**
+ * This optional service registration property identifies the metadata type
+ * of additional metadata associated with the service provider or consumer,
+ * e.g. "sca" Multiple types and thus sets of additional metadata may be
+ * provided.
+ * <p>
+ * The value of this property is of type String, String[] or a Collection
of Strings.
+ */
+ public static final String PROP_KEY_SERVICE_REMOTE_CONFIG_TYPE =
"osgi.remote.configuration.type";
+
+ /**
+ * This optional service registration property contains a list of intents
+ * provided by the service itself. The property advertises capabilities of
the
+ * service implementation and can be used by the service consumer in the
lookup
+ * filter to only select a service that provides certain qualities of
service.
+ * <p>
+ * These service intents may be interpreted by other framework components
+ * for example to take them into account when exposing that service
+ * remotely.
+ * <p>
+ * In case of proxies to remote services the value of this property is a
+ * union of the value specified by the service provider, plus its
+ * remote-specific intents (see {...@link
#PROP_KEY_SERVICE_REMOTE_REQUIRES_INTENTS}}),
+ * plus any intents which the Distribution Software adds to describe
characteristics
+ * of the distribution mechanism.
+ * Therefore the value of this property can vary between the client side
+ * proxy and the server side service.
+ * <p>
+ * The value of this property is of type String, String[] or a Collection
of Strings.
+ */
+ public static final String PROP_KEY_DEPLOYMENT_INTENTS =
"deployment.intents";
+
+ /**
+ * This service registration property is set on client side service proxies
+ * registered in the OSGi Service Registry. This allows service consumers
to
+ * identify remote services if needed.
+ * <p>
+ * The value of this property is undefined. The simple fact that the
property is set
+ * denotes that the service is running remotely.
+ */
+ public static final String PROP_KEY_REMOTE_SERVICE =
"osgi.remote";
+}
Propchange:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/osgi/service/distribution/DistributionConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/osgi/service/distribution/DistributionConstants.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
Thu Apr 23 10:04:23 2009
@@ -107,7 +107,7 @@
ServiceEndpointDescription sd =
EasyMock.createMock(ServiceEndpointDescription.class);
ServiceReference sref = EasyMock.createMock(ServiceReference.class);
-
EasyMock.expect(sd.getProperty(Constants.REMOTE_INTERFACES_PROPERTY)).andReturn(requested);
+
EasyMock.expect(sd.getProperty("osgi.remote.interfaces")).andReturn(requested);
EasyMock.expect(sref.getProperty(org.osgi.framework.Constants.OBJECTCLASS)).andReturn(actual);
EasyMock.replay(sd);
EasyMock.replay(sref);
@@ -126,7 +126,7 @@
public void testGetRemoteReferencesFromRegistrationProperties() {
final Map<String, Object> props = new HashMap<String, Object>();
props.put(org.osgi.framework.Constants.OBJECTCLASS, new String []
{"myClass"});
- props.put(Constants.REMOTE_INTERFACES_PROPERTY, "*");
+ props.put("osgi.remote.interfaces", "*");
Bundle b = EasyMock.createNiceMock(Bundle.class);
EasyMock.replay(b);
@@ -146,7 +146,7 @@
// Actual test starts here
ServiceEndpointDescription sd = OsgiUtils.getRemoteReference(sr, true);
- assertEquals("*",
sd.getProperties().get(Constants.REMOTE_INTERFACES_PROPERTY));
+ assertEquals("*", sd.getProperties().get("osgi.remote.interfaces"));
EasyMock.verify(sr);
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java
Thu Apr 23 10:04:23 2009
@@ -54,7 +54,7 @@
ConfigTypeHandlerFactory f = ConfigTypeHandlerFactory.getInstance();
Map<String, Object> sdProps = new HashMap<String, Object>();
- sdProps.put(Constants.CONFIG_TYPE_PROPERTY,
Constants.POJO_CONFIG_TYPE);
+ sdProps.put("osgi.remote.configuration.type",
Constants.POJO_CONFIG_TYPE);
ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
Collections.singletonList("MyInterface"), sdProps);
@@ -89,7 +89,7 @@
ConfigTypeHandlerFactory f = ConfigTypeHandlerFactory.getInstance();
Map<String, Object> sdProps = new HashMap<String, Object>();
- sdProps.put(Constants.CONFIG_TYPE_PROPERTY,
Constants.POJO_CONFIG_TYPE);
+ sdProps.put("osgi.remote.configuration.type",
Constants.POJO_CONFIG_TYPE);
sdProps.put(Constants.POJO_HTTP_SERVICE_CONTEXT, "/abc");
ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
Collections.singletonList("MyInterface"), sdProps);
@@ -107,7 +107,7 @@
ConfigTypeHandlerFactory f = ConfigTypeHandlerFactory.getInstance();
Map<String, Object> sdProps = new HashMap<String, Object>();
- sdProps.put(Constants.CONFIG_TYPE_PROPERTY,
Constants.POJO_CONFIG_TYPE);
+ sdProps.put("osgi.remote.configuration.type",
Constants.POJO_CONFIG_TYPE);
sdProps.put(Constants.POJO_ADDRESS_PROPERTY,
"http://localhost:9876/abcd");
sdProps.put(Constants.POJO_HTTP_SERVICE_CONTEXT, "/abc");
ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
@@ -124,7 +124,7 @@
ConfigTypeHandlerFactory f = ConfigTypeHandlerFactory.getInstance();
Map<String, Object> sdProps = new HashMap<String, Object>();
- sdProps.put(Constants.CONFIG_TYPE_PROPERTY,
Constants.WSDL_CONFIG_TYPE);
+ sdProps.put("osgi.remote.configuration.type",
Constants.WSDL_CONFIG_TYPE);
ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
Collections.singletonList("MyInterface"), sdProps);
@@ -141,7 +141,7 @@
ConfigTypeHandlerFactory f = ConfigTypeHandlerFactory.getInstance();
Map<String, Object> sdProps = new HashMap<String, Object>();
- sdProps.put(Constants.CONFIG_TYPE_PROPERTY, "foobar");
+ sdProps.put("osgi.remote.configuration.type", "foobar");
ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
Collections.singletonList("MyInterface"), sdProps);
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandlerTest.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandlerTest.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandlerTest.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandlerTest.java
Thu Apr 23 10:04:23 2009
@@ -194,7 +194,7 @@
EasyMock.replay(callingContext);
Map<String, Object> props = new HashMap<String, Object>();
- props.put(Constants.CONFIG_TYPE_PROPERTY, Constants.POJO_CONFIG_TYPE);
+ props.put("osgi.remote.configuration.type",
Constants.POJO_CONFIG_TYPE);
props.put(Constants.POJO_HTTP_SERVICE_CONTEXT, "/myRunnable");
ServiceEndpointDescription sd = new
ServiceEndpointDescriptionImpl(Runnable.class.getName(), props);
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
Thu Apr 23 10:04:23 2009
@@ -265,7 +265,7 @@
};
Map<String, Object> props = new HashMap<String, Object>();
- props.put(Constants.REQUIRES_INTENTS_PROPERTY, "A");
+ props.put("osgi.remote.requires.intents", "A");
ServiceEndpointDescription sd = new
ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
List<String> effectiveIntents =
@@ -301,7 +301,7 @@
};
Map<String, Object> props = new HashMap<String, Object>();
- props.put(Constants.REQUIRES_INTENTS_PROPERTY, "transactionality
confidentiality.message");
+ props.put("osgi.remote.requires.intents", "transactionality
confidentiality.message");
ServiceEndpointDescription sd = new
ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
List<String> effectiveIntents =
@@ -332,7 +332,7 @@
};
Map<String, Object> props = new HashMap<String, Object>();
- props.put(Constants.REQUIRES_INTENTS_PROPERTY, "A B");
+ props.put("osgi.remote.requires.intents", "A B");
ServiceEndpointDescription sd =
new
ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
@@ -375,7 +375,7 @@
};
Map<String, Object> props = new HashMap<String, Object>();
- props.put(Constants.REQUIRES_INTENTS_PROPERTY, "A");
+ props.put("osgi.remote.requires.intents", "A");
ServiceEndpointDescription sd =
new
ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
@@ -414,7 +414,7 @@
};
Map<String, Object> props = new HashMap<String, Object>();
- props.put(Constants.REQUIRES_INTENTS_PROPERTY, "A");
+ props.put("osgi.remote.requires.intents", "A");
ServiceEndpointDescription sd =
new
ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
@@ -453,7 +453,7 @@
};
Map<String, Object> props = new HashMap<String, Object>();
- props.put(Constants.REQUIRES_INTENTS_PROPERTY, "A SOAP.1_2");
+ props.put("osgi.remote.requires.intents", "A SOAP.1_2");
ServiceEndpointDescription sd =
new
ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
@@ -521,7 +521,7 @@
DistributionProviderImpl dp = new DistributionProviderImpl(dswContext);
Map<String, Object> props = new HashMap<String, Object>();
- props.put(Constants.REQUIRES_INTENTS_PROPERTY, requestedIntents);
+ props.put("osgi.remote.requires.intents", requestedIntents);
ServiceEndpointDescription sd = new
ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
PojoConfigurationTypeHandler p = new
PojoConfigurationTypeHandler(dswContext, dp, handlerProps) {
@@ -570,7 +570,7 @@
DistributionProviderImpl dp = new DistributionProviderImpl(dswContext);
Map<String, Object> props = new HashMap<String, Object>();
- props.put(Constants.REQUIRES_INTENTS_PROPERTY, "B A");
+ props.put("osgi.remote.requires.intents", "B A");
ServiceEndpointDescription sd = new
ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
PojoConfigurationTypeHandler p = new
PojoConfigurationTypeHandler(dswContext, dp, handlerProps) {
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHookTest.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHookTest.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHookTest.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHookTest.java
Thu Apr 23 10:04:23 2009
@@ -46,6 +46,6 @@
}
};
Map<String, Object> props = ch.getProperties(sed);
- assertTrue(Boolean.valueOf((String)
props.get(Constants.REMOTE_PROPERTY_PREFIX)));
+ assertTrue(Boolean.valueOf((String) props.get("osgi.remote")));
}
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java?rev=767877&r1=767876&r2=767877&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java
Thu Apr 23 10:04:23 2009
@@ -161,8 +161,7 @@
Collection names = sd.getProvidedInterfaces();
assertEquals(1, names.size());
assertEquals(serviceNames[i], names.toArray()[0]);
- String excludeProp =
- org.apache.cxf.dosgi.dsw.Constants.REMOTE_INTERFACES_PROPERTY;
+ String excludeProp = "osgi.remote.interfaces";
assertNull(sd.getProperties().get(excludeProp));
String addrProp =
org.apache.cxf.dosgi.dsw.Constants.POJO_ADDRESS_PROPERTY;