aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csie...@apache.org
Subject [35/50] [abbrv] aries-jax-rs-whiteboard git commit: restructure the entire build
Date Thu, 24 Nov 2016 10:53:39 GMT
http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/CXFJaxRsServiceRegistrator.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/CXFJaxRsServiceRegistrator.java b/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/CXFJaxRsServiceRegistrator.java
new file mode 100644
index 0000000..7449ec8
--- /dev/null
+++ b/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/CXFJaxRsServiceRegistrator.java
@@ -0,0 +1,148 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package com.liferay.portal.remote.rest.extender.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+
+import javax.ws.rs.core.Application;
+import javax.ws.rs.ext.RuntimeDelegate;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
+import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
+import org.apache.cxf.jaxrs.provider.json.JSONProvider;
+
+/**
+ * @author Carlos Sierra Andrés
+ */
+public class CXFJaxRsServiceRegistrator {
+
+	public CXFJaxRsServiceRegistrator(
+		Bus bus, Application application, Map<String, Object> properties) {
+
+		_bus = bus;
+		_application = application;
+		_properties = properties;
+
+		rewire();
+	}
+
+	public void close() {
+		if (_closed) {
+			return;
+		}
+
+		if (_server != null) {
+			_server.destroy();
+		}
+
+		_closed = true;
+	}
+
+	public void addProvider(Object provider) {
+		if (_closed) {
+			return;
+		}
+
+		_providers.add(provider);
+
+		rewire();
+	}
+
+	public void addService(Object service) {
+		if (_closed) {
+			return;
+		}
+
+		_services.add(service);
+
+		rewire();
+	}
+
+	public void removeProvider(Object provider) {
+		if (_closed) {
+			return;
+		}
+
+		_providers.remove(provider);
+
+		rewire();
+	}
+
+	public void removeService(Object service) {
+		if (_closed) {
+			return;
+		}
+
+		_services.remove(service);
+
+		rewire();
+	}
+
+	protected synchronized void rewire() {
+		if (_server != null) {
+			_server.destroy();
+		}
+
+		RuntimeDelegate runtimeDelegate = RuntimeDelegate.getInstance();
+
+		JAXRSServerFactoryBean jaxRsServerFactoryBean =
+			runtimeDelegate.createEndpoint(
+				_application, JAXRSServerFactoryBean.class);
+
+		jaxRsServerFactoryBean.setBus(_bus);
+		jaxRsServerFactoryBean.setProperties(_properties);
+
+		JSONProvider<Object> jsonProvider = new JSONProvider<>();
+
+		jsonProvider.setDropCollectionWrapperElement(true);
+		jsonProvider.setDropRootElement(true);
+		jsonProvider.setSerializeAsArray(true);
+		jsonProvider.setSupportUnwrapped(true);
+
+		jaxRsServerFactoryBean.setProvider(jsonProvider);
+
+		for (Object provider : _providers) {
+			jaxRsServerFactoryBean.setProvider(provider);
+		}
+
+		for (Object service : _services) {
+			jaxRsServerFactoryBean.setResourceProvider(
+				new SingletonResourceProvider(service, true));
+		}
+
+		String address = _properties.get("CXF_ENDPOINT_ADDRESS").toString();
+
+		if (address != null) {
+			jaxRsServerFactoryBean.setAddress(address);
+		}
+
+		_server = jaxRsServerFactoryBean.create();
+
+		_server.start();
+	}
+
+	private volatile boolean _closed = false;
+	private final Application _application;
+	private final Bus _bus;
+	private final Map<String, Object> _properties;
+	private final Collection<Object> _providers = new ArrayList<>();
+	private Server _server;
+	private final Collection<Object> _services = new ArrayList<>();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/FiltersAndInterceptorsServiceTrackerCustomizer.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/FiltersAndInterceptorsServiceTrackerCustomizer.java b/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/FiltersAndInterceptorsServiceTrackerCustomizer.java
new file mode 100644
index 0000000..07e8c7a
--- /dev/null
+++ b/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/FiltersAndInterceptorsServiceTrackerCustomizer.java
@@ -0,0 +1,123 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ * <p>
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * <p>
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package com.liferay.portal.remote.rest.extender.internal;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+/**
+ * @author Carlos Sierra Andrés
+ */
+public class FiltersAndInterceptorsServiceTrackerCustomizer
+	implements ServiceTrackerCustomizer<Object, ServiceTracker<?, ?>> {
+
+	private BundleContext _bundleContext;
+
+	public FiltersAndInterceptorsServiceTrackerCustomizer(
+		BundleContext bundleContext) {
+
+		_bundleContext = bundleContext;
+	}
+
+	@Override
+	public ServiceTracker<?, ?> addingService(final ServiceReference<Object> reference) {
+		final String filterBase =
+			reference.getProperty("osgi.jaxrs.filter.base").toString();
+
+		final Object service = _bundleContext.getService(reference);
+
+		ServiceTracker<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator> serviceTracker = new ServiceTracker<>(
+			_bundleContext, CXFJaxRsServiceRegistrator.class,
+			new ServiceTrackerCustomizer
+				<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>() {
+
+				@Override
+				public CXFJaxRsServiceRegistrator addingService(
+					ServiceReference<CXFJaxRsServiceRegistrator> cxfReference) {
+
+					Object resourceBaseObject =
+						cxfReference.getProperty("CXF_ENDPOINT_ADDRESS");
+
+					if (resourceBaseObject == null) {
+						return null;
+					}
+
+					String resourceBase = resourceBaseObject.toString();
+
+					if (resourceBase.startsWith(filterBase)) {
+						CXFJaxRsServiceRegistrator serviceRegistrator =
+							_bundleContext.getService(cxfReference);
+						try {
+							serviceRegistrator.addProvider(service);
+
+							return serviceRegistrator;
+						}
+						finally {
+							_bundleContext.ungetService(reference);
+						}
+					}
+
+					return null;
+				}
+
+				@Override
+				public void modifiedService(
+					ServiceReference<CXFJaxRsServiceRegistrator> reference,
+					CXFJaxRsServiceRegistrator service) {
+
+					removedService(reference, service);
+					addingService(reference);
+				}
+
+				@Override
+				public void removedService(
+					ServiceReference<CXFJaxRsServiceRegistrator> reference,
+					CXFJaxRsServiceRegistrator service) {
+
+					CXFJaxRsServiceRegistrator serviceRegistrator =
+						_bundleContext.getService(reference);
+					try {
+						serviceRegistrator.removeProvider(service);
+					}
+					finally {
+						_bundleContext.ungetService(reference);
+					}
+				}
+			});
+
+		serviceTracker.open();
+
+		return serviceTracker;
+	}
+
+	@Override
+	public void modifiedService(
+		ServiceReference<Object> reference, ServiceTracker<?, ?> serviceTracker) {
+
+		removedService(reference, serviceTracker);
+		addingService(reference);
+	}
+
+	@Override
+	public void removedService(
+		ServiceReference<Object> reference, ServiceTracker<?, ?> serviceTracker) {
+
+		_bundleContext.ungetService(reference);
+
+		serviceTracker.close();
+	}
+}

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ServicesServiceTrackerCustomizer.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ServicesServiceTrackerCustomizer.java b/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ServicesServiceTrackerCustomizer.java
new file mode 100644
index 0000000..433f70c
--- /dev/null
+++ b/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ServicesServiceTrackerCustomizer.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ * <p>
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * <p>
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package com.liferay.portal.remote.rest.extender.internal;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.wiring.BundleWiring;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+/**
+ * @author Carlos Sierra Andrés
+ */
+public class ServicesServiceTrackerCustomizer
+	implements ServiceTrackerCustomizer
+		<Object, ServiceTracker
+			<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>> {
+
+	private final BundleContext _bundleContext;
+
+	public ServicesServiceTrackerCustomizer(BundleContext bundleContext) {
+		_bundleContext = bundleContext;
+	}
+
+	@Override
+	public ServiceTracker
+		<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>
+	addingService(ServiceReference<Object> reference) {
+
+		String applicationSelector =
+			reference.getProperty("jaxrs.application.select").toString();
+
+		Bundle bundle = reference.getBundle();
+
+		BundleWiring bundleWiring = bundle.adapt(BundleWiring.class);
+
+		ClassLoader classLoader = bundleWiring.getClassLoader();
+
+		Object service = _bundleContext.getService(reference);
+
+		try {
+			Filter filter = _bundleContext.createFilter(
+				"(&(objectClass=" + CXFJaxRsServiceRegistrator.class.getName() + ")" +
+					applicationSelector + ")");
+
+			ServiceTracker
+				<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>
+				serviceTracker = new ServiceTracker<>(
+					_bundleContext, filter,
+					new AddonsServiceTrackerCustomizer(
+						_bundleContext, classLoader,
+						service));
+
+			serviceTracker.open();
+
+			return serviceTracker;
+		}
+		catch (InvalidSyntaxException ise) {
+			_bundleContext.ungetService(reference);
+
+			throw new RuntimeException(ise);
+		}
+	}
+
+	@Override
+	public void modifiedService(
+		ServiceReference<Object> reference,
+		ServiceTracker
+			<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>
+			serviceTracker) {
+
+		removedService(reference, serviceTracker);
+
+		addingService(reference);
+	}
+
+	@Override
+	public void removedService(
+		ServiceReference<Object> reference,
+		ServiceTracker
+			<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>
+			serviceTracker) {
+
+		serviceTracker.close();
+
+		_bundleContext.ungetService(reference);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/SingletonServiceTrackerCustomizer.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/SingletonServiceTrackerCustomizer.java b/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/SingletonServiceTrackerCustomizer.java
new file mode 100644
index 0000000..8645504
--- /dev/null
+++ b/org.apache.aries.jax-rs.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/SingletonServiceTrackerCustomizer.java
@@ -0,0 +1,159 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ * <p>
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * <p>
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package com.liferay.portal.remote.rest.extender.internal;
+
+import org.apache.cxf.Bus;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+import javax.ws.rs.core.Application;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author Carlos Sierra Andrés
+ */
+class SingletonServiceTrackerCustomizer
+	implements ServiceTrackerCustomizer
+		<Object, SingletonServiceTrackerCustomizer.Tracked> {
+
+	private BundleContext _bundleContext;
+	private Bus _bus;
+
+	public SingletonServiceTrackerCustomizer(
+		BundleContext bundleContext, Bus bus) {
+
+		_bundleContext = bundleContext;
+		_bus = bus;
+	}
+
+	@Override
+	public Tracked addingService(
+		ServiceReference<Object> serviceReference) {
+
+		final Object service = _bundleContext.getService(
+			serviceReference);
+
+		try {
+			String[] propertyKeys = serviceReference.getPropertyKeys();
+
+			Map<String, Object> properties = new HashMap<>(
+				propertyKeys.length);
+
+			for (String propertyKey : propertyKeys) {
+				if (propertyKey.equals("osgi.jaxrs.resource.base")) {
+					continue;
+				}
+				properties.put(
+					propertyKey, serviceReference.getProperty(propertyKey));
+			}
+
+			properties.put(
+				"CXF_ENDPOINT_ADDRESS",
+				serviceReference.getProperty("osgi.jaxrs.resource.base").
+					toString());
+
+			CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator =
+				new CXFJaxRsServiceRegistrator(
+					_bus,
+					new Application() {
+						@Override
+						public Set<Object> getSingletons() {
+							return Collections.singleton(service);
+						}
+					},
+					properties);
+
+			return new Tracked(
+				cxfJaxRsServiceRegistrator, service,
+				_bundleContext.registerService(
+					CXFJaxRsServiceRegistrator.class,
+					cxfJaxRsServiceRegistrator, new Hashtable<>(properties)));
+		}
+		catch (Exception e) {
+			_bundleContext.ungetService(serviceReference);
+
+			throw e;
+		}
+	}
+
+	@Override
+	public void modifiedService(
+		ServiceReference<Object> serviceReference, Tracked tracked) {
+
+		removedService(serviceReference, tracked);
+
+		addingService(serviceReference);
+	}
+
+	@Override
+	public void removedService(
+		ServiceReference<Object> reference, Tracked tracked) {
+
+		_bundleContext.ungetService(reference);
+
+		Object service = tracked.getService();
+
+		CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator =
+			tracked.getCxfJaxRsServiceRegistrator();
+
+		cxfJaxRsServiceRegistrator.close();
+
+		tracked.getCxfJaxRsServiceRegistratorServiceRegistration().unregister();
+	}
+
+	public static class Tracked {
+
+		private final CXFJaxRsServiceRegistrator _cxfJaxRsServiceRegistrator;
+		private final Object _service;
+		private final ServiceRegistration<CXFJaxRsServiceRegistrator>
+			_cxfJaxRsServiceRegistratorServiceRegistration;
+
+		public Object getService() {
+			return _service;
+		}
+
+		public CXFJaxRsServiceRegistrator getCxfJaxRsServiceRegistrator() {
+			return _cxfJaxRsServiceRegistrator;
+		}
+
+		public ServiceRegistration<CXFJaxRsServiceRegistrator>
+			getCxfJaxRsServiceRegistratorServiceRegistration() {
+
+			return _cxfJaxRsServiceRegistratorServiceRegistration;
+		}
+
+		public Tracked(
+			CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator,
+			Object service,
+			ServiceRegistration<CXFJaxRsServiceRegistrator>
+				cxfJaxRsServiceRegistratorServiceRegistration) {
+
+			_cxfJaxRsServiceRegistrator = cxfJaxRsServiceRegistrator;
+			_service = service;
+			_cxfJaxRsServiceRegistratorServiceRegistration =
+				cxfJaxRsServiceRegistratorServiceRegistration;
+		}
+
+	}
+
+}
+
+

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.integration-test/integration-test.bndrun
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.integration-test/integration-test.bndrun b/org.apache.aries.jax-rs.integration-test/integration-test.bndrun
new file mode 100644
index 0000000..435ad96
--- /dev/null
+++ b/org.apache.aries.jax-rs.integration-test/integration-test.bndrun
@@ -0,0 +1,50 @@
+-standalone:
+
+-plugin.integration.test = \
+  aQute.bnd.repository.maven.pom.provider.BndPomRepository; \
+    snapshotUrls=https://oss.sonatype.org/content/repositories/osgi/; \
+    releaseUrls=https://repo1.maven.org/maven2/; \
+    pom=${.}/pom.xml; \
+    name=integration.test; \
+    location=${.}/target/cached.xml
+
+-runrequires: \
+    osgi.identity;filter:='(osgi.identity=org.apache.aries.jax-rs.tests)'
+
+-runfw: org.eclipse.osgi;version='[3.10.100.v20150529-1857,3.10.100.v20150529-1857]'
+
+#-runtrace: true
+
+-runee: JavaSE-1.8
+-resolve.effective: resolve, active
+  
+-runsystempackages.eqnx: javax.script
+-runsystemcapabilities.dflt: ${native_capability}
+-runproperties.eqnx:        \
+  osgi.console.enable.builtin=false, \
+  osgi.console=, \
+  org.osgi.service.http.port=8080
+-runbundles: \
+  javax.annotation-api; version='[1.2.0,1.2.1)',\
+  javax.json-api; version='[1.0.0,1.0.1)',\
+  javax.ws.rs-api; version='[2.0.1,2.0.2)',\
+  log4j; version='[1.2.17,1.2.18)',\
+  org.apache.aries.jax-rs.extender; version='[1.0.0,1.0.1)',\
+  org.apache.aries.jax-rs.tests; version='[1.0.0,1.0.1)',\
+  org.apache.felix.bundlerepository; version='[1.6.0,1.6.1)',\
+  org.apache.felix.configadmin; version='[1.8.8,1.8.9)',\
+  org.apache.felix.http.api; version='[3.0.0,3.0.1)',\
+  org.apache.felix.http.jetty; version='[3.4.0,3.4.1)',\
+  org.apache.felix.http.servlet-api; version='[1.1.2,1.1.3)',\
+  org.apache.felix.scr; version='[2.0.2,2.0.3)',\
+  org.apache.ws.xmlschema.core; version='[2.2.1,2.2.2)',\
+  org.eclipse.equinox.event; version='[1.3.100,1.3.101)',\
+  org.eclipse.equinox.metatype; version='[1.4.100,1.4.101)',\
+  org.objectweb.asm; version='[5.0.4,5.0.5)',\
+  org.osgi.compendium; version='[4.1.0,4.1.1)',\
+  org.osgi.service.event; version='[1.3.1,1.3.2)',\
+  org.osgi.service.metatype; version='[1.3.0,1.3.1)',\
+  osgi.enroute.hamcrest.wrapper; version='[1.3.0,1.3.1)',\
+  osgi.enroute.junit.wrapper; version='[4.12.0,4.12.1)',\
+  slf4j.api; version='[1.7.21,1.7.22)',\
+  slf4j.log4j12; version='[1.6.1,1.6.2)'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.integration-test/pom.xml
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.integration-test/pom.xml b/org.apache.aries.jax-rs.integration-test/pom.xml
new file mode 100644
index 0000000..2650fc2
--- /dev/null
+++ b/org.apache.aries.jax-rs.integration-test/pom.xml
@@ -0,0 +1,64 @@
+<project 
+	xmlns="http://maven.apache.org/POM/4.0.0" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.aries</groupId>
+		<artifactId>org.apache.aries.jax-rs</artifactId>
+		<version>1.0.0-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<artifactId>org.apache.aries.jax-rs.integration-test</artifactId>
+
+	<packaging>pom</packaging>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>biz.aQute.bnd</groupId>
+				<artifactId>bnd-testing-maven-plugin</artifactId>
+				<version>3.4.0-SNAPSHOT</version>
+				<configuration>
+					<failOnChanges>false</failOnChanges>
+					<resolve>false</resolve>
+					<bndruns>
+						<bndrun>integration-test.bndrun</bndrun>
+					</bndruns>
+					<targetDir>.</targetDir>
+				</configuration>
+				<executions>
+					<execution>
+						<goals>
+							<goal>testing</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.aries</groupId>
+			<artifactId>org.apache.aries.jax-rs.extender</artifactId>
+			<version>1.0.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.aries</groupId>
+			<artifactId>org.apache.aries.jax-rs.tests</artifactId>
+			<version>1.0.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.http.jetty</artifactId>
+			<version>3.4.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>osgi.enroute.pom.distro</artifactId>
+			<version>2.0.0</version>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.tests/bnd.bnd
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.tests/bnd.bnd b/org.apache.aries.jax-rs.tests/bnd.bnd
new file mode 100644
index 0000000..264db93
--- /dev/null
+++ b/org.apache.aries.jax-rs.tests/bnd.bnd
@@ -0,0 +1,5 @@
+Bundle-Description: Integration Test bundle for the JAX-RS extender
+
+Test-Cases: \
+	${classes;CONCRETE;EXTENDS;junit.framework.TestCase},\
+	${classes;CONCRETE;ANNOTATED;org.junit.Test}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.tests/pom.xml
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.tests/pom.xml b/org.apache.aries.jax-rs.tests/pom.xml
new file mode 100644
index 0000000..0a4a453
--- /dev/null
+++ b/org.apache.aries.jax-rs.tests/pom.xml
@@ -0,0 +1,33 @@
+<project
+	xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.aries</groupId>
+		<artifactId>org.apache.aries.jax-rs</artifactId>
+		<version>1.0.0-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>org.apache.aries.jax-rs.tests</artifactId>
+
+	<dependencies>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>javax.ws.rs-api</artifactId>
+            <version>2.0.1</version>
+        </dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>org.osgi.core</artifactId>
+			<version>5.0.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>osgi.enroute.junit.wrapper</artifactId>
+			<version>4.12.0</version>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.tests/src/main/java/test/JaxrsTest.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.tests/src/main/java/test/JaxrsTest.java b/org.apache.aries.jax-rs.tests/src/main/java/test/JaxrsTest.java
new file mode 100644
index 0000000..38b03c2
--- /dev/null
+++ b/org.apache.aries.jax-rs.tests/src/main/java/test/JaxrsTest.java
@@ -0,0 +1,55 @@
+package test;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.util.tracker.ServiceTracker;
+
+import junit.framework.TestCase;
+import test.types.TestAddon;
+
+public class JaxrsTest extends TestCase {
+
+	static BundleContext bundleContext = FrameworkUtil.getBundle(
+		JaxrsTest.class).getBundleContext();
+
+	public void testEndPoint() throws Exception {
+		ServiceRegistration<?> serviceRegistration = null;
+
+		try {
+			TestAddon testAddon = new TestAddon();
+
+			Dictionary<String, Object> properties = new Hashtable<>();
+			properties.put("osgi.jaxrs.resource.base", "/test-addon");
+
+			serviceRegistration = bundleContext.registerService(
+				Object.class, testAddon, properties);
+
+			// TODO this availability should be checked through a jaxrs runtime service of some kind
+
+			Filter filter = bundleContext.createFilter(
+					"(&(objectClass=com.liferay.portal.remote.rest.extender.internal.CXFJaxRsServiceRegistrator)" +
+						"(CXF_ENDPOINT_ADDRESS=/test-addon))");
+
+			ServiceTracker<?, ?> st = new ServiceTracker<>(bundleContext, filter, null);
+
+			st.open();
+
+			if (st.waitForService(5000) == null) {
+				fail();
+			}
+
+			// TODO add http client to connect to the endpoint
+		}
+		finally {
+			if (serviceRegistration != null) {
+				serviceRegistration.unregister();
+			}
+		}
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestAddon.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestAddon.java b/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestAddon.java
new file mode 100644
index 0000000..849d582
--- /dev/null
+++ b/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestAddon.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ * <p>
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * <p>
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package test.types;
+
+import javax.annotation.PostConstruct;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+
+//property = "osgi.jaxrs.resource.base=/test-addon",
+public class TestAddon {
+
+	@GET
+	@Path("/{name}")
+	public String sayHello(@PathParam("name") String name) {
+		return "Hello " + name;
+	}
+
+	@PostConstruct
+	public void init() {
+		System.out.println("URIINFO: " + _uriInfo);
+	}
+
+	@Context
+	UriInfo _uriInfo;
+
+}

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestApplication.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestApplication.java b/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestApplication.java
new file mode 100644
index 0000000..c7e65f3
--- /dev/null
+++ b/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestApplication.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ * <p/>
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * <p/>
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package test.types;
+
+import java.util.Collections;
+import java.util.Set;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Application;
+
+//	property = "osgi.jaxrs.application.base=/example-application",
+public class TestApplication extends Application {
+
+	@Override
+	public Set<Object> getSingletons() {
+		return Collections.<Object>singleton(this);
+	}
+
+	@GET
+	@Produces("text/plain")
+	public String sayHello() {
+		return "Hello world";
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestFilter.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestFilter.java b/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestFilter.java
new file mode 100644
index 0000000..928221a
--- /dev/null
+++ b/org.apache.aries.jax-rs.tests/src/main/java/test/types/TestFilter.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ * <p>
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * <p>
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package test.types;
+
+import java.io.IOException;
+
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.ext.Provider;
+
+//	property = {
+//		"jaxrs.application.select=(component.name=com.liferay.portal.rest.example.ExampleApplication)",
+//		"osgi.jaxrs.filter.base=/examples"
+//	}
+@Provider
+public class TestFilter implements ContainerRequestFilter {
+
+	@Override
+	public void filter(ContainerRequestContext requestContext)
+		throws IOException {
+
+		System.out.println("FILTERED!");
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/.gitignore
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/.gitignore b/org.apache.aries.rest.extender/.gitignore
deleted file mode 100644
index 83ccc54..0000000
--- a/org.apache.aries.rest.extender/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/build/
-/bin/

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/bnd.bnd
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/bnd.bnd b/org.apache.aries.rest.extender/bnd.bnd
deleted file mode 100644
index d03d478..0000000
--- a/org.apache.aries.rest.extender/bnd.bnd
+++ /dev/null
@@ -1,5 +0,0 @@
-Bundle-Activator: com.liferay.portal.remote.rest.extender.activator.CXFJaxRsBundleActivator
-Provide-Capability: \
-    osgi.extender; \
-        osgi.extender='aries.jax-rs'; \
-		version:Version='1.0.0'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/pom.xml
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/pom.xml b/org.apache.aries.rest.extender/pom.xml
deleted file mode 100644
index 5952b5a..0000000
--- a/org.apache.aries.rest.extender/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<project 
-    xmlns="http://maven.apache.org/POM/4.0.0" 
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
->
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.aries</groupId>
-        <artifactId>org.apache.aries.jax-rs</artifactId>
-        <version>1.0.0-SNAPSHOT</version>
-    </parent>
-    <artifactId>org.apache.aries.rest.extender</artifactId>
-    <packaging>jar</packaging>
-    <description>Aries JAX-RS Extender</description>
-    <dependencies>
-        <dependency>
-            <groupId>biz.aQute.bnd</groupId>
-            <artifactId>biz.aQute.bndlib</artifactId>
-            <version>3.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>com.liferay</groupId>
-            <artifactId>com.liferay.portal.remote.cxf.jaxrs.common</artifactId>
-            <version>2.0.0</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>javax.ws.rs-api</artifactId>
-            <version>2.0.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-core</artifactId>
-            <version>3.1.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
-            <version>3.1.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-rs-extension-providers</artifactId>
-            <version>3.1.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-            <version>6.0.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.http.whiteboard</artifactId>
-            <version>1.0.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.dependencymanager</artifactId>
-            <version>3.2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jettison</groupId>
-            <artifactId>jettison</artifactId>
-            <version>1.3.8</version>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/activator/CXFJaxRsBundleActivator.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/activator/CXFJaxRsBundleActivator.java b/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/activator/CXFJaxRsBundleActivator.java
deleted file mode 100644
index 04017d6..0000000
--- a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/activator/CXFJaxRsBundleActivator.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
-
-package com.liferay.portal.remote.rest.extender.activator;
-
-import javax.ws.rs.ext.RuntimeDelegate;
-
-import com.liferay.portal.remote.rest.extender.internal.BusServiceTrackerCustomizer;
-import com.liferay.portal.remote.rest.extender.internal.ServicesServiceTrackerCustomizer;
-import org.apache.cxf.Bus;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * @author Carlos Sierra Andrés
- */
-public class CXFJaxRsBundleActivator implements BundleActivator {
-
-	private ServiceTracker<?, ?> _busServiceTracker;
-	private ServiceTracker<?, ?> _singletonsTracker;
-
-	@Override
-	public void start(BundleContext bundleContext) throws Exception {
-		Thread thread = Thread.currentThread();
-
-		ClassLoader contextClassLoader = thread.getContextClassLoader();
-
-		ClassLoader classLoader = RuntimeDelegate.class.getClassLoader();
-
-		thread.setContextClassLoader(classLoader);
-
-		try {
-
-			// Initialize instance so it is never looked up again
-
-			RuntimeDelegate.getInstance();
-		}
-		finally {
-			thread.setContextClassLoader(contextClassLoader);
-		}
-
-		_busServiceTracker = new ServiceTracker<>(
-			bundleContext, Bus.class,
-			new BusServiceTrackerCustomizer(bundleContext));
-
-		_busServiceTracker.open();
-
-		Filter filter = bundleContext.createFilter(
-			"(jaxrs.application.select=*)");
-
-		_singletonsTracker = new ServiceTracker<>(
-			bundleContext, filter,
-			new ServicesServiceTrackerCustomizer(bundleContext));
-
-		_singletonsTracker.open();
-	}
-
-	@Override
-	public void stop(BundleContext context) throws Exception {
-		_busServiceTracker.close();
-
-		_singletonsTracker.close();
-	}
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/AddonsServiceTrackerCustomizer.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/AddonsServiceTrackerCustomizer.java b/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/AddonsServiceTrackerCustomizer.java
deleted file mode 100644
index 8900ded..0000000
--- a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/AddonsServiceTrackerCustomizer.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
- * <p>
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * <p>
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
-
-package com.liferay.portal.remote.rest.extender.internal;
-
-import com.liferay.portal.remote.rest.extender.internal.CXFJaxRsServiceRegistrator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-import javax.ws.rs.ext.Provider;
-
-/**
- * @author Carlos Sierra Andrés
- */
-public class AddonsServiceTrackerCustomizer
-	implements ServiceTrackerCustomizer<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator> {
-
-	private final BundleContext _bundleContext;
-	private final ClassLoader _classLoader;
-	private final Class<?> _serviceClass;
-	private final Object _service;
-
-	public AddonsServiceTrackerCustomizer(
-		BundleContext bundleContext, ClassLoader classLoader,
-		Object service) {
-
-		_bundleContext = bundleContext;
-		_classLoader = classLoader;
-		_service = service;
-
-		_serviceClass = service.getClass();
-	}
-
-	@Override
-	public CXFJaxRsServiceRegistrator addingService(
-		ServiceReference<CXFJaxRsServiceRegistrator> reference) {
-
-		Thread thread = Thread.currentThread();
-
-		ClassLoader contextClassLoader =
-			thread.getContextClassLoader();
-
-		CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator =
-			_bundleContext.getService(reference);
-
-		try {
-			thread.setContextClassLoader(_classLoader);
-
-			if (_serviceClass.isAnnotationPresent(Provider.class)) {
-				cxfJaxRsServiceRegistrator.addProvider(_service);
-			} else {
-				cxfJaxRsServiceRegistrator.addService(_service);
-			}
-
-			return cxfJaxRsServiceRegistrator;
-		}
-		catch (Exception e) {
-			_bundleContext.ungetService(reference);
-
-			throw e;
-		}
-		finally {
-			thread.setContextClassLoader(contextClassLoader);
-		}
-	}
-
-	@Override
-	public void modifiedService(
-		ServiceReference<CXFJaxRsServiceRegistrator> reference,
-		CXFJaxRsServiceRegistrator registrator) {
-
-		removedService(reference, registrator);
-
-		addingService(reference);
-	}
-
-	@Override
-	public void removedService(
-		ServiceReference<CXFJaxRsServiceRegistrator> reference,
-		CXFJaxRsServiceRegistrator registrator) {
-
-		if (_serviceClass.isAnnotationPresent(Provider.class)) {
-			registrator.removeProvider(_service);
-		} else {
-			registrator.removeService(_service);
-		}
-
-		_bundleContext.ungetService(reference);
-	}
-}

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ApplicationServiceTrackerCustomizer.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ApplicationServiceTrackerCustomizer.java b/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ApplicationServiceTrackerCustomizer.java
deleted file mode 100644
index 2594ac3..0000000
--- a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ApplicationServiceTrackerCustomizer.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
- * <p>
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * <p>
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
-
-package com.liferay.portal.remote.rest.extender.internal;
-
-import org.apache.cxf.Bus;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-import javax.ws.rs.core.Application;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-/**
- * @author Carlos Sierra Andrés
- */
-class ApplicationServiceTrackerCustomizer
-	implements ServiceTrackerCustomizer
-		<Application, ApplicationServiceTrackerCustomizer.Tracked> {
-
-	private BundleContext _bundleContext;
-	private Bus _bus;
-
-	public ApplicationServiceTrackerCustomizer(
-		BundleContext bundleContext, Bus bus) {
-
-		_bundleContext = bundleContext;
-		_bus = bus;
-	}
-
-	@Override
-	public Tracked addingService(
-		ServiceReference<Application> serviceReference) {
-
-		Application application = _bundleContext.getService(
-			serviceReference);
-
-		try {
-			String[] propertyKeys = serviceReference.getPropertyKeys();
-
-			Map<String, Object> properties = new HashMap<>(
-				propertyKeys.length);
-
-			for (String propertyKey : propertyKeys) {
-				properties.put(
-					propertyKey, serviceReference.getProperty(propertyKey));
-			}
-
-			properties.put(
-				"CXF_ENDPOINT_ADDRESS",
-				serviceReference.getProperty("osgi.jaxrs.application.base").
-					toString());
-
-			CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator =
-				new CXFJaxRsServiceRegistrator(_bus, application, properties);
-
-			return new Tracked(
-				cxfJaxRsServiceRegistrator, application,
-				_bundleContext.registerService(
-					CXFJaxRsServiceRegistrator.class,
-					cxfJaxRsServiceRegistrator, new Hashtable<>(properties)));
-		}
-		catch (Exception e) {
-			_bundleContext.ungetService(serviceReference);
-
-			throw e;
-		}
-	}
-
-	@Override
-	public void modifiedService(
-		ServiceReference<Application> serviceReference, Tracked tracked) {
-
-		removedService(serviceReference, tracked);
-
-		addingService(serviceReference);
-	}
-
-	@Override
-	public void removedService(
-		ServiceReference<Application> reference, Tracked tracked) {
-
-		_bundleContext.ungetService(reference);
-
-		tracked.getCxfJaxRsServiceRegistrator().close();
-
-		tracked.getCxfJaxRsServiceRegistratorServiceRegistration().unregister();
-	}
-
-	public static class Tracked {
-
-		private final CXFJaxRsServiceRegistrator _cxfJaxRsServiceRegistrator;
-		private final Application _application;
-		private final ServiceRegistration<CXFJaxRsServiceRegistrator>
-			_cxfJaxRsServiceRegistratorServiceRegistration;
-
-		public Application getApplication() {
-			return _application;
-		}
-
-		public CXFJaxRsServiceRegistrator getCxfJaxRsServiceRegistrator() {
-			return _cxfJaxRsServiceRegistrator;
-		}
-
-		public ServiceRegistration<CXFJaxRsServiceRegistrator>
-			getCxfJaxRsServiceRegistratorServiceRegistration() {
-
-			return _cxfJaxRsServiceRegistratorServiceRegistration;
-		}
-
-		public Tracked(
-			CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator,
-			Application application,
-			ServiceRegistration<CXFJaxRsServiceRegistrator>
-				cxfJaxRsServiceRegistratorServiceRegistration) {
-
-			_cxfJaxRsServiceRegistrator = cxfJaxRsServiceRegistrator;
-			_application = application;
-			_cxfJaxRsServiceRegistratorServiceRegistration =
-				cxfJaxRsServiceRegistratorServiceRegistration;
-		}
-
-	}
-}
-
-

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/BusServiceTrackerCustomizer.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/BusServiceTrackerCustomizer.java b/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/BusServiceTrackerCustomizer.java
deleted file mode 100644
index 8440196..0000000
--- a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/BusServiceTrackerCustomizer.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
- * <p>
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * <p>
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
-
-package com.liferay.portal.remote.rest.extender.internal;
-
-import org.apache.cxf.Bus;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-import javax.ws.rs.core.Application;
-import java.util.Arrays;
-import java.util.Collection;
-
-/**
- * @author Carlos Sierra Andrés
- */
-public class BusServiceTrackerCustomizer
-	implements ServiceTrackerCustomizer<Bus, Collection<ServiceTracker<?, ?>>> {
-
-	private BundleContext _bundleContext;
-
-	public BusServiceTrackerCustomizer(BundleContext bundleContext) {
-		_bundleContext = bundleContext;
-	}
-
-	@Override
-	public Collection<ServiceTracker<?, ?>>
-	addingService(ServiceReference<Bus> serviceReference) {
-
-		Bus bus = _bundleContext.getService(serviceReference);
-
-		try {
-			ServiceTracker<Application,?> applicationTracker =
-				new ServiceTracker<>(_bundleContext, getApplicationFilter(),
-					new ApplicationServiceTrackerCustomizer(
-						_bundleContext, bus));
-
-			applicationTracker.open();
-
-			ServiceTracker<Object, ?> singletonsServiceTracker =
-				new ServiceTracker<>(_bundleContext, getSingletonsFilter(),
-					new SingletonServiceTrackerCustomizer(_bundleContext, bus));
-
-			singletonsServiceTracker.open();
-
-			ServiceTracker<Object, ?> filtersAndInterceptorsServiceTracker =
-				new ServiceTracker<>(_bundleContext, getFiltersFilter(),
-					new FiltersAndInterceptorsServiceTrackerCustomizer(
-						_bundleContext));
-
-			filtersAndInterceptorsServiceTracker.open();
-
-			return Arrays.asList(applicationTracker, singletonsServiceTracker);
-		}
-		catch (InvalidSyntaxException ise) {
-			throw new RuntimeException(ise);
-		}
-		catch (Exception e) {
-			_bundleContext.ungetService(serviceReference);
-
-			throw e;
-		}
-	}
-
-	private Filter getFiltersFilter() throws InvalidSyntaxException {
-		return _bundleContext.createFilter("(osgi.jaxrs.filter.base=*)");
-	}
-
-	private Filter getApplicationFilter() throws InvalidSyntaxException {
-		return _bundleContext.createFilter(
-			"(&(objectClass=" + Application.class.getName() + ")" +
-				"(osgi.jaxrs.application.base=*))");
-	}
-
-	private Filter getSingletonsFilter() throws InvalidSyntaxException {
-		return _bundleContext.createFilter("(osgi.jaxrs.resource.base=*)");
-	}
-
-	@Override
-	public void modifiedService(
-		ServiceReference<Bus> reference,
-		Collection<ServiceTracker<?, ?>> serviceTrackers) {
-
-		removedService(reference, serviceTrackers);
-
-		addingService(reference);
-	}
-
-	@Override
-	public void removedService(
-		ServiceReference<Bus> serviceReference,
-		Collection<ServiceTracker<?, ?>> serviceTrackers) {
-
-		_bundleContext.ungetService(serviceReference);
-
-		for (ServiceTracker<?, ?> serviceTracker : serviceTrackers) {
-			serviceTracker.close();
-		}
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/CXFJaxRsServiceRegistrator.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/CXFJaxRsServiceRegistrator.java b/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/CXFJaxRsServiceRegistrator.java
deleted file mode 100644
index 7449ec8..0000000
--- a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/CXFJaxRsServiceRegistrator.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/**
- * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
-
-package com.liferay.portal.remote.rest.extender.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Map;
-
-import javax.ws.rs.core.Application;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
-import org.apache.cxf.jaxrs.provider.json.JSONProvider;
-
-/**
- * @author Carlos Sierra Andrés
- */
-public class CXFJaxRsServiceRegistrator {
-
-	public CXFJaxRsServiceRegistrator(
-		Bus bus, Application application, Map<String, Object> properties) {
-
-		_bus = bus;
-		_application = application;
-		_properties = properties;
-
-		rewire();
-	}
-
-	public void close() {
-		if (_closed) {
-			return;
-		}
-
-		if (_server != null) {
-			_server.destroy();
-		}
-
-		_closed = true;
-	}
-
-	public void addProvider(Object provider) {
-		if (_closed) {
-			return;
-		}
-
-		_providers.add(provider);
-
-		rewire();
-	}
-
-	public void addService(Object service) {
-		if (_closed) {
-			return;
-		}
-
-		_services.add(service);
-
-		rewire();
-	}
-
-	public void removeProvider(Object provider) {
-		if (_closed) {
-			return;
-		}
-
-		_providers.remove(provider);
-
-		rewire();
-	}
-
-	public void removeService(Object service) {
-		if (_closed) {
-			return;
-		}
-
-		_services.remove(service);
-
-		rewire();
-	}
-
-	protected synchronized void rewire() {
-		if (_server != null) {
-			_server.destroy();
-		}
-
-		RuntimeDelegate runtimeDelegate = RuntimeDelegate.getInstance();
-
-		JAXRSServerFactoryBean jaxRsServerFactoryBean =
-			runtimeDelegate.createEndpoint(
-				_application, JAXRSServerFactoryBean.class);
-
-		jaxRsServerFactoryBean.setBus(_bus);
-		jaxRsServerFactoryBean.setProperties(_properties);
-
-		JSONProvider<Object> jsonProvider = new JSONProvider<>();
-
-		jsonProvider.setDropCollectionWrapperElement(true);
-		jsonProvider.setDropRootElement(true);
-		jsonProvider.setSerializeAsArray(true);
-		jsonProvider.setSupportUnwrapped(true);
-
-		jaxRsServerFactoryBean.setProvider(jsonProvider);
-
-		for (Object provider : _providers) {
-			jaxRsServerFactoryBean.setProvider(provider);
-		}
-
-		for (Object service : _services) {
-			jaxRsServerFactoryBean.setResourceProvider(
-				new SingletonResourceProvider(service, true));
-		}
-
-		String address = _properties.get("CXF_ENDPOINT_ADDRESS").toString();
-
-		if (address != null) {
-			jaxRsServerFactoryBean.setAddress(address);
-		}
-
-		_server = jaxRsServerFactoryBean.create();
-
-		_server.start();
-	}
-
-	private volatile boolean _closed = false;
-	private final Application _application;
-	private final Bus _bus;
-	private final Map<String, Object> _properties;
-	private final Collection<Object> _providers = new ArrayList<>();
-	private Server _server;
-	private final Collection<Object> _services = new ArrayList<>();
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/FiltersAndInterceptorsServiceTrackerCustomizer.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/FiltersAndInterceptorsServiceTrackerCustomizer.java b/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/FiltersAndInterceptorsServiceTrackerCustomizer.java
deleted file mode 100644
index 07e8c7a..0000000
--- a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/FiltersAndInterceptorsServiceTrackerCustomizer.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
- * <p>
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * <p>
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
-
-package com.liferay.portal.remote.rest.extender.internal;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-/**
- * @author Carlos Sierra Andrés
- */
-public class FiltersAndInterceptorsServiceTrackerCustomizer
-	implements ServiceTrackerCustomizer<Object, ServiceTracker<?, ?>> {
-
-	private BundleContext _bundleContext;
-
-	public FiltersAndInterceptorsServiceTrackerCustomizer(
-		BundleContext bundleContext) {
-
-		_bundleContext = bundleContext;
-	}
-
-	@Override
-	public ServiceTracker<?, ?> addingService(final ServiceReference<Object> reference) {
-		final String filterBase =
-			reference.getProperty("osgi.jaxrs.filter.base").toString();
-
-		final Object service = _bundleContext.getService(reference);
-
-		ServiceTracker<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator> serviceTracker = new ServiceTracker<>(
-			_bundleContext, CXFJaxRsServiceRegistrator.class,
-			new ServiceTrackerCustomizer
-				<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>() {
-
-				@Override
-				public CXFJaxRsServiceRegistrator addingService(
-					ServiceReference<CXFJaxRsServiceRegistrator> cxfReference) {
-
-					Object resourceBaseObject =
-						cxfReference.getProperty("CXF_ENDPOINT_ADDRESS");
-
-					if (resourceBaseObject == null) {
-						return null;
-					}
-
-					String resourceBase = resourceBaseObject.toString();
-
-					if (resourceBase.startsWith(filterBase)) {
-						CXFJaxRsServiceRegistrator serviceRegistrator =
-							_bundleContext.getService(cxfReference);
-						try {
-							serviceRegistrator.addProvider(service);
-
-							return serviceRegistrator;
-						}
-						finally {
-							_bundleContext.ungetService(reference);
-						}
-					}
-
-					return null;
-				}
-
-				@Override
-				public void modifiedService(
-					ServiceReference<CXFJaxRsServiceRegistrator> reference,
-					CXFJaxRsServiceRegistrator service) {
-
-					removedService(reference, service);
-					addingService(reference);
-				}
-
-				@Override
-				public void removedService(
-					ServiceReference<CXFJaxRsServiceRegistrator> reference,
-					CXFJaxRsServiceRegistrator service) {
-
-					CXFJaxRsServiceRegistrator serviceRegistrator =
-						_bundleContext.getService(reference);
-					try {
-						serviceRegistrator.removeProvider(service);
-					}
-					finally {
-						_bundleContext.ungetService(reference);
-					}
-				}
-			});
-
-		serviceTracker.open();
-
-		return serviceTracker;
-	}
-
-	@Override
-	public void modifiedService(
-		ServiceReference<Object> reference, ServiceTracker<?, ?> serviceTracker) {
-
-		removedService(reference, serviceTracker);
-		addingService(reference);
-	}
-
-	@Override
-	public void removedService(
-		ServiceReference<Object> reference, ServiceTracker<?, ?> serviceTracker) {
-
-		_bundleContext.ungetService(reference);
-
-		serviceTracker.close();
-	}
-}

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ServicesServiceTrackerCustomizer.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ServicesServiceTrackerCustomizer.java b/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ServicesServiceTrackerCustomizer.java
deleted file mode 100644
index 433f70c..0000000
--- a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/ServicesServiceTrackerCustomizer.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
- * <p>
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * <p>
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
-
-package com.liferay.portal.remote.rest.extender.internal;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.wiring.BundleWiring;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-/**
- * @author Carlos Sierra Andrés
- */
-public class ServicesServiceTrackerCustomizer
-	implements ServiceTrackerCustomizer
-		<Object, ServiceTracker
-			<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>> {
-
-	private final BundleContext _bundleContext;
-
-	public ServicesServiceTrackerCustomizer(BundleContext bundleContext) {
-		_bundleContext = bundleContext;
-	}
-
-	@Override
-	public ServiceTracker
-		<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>
-	addingService(ServiceReference<Object> reference) {
-
-		String applicationSelector =
-			reference.getProperty("jaxrs.application.select").toString();
-
-		Bundle bundle = reference.getBundle();
-
-		BundleWiring bundleWiring = bundle.adapt(BundleWiring.class);
-
-		ClassLoader classLoader = bundleWiring.getClassLoader();
-
-		Object service = _bundleContext.getService(reference);
-
-		try {
-			Filter filter = _bundleContext.createFilter(
-				"(&(objectClass=" + CXFJaxRsServiceRegistrator.class.getName() + ")" +
-					applicationSelector + ")");
-
-			ServiceTracker
-				<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>
-				serviceTracker = new ServiceTracker<>(
-					_bundleContext, filter,
-					new AddonsServiceTrackerCustomizer(
-						_bundleContext, classLoader,
-						service));
-
-			serviceTracker.open();
-
-			return serviceTracker;
-		}
-		catch (InvalidSyntaxException ise) {
-			_bundleContext.ungetService(reference);
-
-			throw new RuntimeException(ise);
-		}
-	}
-
-	@Override
-	public void modifiedService(
-		ServiceReference<Object> reference,
-		ServiceTracker
-			<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>
-			serviceTracker) {
-
-		removedService(reference, serviceTracker);
-
-		addingService(reference);
-	}
-
-	@Override
-	public void removedService(
-		ServiceReference<Object> reference,
-		ServiceTracker
-			<CXFJaxRsServiceRegistrator, CXFJaxRsServiceRegistrator>
-			serviceTracker) {
-
-		serviceTracker.close();
-
-		_bundleContext.ungetService(reference);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/SingletonServiceTrackerCustomizer.java
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/SingletonServiceTrackerCustomizer.java b/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/SingletonServiceTrackerCustomizer.java
deleted file mode 100644
index 8645504..0000000
--- a/org.apache.aries.rest.extender/src/main/java/com/liferay/portal/remote/rest/extender/internal/SingletonServiceTrackerCustomizer.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
- * <p>
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * <p>
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- */
-
-package com.liferay.portal.remote.rest.extender.internal;
-
-import org.apache.cxf.Bus;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-import javax.ws.rs.core.Application;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author Carlos Sierra Andrés
- */
-class SingletonServiceTrackerCustomizer
-	implements ServiceTrackerCustomizer
-		<Object, SingletonServiceTrackerCustomizer.Tracked> {
-
-	private BundleContext _bundleContext;
-	private Bus _bus;
-
-	public SingletonServiceTrackerCustomizer(
-		BundleContext bundleContext, Bus bus) {
-
-		_bundleContext = bundleContext;
-		_bus = bus;
-	}
-
-	@Override
-	public Tracked addingService(
-		ServiceReference<Object> serviceReference) {
-
-		final Object service = _bundleContext.getService(
-			serviceReference);
-
-		try {
-			String[] propertyKeys = serviceReference.getPropertyKeys();
-
-			Map<String, Object> properties = new HashMap<>(
-				propertyKeys.length);
-
-			for (String propertyKey : propertyKeys) {
-				if (propertyKey.equals("osgi.jaxrs.resource.base")) {
-					continue;
-				}
-				properties.put(
-					propertyKey, serviceReference.getProperty(propertyKey));
-			}
-
-			properties.put(
-				"CXF_ENDPOINT_ADDRESS",
-				serviceReference.getProperty("osgi.jaxrs.resource.base").
-					toString());
-
-			CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator =
-				new CXFJaxRsServiceRegistrator(
-					_bus,
-					new Application() {
-						@Override
-						public Set<Object> getSingletons() {
-							return Collections.singleton(service);
-						}
-					},
-					properties);
-
-			return new Tracked(
-				cxfJaxRsServiceRegistrator, service,
-				_bundleContext.registerService(
-					CXFJaxRsServiceRegistrator.class,
-					cxfJaxRsServiceRegistrator, new Hashtable<>(properties)));
-		}
-		catch (Exception e) {
-			_bundleContext.ungetService(serviceReference);
-
-			throw e;
-		}
-	}
-
-	@Override
-	public void modifiedService(
-		ServiceReference<Object> serviceReference, Tracked tracked) {
-
-		removedService(serviceReference, tracked);
-
-		addingService(serviceReference);
-	}
-
-	@Override
-	public void removedService(
-		ServiceReference<Object> reference, Tracked tracked) {
-
-		_bundleContext.ungetService(reference);
-
-		Object service = tracked.getService();
-
-		CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator =
-			tracked.getCxfJaxRsServiceRegistrator();
-
-		cxfJaxRsServiceRegistrator.close();
-
-		tracked.getCxfJaxRsServiceRegistratorServiceRegistration().unregister();
-	}
-
-	public static class Tracked {
-
-		private final CXFJaxRsServiceRegistrator _cxfJaxRsServiceRegistrator;
-		private final Object _service;
-		private final ServiceRegistration<CXFJaxRsServiceRegistrator>
-			_cxfJaxRsServiceRegistratorServiceRegistration;
-
-		public Object getService() {
-			return _service;
-		}
-
-		public CXFJaxRsServiceRegistrator getCxfJaxRsServiceRegistrator() {
-			return _cxfJaxRsServiceRegistrator;
-		}
-
-		public ServiceRegistration<CXFJaxRsServiceRegistrator>
-			getCxfJaxRsServiceRegistratorServiceRegistration() {
-
-			return _cxfJaxRsServiceRegistratorServiceRegistration;
-		}
-
-		public Tracked(
-			CXFJaxRsServiceRegistrator cxfJaxRsServiceRegistrator,
-			Object service,
-			ServiceRegistration<CXFJaxRsServiceRegistrator>
-				cxfJaxRsServiceRegistratorServiceRegistration) {
-
-			_cxfJaxRsServiceRegistrator = cxfJaxRsServiceRegistrator;
-			_service = service;
-			_cxfJaxRsServiceRegistratorServiceRegistration =
-				cxfJaxRsServiceRegistratorServiceRegistration;
-		}
-
-	}
-
-}
-
-

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language.properties
deleted file mode 100644
index ff2b883..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_ar.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_ar.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_ar.properties
deleted file mode 100644
index f7ddde5..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_ar.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=بقية موسع (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_bg.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_bg.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_bg.properties
deleted file mode 100644
index 93f99d3..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_bg.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=ПОЧИВКА Extender (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_ca.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_ca.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_ca.properties
deleted file mode 100644
index 9476a3e..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_ca.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=Amplificador REST
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_cs.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_cs.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_cs.properties
deleted file mode 100644
index 76bc497..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_cs.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=OSTATNÍ zařízení Extender (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_da.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_da.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_da.properties
deleted file mode 100644
index 9b885db..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_da.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=RESTEN Extender (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_de.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_de.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_de.properties
deleted file mode 100644
index ff2b883..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_de.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_el.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_el.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_el.properties
deleted file mode 100644
index 1fd60a7..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_el.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=ΥΠΌΛΟΙΠΟ αραίωσης (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_en.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_en.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_en.properties
deleted file mode 100644
index ff2b883..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_en.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_es.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_es.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_es.properties
deleted file mode 100644
index cc489da..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_es.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=Extensor REST
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_et.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_et.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_et.properties
deleted file mode 100644
index 824e6e1..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_et.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=ÜLEJÄÄNUD Extender (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_eu.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_eu.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_eu.properties
deleted file mode 100644
index e82a9e0..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_eu.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender (Automatic Copy)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_fa.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_fa.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_fa.properties
deleted file mode 100644
index 64e00d0..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_fa.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=گسترش دهنده REST
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_fi.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_fi.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_fi.properties
deleted file mode 100644
index d0e0a1d..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_fi.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST laajennin
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_fr.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_fr.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_fr.properties
deleted file mode 100644
index 52e43d9..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_fr.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=Extendeur REST
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_gl.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_gl.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_gl.properties
deleted file mode 100644
index e82a9e0..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_gl.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender (Automatic Copy)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_hi_IN.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_hi_IN.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_hi_IN.properties
deleted file mode 100644
index 340d552..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_hi_IN.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=बाकी भरनेवाला (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_hr.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_hr.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_hr.properties
deleted file mode 100644
index e82a9e0..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_hr.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender (Automatic Copy)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_hu.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_hu.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_hu.properties
deleted file mode 100644
index cdc65c6..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_hu.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST kiterjesztő
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_in.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_in.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_in.properties
deleted file mode 100644
index b60839d..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_in.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=SISANYA Extender (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_it.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_it.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_it.properties
deleted file mode 100644
index ff2b883..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_it.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_iw.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_iw.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_iw.properties
deleted file mode 100644
index 667e11d..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_iw.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=מאריך REST
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_ja.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_ja.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_ja.properties
deleted file mode 100644
index ff2b883..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_ja.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_ko.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_ko.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_ko.properties
deleted file mode 100644
index 3b3ecce..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_ko.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=나머지 익스텐더 (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_lo.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_lo.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_lo.properties
deleted file mode 100644
index e82a9e0..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_lo.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender (Automatic Copy)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_lt.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_lt.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_lt.properties
deleted file mode 100644
index 4f37958..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_lt.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=POILSIO plėstuvo (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_nb.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_nb.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_nb.properties
deleted file mode 100644
index 9b885db..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_nb.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=RESTEN Extender (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_nl.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_nl.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_nl.properties
deleted file mode 100644
index b62adc9..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_nl.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST-extenders
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_nl_BE.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_nl_BE.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_nl_BE.properties
deleted file mode 100644
index d137e77..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_nl_BE.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=REST Extender (Automatic Translation)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/17c51be0/org.apache.aries.rest.extender/src/main/resources/content/Language_pl.properties
----------------------------------------------------------------------
diff --git a/org.apache.aries.rest.extender/src/main/resources/content/Language_pl.properties b/org.apache.aries.rest.extender/src/main/resources/content/Language_pl.properties
deleted file mode 100644
index 0055a27..0000000
--- a/org.apache.aries.rest.extender/src/main/resources/content/Language_pl.properties
+++ /dev/null
@@ -1 +0,0 @@
-rest.extender.configuration.name=RESZTA Extender (Automatic Translation)
\ No newline at end of file


Mime
View raw message