http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/FilterHelper.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/FilterHelper.java b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/FilterHelper.java deleted file mode 100644 index 3739f16..0000000 --- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/FilterHelper.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.osgi.framework.Constants; - -public final class FilterHelper { - private static final String OBJECTCLASS_EXPRESSION = ".*\\(" + Constants.OBJECTCLASS + "=([a-zA-Z_0-9.]+)\\).*"; - private static final Pattern OBJECTCLASS_PATTERN = Pattern.compile(OBJECTCLASS_EXPRESSION); - - private FilterHelper() { - // prevent instantiation - } - - public static String getObjectClass(String filter) { - if (filter != null) { - Matcher matcher = OBJECTCLASS_PATTERN.matcher(filter); - if (matcher.matches() && matcher.groupCount() >= 1) { - return matcher.group(1); - } - } - return null; - } -}
http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java deleted file mode 100644 index 03ec9da..0000000 --- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.framework.hooks.service.ListenerHook; -import org.osgi.service.remoteserviceadmin.RemoteConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Listens for service listeners and informs ServiceInterestListener about added and removed interest - * in services - */ -public class ListenerHookImpl implements ListenerHook { - - private static final Logger LOG = LoggerFactory.getLogger(ListenerHookImpl.class); - - // From the old impl. - private static final Set<String> SYSTEM_PACKAGES; - static { - SYSTEM_PACKAGES = new HashSet<String>(); - SYSTEM_PACKAGES.add("org.osgi.service"); - SYSTEM_PACKAGES.add("org.apache.felix"); - SYSTEM_PACKAGES.add("org.ops4j.pax.logging"); - SYSTEM_PACKAGES.add("ch.ethz.iks.slp"); - SYSTEM_PACKAGES.add("org.ungoverned.osgi.service"); - SYSTEM_PACKAGES.add("org.springframework.osgi.context.event.OsgiBundleApplicationContextListener"); - SYSTEM_PACKAGES.add("java.net.ContentHandler"); - } - - private final BundleContext bctx; - private final ServiceInterestListener serviceInterestListener; - private final String frameworkUUID; - - public ListenerHookImpl(BundleContext bc, ServiceInterestListener serviceInterestListener) { - this.bctx = bc; - this.frameworkUUID = bctx.getProperty(Constants.FRAMEWORK_UUID); - this.serviceInterestListener = serviceInterestListener; - } - - @Override - public void added(Collection<ListenerInfo> listeners) { - LOG.debug("added listeners {}", listeners); - for (ListenerInfo listenerInfo : listeners) { - LOG.debug("Filter {}", listenerInfo.getFilter()); - - String className = FilterHelper.getObjectClass(listenerInfo.getFilter()); - - if (listenerInfo.getBundleContext().equals(bctx)) { - LOG.debug("ListenerHookImpl: skipping request from myself"); - continue; - } - - if (listenerInfo.getFilter() == null) { - LOG.debug("skipping empty filter"); - continue; - } - - if (isClassExcluded(className)) { - LOG.debug("Skipping import request for excluded class [{}]", className); - continue; - } - String exFilter = extendFilter(listenerInfo.getFilter()); - serviceInterestListener.addServiceInterest(exFilter); - } - } - - @Override - public void removed(Collection<ListenerInfo> listeners) { - LOG.debug("removed listeners {}", listeners); - - for (ListenerInfo listenerInfo : listeners) { - LOG.debug("Filter {}", listenerInfo.getFilter()); - - // TODO: determine if service was handled? - String exFilter = extendFilter(listenerInfo.getFilter()); - serviceInterestListener.removeServiceInterest(exFilter); - } - } - - private static boolean isClassExcluded(String className) { - if (className == null) { - return true; - } - - for (String p : SYSTEM_PACKAGES) { - if (className.startsWith(p)) { - return true; - } - } - return false; - } - - String extendFilter(String filter) { - return "(&" + filter + "(!(" + RemoteConstants.ENDPOINT_FRAMEWORK_UUID + "=" + frameworkUUID + ")))"; - } -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/RSATracker.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/RSATracker.java b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/RSATracker.java deleted file mode 100644 index 56e98e8..0000000 --- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/RSATracker.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin; - -public interface RSATracker { - void added(RemoteServiceAdmin rsa); - void removed(RemoteServiceAdmin rsa); -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ReferenceCounter.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ReferenceCounter.java b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ReferenceCounter.java deleted file mode 100644 index 6ecff31..0000000 --- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ReferenceCounter.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -/** - * Manages a reference count per key. - * - * @param <K> the key type - */ -public class ReferenceCounter<K> { - - private final ConcurrentMap<K, Integer> counts = new ConcurrentHashMap<K, Integer>(); - - /** - * Increases the reference count for the given key, - * or sets it to 1 if the key has no existing count. - * - * @param key a key - * @return the updated reference count - */ - public int add(K key) { - while (true) { - Integer count = counts.get(key); - if (count == null) { - if (counts.putIfAbsent(key, 1) == null) { - return 1; - } - } else if (counts.replace(key, count, count + 1)) { - return count + 1; - } - } - } - - /** - * Decreases the reference count for the given key, - * and removes it if it reaches 0. - * If the key has no existing count, -1 is returned. - * - * @param key a key - * @return the updated reference count, or -1 if the key has no existing count - */ - public int remove(K key) { - while (true) { - Integer count = counts.get(key); - if (count == null) { - return -1; - } - if (count == 1) { - if (counts.remove(key, 1)) { - return 0; - } - } else if (counts.replace(key, count, count - 1)) { - return count - 1; - } - } - } -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java deleted file mode 100644 index f4db92e..0000000 --- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -public interface ServiceInterestListener { - - void addServiceInterest(String filter); - - void removeServiceInterest(String filter); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java b/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java deleted file mode 100644 index 30fe4c2..0000000 --- a/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java +++ /dev/null @@ -1,345 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.osgi.framework.BundleContext; -import org.osgi.framework.hooks.service.ListenerHook; -import org.osgi.service.remoteserviceadmin.EndpointDescription; -import org.osgi.service.remoteserviceadmin.EndpointListener; -import org.osgi.service.remoteserviceadmin.ImportReference; -import org.osgi.service.remoteserviceadmin.ImportRegistration; -import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin; -import org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent; -import org.osgi.service.remoteserviceadmin.RemoteServiceAdminListener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Listens for remote endpoints using the EndpointListener interface and the EndpointListenerManager. - * Listens for local service interests using the ListenerHookImpl that calls back through the - * ServiceInterestListener interface. - * Manages local creation and destruction of service imports using the available RemoteServiceAdmin services. - */ -public class TopologyManagerImport implements EndpointListener, RemoteServiceAdminListener, ServiceInterestListener { - - private static final Logger LOG = LoggerFactory.getLogger(TopologyManagerImport.class); - private ExecutorService execService; - - private final EndpointListenerManager endpointListenerManager; - private final BundleContext bctx; - private Set<RemoteServiceAdmin> rsaSet; - private final ListenerHookImpl listenerHook; - - /** - * If set to false only one service is imported for each import interest even it multiple services are - * available. If set to true, all available services are imported. - * - * TODO: Make this available as a configuration option - */ - private boolean importAllAvailable = true; - - /** - * Contains an instance of the Class Import Interest for each distinct import request. If the same filter - * is requested multiple times the existing instance of the Object increments an internal reference - * counter. If an interest is removed, the related ServiceInterest object is used to reduce the reference - * counter until it reaches zero. in this case the interest is removed. - */ - private final ReferenceCounter<String> importInterestsCounter = new ReferenceCounter<String>(); - - /** - * List of Endpoints by matched filter that were reported by the EndpointListener and can be imported - */ - private final Map<String /* filter */, List<EndpointDescription>> importPossibilities - = new HashMap<String, List<EndpointDescription>>(); - - /** - * List of already imported Endpoints by their matched filter - */ - private final Map<String /* filter */, List<ImportRegistration>> importedServices - = new HashMap<String, List<ImportRegistration>>(); - - - public TopologyManagerImport(BundleContext bc) { - this.rsaSet = new HashSet<RemoteServiceAdmin>(); - bctx = bc; - endpointListenerManager = new EndpointListenerManager(bctx, this); - execService = new ThreadPoolExecutor(5, 10, 50, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); - listenerHook = new ListenerHookImpl(bc, this); - } - - public void start() { - bctx.registerService(RemoteServiceAdminListener.class, this, null); - bctx.registerService(ListenerHook.class, listenerHook, null); - endpointListenerManager.start(); - } - - public void stop() { - endpointListenerManager.stop(); - execService.shutdown(); - // this is called from Activator.stop(), which implicitly unregisters our registered services - } - - /* (non-Javadoc) - * @see org.apache.cxf.dosgi.topologymanager.ServiceInterestListener#addServiceInterest(java.lang.String) - */ - public void addServiceInterest(String filter) { - if (importInterestsCounter.add(filter) == 1) { - endpointListenerManager.extendScope(filter); - } - } - - /* (non-Javadoc) - * @see org.apache.cxf.dosgi.topologymanager.ServiceInterestListener#removeServiceInterest(java.lang.String) - */ - public void removeServiceInterest(String filter) { - if (importInterestsCounter.remove(filter) == 0) { - LOG.debug("last reference to import interest is gone -> removing interest filter: {}", filter); - endpointListenerManager.reduceScope(filter); - synchronized (importedServices) { - List<ImportRegistration> irs = importedServices.remove(filter); - if (irs != null) { - for (ImportRegistration ir : irs) { - ir.close(); - } - } - } - } - } - - public void endpointAdded(EndpointDescription endpoint, String filter) { - if (filter == null) { - LOG.error("Endpoint is not handled because no matching filter was provided!"); - return; - } - LOG.debug("importable service added for filter {}, endpoint {}", filter, endpoint); - addImportPossibility(endpoint, filter); - triggerImport(filter); - } - - public void endpointRemoved(EndpointDescription endpoint, String filter) { - LOG.debug("EndpointRemoved {}", endpoint); - removeImportPossibility(endpoint, filter); - triggerImport(filter); - } - - private void addImportPossibility(EndpointDescription endpoint, String filter) { - synchronized (importPossibilities) { - List<EndpointDescription> endpoints = importPossibilities.get(filter); - if (endpoints == null) { - endpoints = new ArrayList<EndpointDescription>(); - importPossibilities.put(filter, endpoints); - } - // prevent adding the same endpoint multiple times, which can happen sometimes, - // and which causes imports to remain available even when services are actually down - if (!endpoints.contains(endpoint)) { - endpoints.add(endpoint); - } - } - } - - private void removeImportPossibility(EndpointDescription endpoint, String filter) { - synchronized (importPossibilities) { - List<EndpointDescription> endpoints = importPossibilities.get(filter); - if (endpoints != null) { - endpoints.remove(endpoint); - if (endpoints.isEmpty()) { - importPossibilities.remove(filter); - } - } - } - } - - public void add(RemoteServiceAdmin rsa) { - rsaSet.add(rsa); - synchronized (importPossibilities) { - for (String filter : importPossibilities.keySet()) { - triggerImport(filter); - } - } - } - - public void remove(RemoteServiceAdmin rsa) { - rsaSet.remove(rsa); - } - - - private void triggerImport(final String filter) { - LOG.debug("Import of a service for filter {} was queued", filter); - - execService.execute(new Runnable() { - public void run() { - try { - unexportNotAvailableServices(filter); - importServices(filter); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - // Notify EndpointListeners? NO! - } - }); - } - - private void unexportNotAvailableServices(String filter) { - synchronized (importedServices) { - List<ImportRegistration> importRegistrations = importedServices.get(filter); - if (importRegistrations != null) { - // iterate over a copy - for (ImportRegistration ir : new ArrayList<ImportRegistration>(importRegistrations)) { - EndpointDescription endpoint = ir.getImportReference().getImportedEndpoint(); - if (!isImportPossibilityAvailable(endpoint, filter)) { - removeImport(ir, null); // also unexports the service - } - } - } - } - } - - private boolean isImportPossibilityAvailable(EndpointDescription endpoint, String filter) { - synchronized (importPossibilities) { - List<EndpointDescription> endpoints = importPossibilities.get(filter); - return endpoints != null && endpoints.contains(endpoint); - } - } - - // return a copy to prevent sync issues - private List<EndpointDescription> getImportPossibilitiesCopy(String filter) { - synchronized (importPossibilities) { - List<EndpointDescription> possibilities = importPossibilities.get(filter); - return possibilities == null - ? Collections.<EndpointDescription>emptyList() - : new ArrayList<EndpointDescription>(possibilities); - } - } - - private void importServices(String filter) { - synchronized (importedServices) { - List<ImportRegistration> importRegistrations = importedServices.get(filter); - for (EndpointDescription endpoint : getImportPossibilitiesCopy(filter)) { - // TODO but optional: if the service is already imported and the endpoint is still - // in the list of possible imports check if a "better" endpoint is now in the list - if (!alreadyImported(endpoint, importRegistrations)) { - // service not imported yet -> import it now - ImportRegistration ir = importService(endpoint); - if (ir != null) { - // import was successful - if (importRegistrations == null) { - importRegistrations = new ArrayList<ImportRegistration>(); - importedServices.put(filter, importRegistrations); - } - importRegistrations.add(ir); - if (!importAllAvailable) { - return; - } - } - } - } - } - } - - private boolean alreadyImported(EndpointDescription endpoint, List<ImportRegistration> importRegistrations) { - if (importRegistrations != null) { - for (ImportRegistration ir : importRegistrations) { - if (endpoint.equals(ir.getImportReference().getImportedEndpoint())) { - return true; - } - } - } - return false; - } - - /** - * Tries to import the service with each rsa until one import is successful - * - * @param endpoint endpoint to import - * @return import registration of the first successful import - */ - private ImportRegistration importService(EndpointDescription endpoint) { - for (RemoteServiceAdmin rsa : rsaSet) { - ImportRegistration ir = rsa.importService(endpoint); - if (ir != null) { - if (ir.getException() == null) { - LOG.debug("Service import was successful {}", ir); - return ir; - } else { - LOG.info("Error importing service " + endpoint, ir.getException()); - } - } - } - return null; - } - - /** - * Remove and close (unexport) the given import. The import is specified either - * by its ImportRegistration or by its ImportReference (only one of them must - * be specified). - * <p> - * If this method is called from within iterations on the underlying data structure, - * the iterations must be made on copies of the structures rather than the original - * references in order to prevent ConcurrentModificationExceptions. - * - * @param reg the import registration to remove - * @param ref the import reference to remove - */ - private void removeImport(ImportRegistration reg, ImportReference ref) { - // this method may be called recursively by calling ImportRegistration.close() - // and receiving a RemoteServiceAdminEvent for its unregistration, which results - // in a ConcurrentModificationException. We avoid this by closing the registrations - // only after data structure manipulation is done, and being re-entrant. - synchronized (importedServices) { - List<ImportRegistration> removed = new ArrayList<ImportRegistration>(); - for (Iterator<List<ImportRegistration>> it1 = importedServices.values().iterator(); it1.hasNext();) { - Collection<ImportRegistration> irs = it1.next(); - for (Iterator<ImportRegistration> it2 = irs.iterator(); it2.hasNext();) { - ImportRegistration ir = it2.next(); - if (ir.equals(reg) || ir.getImportReference().equals(ref)) { - removed.add(ir); - it2.remove(); - } - } - if (irs.isEmpty()) { - it1.remove(); - } - } - for (ImportRegistration ir : removed) { - ir.close(); - } - } - } - - public void remoteAdminEvent(RemoteServiceAdminEvent event) { - if (event.getType() == RemoteServiceAdminEvent.IMPORT_UNREGISTRATION) { - removeImport(null, event.getImportReference()); - } - } - -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/ActivatorTest.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/ActivatorTest.java b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/ActivatorTest.java deleted file mode 100644 index 100e3a3..0000000 --- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/ActivatorTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager; - -import org.apache.cxf.dosgi.topologymanager.exporter.DefaultExportPolicy; -import org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport; -import org.easymock.Capture; -import org.easymock.EasyMock; -import org.easymock.IAnswer; -import org.easymock.IMocksControl; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.framework.Filter; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; - -public class ActivatorTest { - - @Test - public void testStart() throws Exception { - IMocksControl c = EasyMock.createNiceControl(); - BundleContext context = c.createMock(BundleContext.class); - EasyMock.expect(context.getProperty(Constants.FRAMEWORK_UUID)).andReturn("myid"); - context.addServiceListener(EasyMock.isA(TopologyManagerExport.class)); - EasyMock.expectLastCall(); - final Capture<String> filter = EasyMock.newCapture(); - EasyMock.expect(context.createFilter(EasyMock.capture(filter))) - .andAnswer(new IAnswer<Filter>() { - public Filter answer() throws Throwable { - return FrameworkUtil.createFilter(filter.getValue()); - } - }).times(2); - ServiceReference<?> sref = c.createMock(ServiceReference.class); - Bundle bundle = c.createMock(Bundle.class); - EasyMock.expect(sref.getBundle()).andReturn(bundle).anyTimes(); - EasyMock.expect(context.getServiceReferences((String)null, Activator.DOSGI_SERVICES)) - .andReturn(new ServiceReference[]{sref}); - - c.replay(); - Activator activator = new Activator(); - activator.doStart(context, new DefaultExportPolicy()); - c.verify(); - - c.reset(); - c.replay(); - activator.doStop(context); - c.verify(); - } - -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java deleted file mode 100644 index 04bd017..0000000 --- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.exporter; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Dictionary; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.easymock.EasyMock; -import org.junit.Assert; -import org.junit.Test; -import org.osgi.framework.Filter; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceReference; -import org.osgi.service.remoteserviceadmin.EndpointDescription; -import org.osgi.service.remoteserviceadmin.EndpointListener; -import org.osgi.service.remoteserviceadmin.RemoteConstants; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; - -@SuppressWarnings({ - "rawtypes", "unchecked" - }) -public class EndpointListenerNotifierTest { - - @Test - public void testNotifyListener() throws InvalidSyntaxException { - EndpointDescription endpoint1 = createEndpoint("myClass"); - EndpointDescription endpoint2 = createEndpoint("notMyClass"); - - // Expect listener to be called for endpoint1 but not for endpoint2 - EndpointListener epl = listenerExpects(endpoint1, "(objectClass=myClass)"); - - EndpointRepository exportRepository = new EndpointRepository(); - EndpointListenerNotifier tm = new EndpointListenerNotifier(exportRepository); - - EasyMock.replay(epl); - Set<Filter> filters = new HashSet<Filter>(); - filters.add(FrameworkUtil.createFilter("(objectClass=myClass)")); - tm.add(epl, filters); - tm.endpointAdded(endpoint1, null); - tm.endpointAdded(endpoint2, null); - tm.endpointRemoved(endpoint1, null); - tm.endpointRemoved(endpoint2, null); - EasyMock.verify(epl); - } - - private EndpointListener listenerExpects(EndpointDescription endpoint, String filter) { - EndpointListener epl = EasyMock.createStrictMock(EndpointListener.class); - epl.endpointAdded(EasyMock.eq(endpoint), EasyMock.eq(filter)); - EasyMock.expectLastCall().once(); - epl.endpointRemoved(EasyMock.eq(endpoint), EasyMock.eq(filter)); - EasyMock.expectLastCall().once(); - return epl; - } - - @Test - public void testNotifyListeners() throws InvalidSyntaxException { - EndpointDescription endpoint1 = createEndpoint("myClass"); - - EndpointListener epl = EasyMock.createStrictMock(EndpointListener.class); - epl.endpointAdded(EasyMock.eq(endpoint1), EasyMock.eq("(objectClass=myClass)")); - EasyMock.expectLastCall().once(); - epl.endpointRemoved(EasyMock.eq(endpoint1), EasyMock.eq("(objectClass=myClass)")); - EasyMock.expectLastCall().once(); - - EndpointRepository exportRepository = new EndpointRepository(); - EndpointListenerNotifier tm = new EndpointListenerNotifier(exportRepository); - - EasyMock.replay(epl); - Set<Filter> filters = new HashSet<Filter>(); - filters.add(FrameworkUtil.createFilter("(objectClass=myClass)")); - tm.add(epl, filters); - tm.endpointAdded(endpoint1, null); - tm.endpointRemoved(endpoint1, null); - tm.remove(epl); - EasyMock.verify(epl); - } - - public EndpointDescription createEndpoint(String iface) { - Map<String, Object> props = new Hashtable<String, Object>(); - props.put("objectClass", new String[]{iface}); - props.put(RemoteConstants.ENDPOINT_ID, iface); - props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "any"); - return new EndpointDescription(props); - } - - @Test - public void testNormalizeScopeForSingleString() { - ServiceReference sr = createListenerServiceWithFilter("(myProp=A)"); - Set<Filter> res = EndpointListenerNotifier.getFiltersFromEndpointListenerScope(sr); - assertEquals(1, res.size()); - Filter filter = res.iterator().next(); - filterMatches(filter); - } - - @Test - public void testNormalizeScopeForStringArray() { - String[] filters = {"(myProp=A)", "(otherProp=B)"}; - ServiceReference sr = createListenerServiceWithFilter(filters); - Set<Filter> res = EndpointListenerNotifier.getFiltersFromEndpointListenerScope(sr); - assertEquals(filters.length, res.size()); - Iterator<Filter> it = res.iterator(); - Filter filter1 = it.next(); - Filter filter2 = it.next(); - Dictionary<String, String> props = new Hashtable(); - props.put("myProp", "A"); - assertThat(filter1.match(props) || filter2.match(props), is(true)); - } - - @Test - public void testNormalizeScopeForCollection() { - Collection<String> collection = Arrays.asList("(myProp=A)", "(otherProp=B)"); - ServiceReference sr = createListenerServiceWithFilter(collection); - Set<Filter> res = EndpointListenerNotifier.getFiltersFromEndpointListenerScope(sr); - Iterator<Filter> it = res.iterator(); - Filter filter1 = it.next(); - Filter filter2 = it.next(); - Dictionary<String, String> props = new Hashtable(); - props.put("myProp", "A"); - Assert.assertThat(filter1.match(props) || filter2.match(props), is(true)); - } - - private void filterMatches(Filter filter) { - Dictionary<String, String> props = new Hashtable(); - props.put("myProp", "A"); - Assert.assertTrue("Filter should match", filter.match(props)); - } - - private ServiceReference createListenerServiceWithFilter(Object filters) { - ServiceReference sr = EasyMock.createMock(ServiceReference.class); - EasyMock.expect(sr.getProperty(EndpointListener.ENDPOINT_LISTENER_SCOPE)).andReturn(filters); - EasyMock.replay(sr); - return sr; - } -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepositoryTest.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepositoryTest.java b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepositoryTest.java deleted file mode 100644 index cb07f43..0000000 --- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepositoryTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.exporter; - -import java.util.Arrays; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - -import org.easymock.EasyMock; -import org.easymock.IMocksControl; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceReference; -import org.osgi.service.remoteserviceadmin.EndpointDescription; -import org.osgi.service.remoteserviceadmin.EndpointListener; -import org.osgi.service.remoteserviceadmin.RemoteConstants; -import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin; - -public class EndpointRepositoryTest { - - @Test - public void testAddRemove() throws InvalidSyntaxException { - EndpointDescription ep1 = createEndpoint("my"); - - IMocksControl c = EasyMock.createControl(); - ServiceReference<?> sref = createService(c); - RemoteServiceAdmin rsa = c.createMock(RemoteServiceAdmin.class); - EndpointListener notifier = c.createMock(EndpointListener.class); - - notifier.endpointAdded(ep1, null); - EasyMock.expectLastCall(); - - c.replay(); - EndpointRepository repo = new EndpointRepository(); - repo.setNotifier(notifier); - List<EndpointDescription> endpoints = Arrays.asList(ep1); - repo.addEndpoints(sref, rsa, endpoints); - c.verify(); - - c.reset(); - notifier.endpointRemoved(ep1, null); - EasyMock.expectLastCall(); - - c.replay(); - repo.removeRemoteServiceAdmin(rsa); - c.verify(); - } - - private ServiceReference<?> createService(IMocksControl c) { - ServiceReference<?> sref = c.createMock(ServiceReference.class); - Bundle bundle = c.createMock(Bundle.class); - EasyMock.expect(bundle.getSymbolicName()).andReturn("myBundle"); - EasyMock.expect(sref.getBundle()).andReturn(bundle); - return sref; - } - - public EndpointDescription createEndpoint(String iface) { - Map<String, Object> props = new Hashtable<String, Object>(); - props.put("objectClass", new String[]{iface}); - props.put(RemoteConstants.ENDPOINT_ID, iface); - props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "any"); - return new EndpointDescription(props); - } -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExportTest.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExportTest.java b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExportTest.java deleted file mode 100644 index 0eda150..0000000 --- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExportTest.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.exporter; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.Executor; - -import org.apache.cxf.dosgi.dsw.api.ExportPolicy; -import org.easymock.EasyMock; -import org.easymock.IMocksControl; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.Constants; -import org.osgi.framework.ServiceEvent; -import org.osgi.framework.ServiceReference; -import org.osgi.service.remoteserviceadmin.EndpointDescription; -import org.osgi.service.remoteserviceadmin.EndpointListener; -import org.osgi.service.remoteserviceadmin.ExportReference; -import org.osgi.service.remoteserviceadmin.ExportRegistration; -import org.osgi.service.remoteserviceadmin.RemoteConstants; -import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin; - -import static org.easymock.EasyMock.expectLastCall; - -@SuppressWarnings({"rawtypes", "unchecked"}) -public class TopologyManagerExportTest { - - /** - * This tests if the topology manager handles a service marked to be exported correctly by exporting it to - * an available RemoteServiceAdmin and notifying an EndpointListener afterwards. - * - * @throws Exception - */ - @Test - public void testServiceExportUnexport() throws Exception { - IMocksControl c = EasyMock.createControl(); - RemoteServiceAdmin rsa = c.createMock(RemoteServiceAdmin.class); - final EndpointListener notifier = c.createMock(EndpointListener.class); - final ServiceReference sref = createUserService(c); - EndpointDescription epd = createEndpoint(); - expectServiceExported(c, rsa, notifier, sref, epd); - - c.replay(); - EndpointRepository endpointRepo = new EndpointRepository(); - endpointRepo.setNotifier(notifier); - Executor executor = syncExecutor(); - ExportPolicy policy = new DefaultExportPolicy(); - TopologyManagerExport exportManager = new TopologyManagerExport(endpointRepo, executor, policy); - exportManager.add(rsa); - exportManager.serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED, sref)); - c.verify(); - - c.reset(); - notifier.endpointRemoved(epd, null); - expectLastCall().once(); - c.replay(); - exportManager.serviceChanged(new ServiceEvent(ServiceEvent.UNREGISTERING, sref)); - c.verify(); - - c.reset(); - c.replay(); - exportManager.serviceChanged(new ServiceEvent(ServiceEvent.MODIFIED, sref)); - c.verify(); - - c.reset(); - c.replay(); - exportManager.remove(rsa); - c.verify(); - } - - @Test - public void testExportExisting() throws Exception { - IMocksControl c = EasyMock.createControl(); - RemoteServiceAdmin rsa = c.createMock(RemoteServiceAdmin.class); - final EndpointListenerNotifier mockEpListenerNotifier = c.createMock(EndpointListenerNotifier.class); - final ServiceReference sref = createUserService(c); - expectServiceExported(c, rsa, mockEpListenerNotifier, sref, createEndpoint()); - c.replay(); - - EndpointRepository endpointRepo = new EndpointRepository(); - endpointRepo.setNotifier(mockEpListenerNotifier); - ExportPolicy policy = new DefaultExportPolicy(); - TopologyManagerExport exportManager = new TopologyManagerExport(endpointRepo, syncExecutor(), policy); - exportManager.serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED, sref)); - exportManager.add(rsa); - c.verify(); - } - - private void expectServiceExported(IMocksControl c, RemoteServiceAdmin rsa, - final EndpointListener listener, - final ServiceReference sref, EndpointDescription epd) { - ExportRegistration exportRegistration = createExportRegistration(c, epd); - EasyMock.expect(rsa.exportService(EasyMock.same(sref), (Map<String, Object>)EasyMock.anyObject())) - .andReturn(Collections.singletonList(exportRegistration)).once(); - listener.endpointAdded(epd, null); - EasyMock.expectLastCall().once(); - } - - private Executor syncExecutor() { - return new Executor() { - @Override - public void execute(Runnable command) { - command.run(); - } - }; - } - - private ExportRegistration createExportRegistration(IMocksControl c, EndpointDescription endpoint) { - ExportRegistration exportRegistration = c.createMock(ExportRegistration.class); - ExportReference exportReference = c.createMock(ExportReference.class); - EasyMock.expect(exportRegistration.getExportReference()).andReturn(exportReference).anyTimes(); - EasyMock.expect(exportRegistration.getException()).andReturn(null).anyTimes(); - EasyMock.expect(exportReference.getExportedEndpoint()).andReturn(endpoint).anyTimes(); - return exportRegistration; - } - - private EndpointDescription createEndpoint() { - Map<String, Object> props = new HashMap<String, Object>(); - props.put(RemoteConstants.ENDPOINT_ID, "1"); - props.put(Constants.OBJECTCLASS, new String[] {"abc"}); - props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "cxf"); - return new EndpointDescription(props); - } - - private ServiceReference createUserService(IMocksControl c) { - final ServiceReference sref = c.createMock(ServiceReference.class); - EasyMock.expect(sref.getProperty(EasyMock.same(RemoteConstants.SERVICE_EXPORTED_INTERFACES))) - .andReturn("*").anyTimes(); - Bundle srefBundle = c.createMock(Bundle.class); - EasyMock.expect(sref.getBundle()).andReturn(srefBundle).atLeastOnce(); - EasyMock.expect(sref.getProperty("objectClass")).andReturn("org.My").anyTimes(); - EasyMock.expect(srefBundle.getSymbolicName()).andReturn("serviceBundleName").atLeastOnce(); - return sref; - } -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java deleted file mode 100644 index c736197..0000000 --- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -import java.util.Dictionary; -import java.util.List; - -import org.easymock.EasyMock; -import org.easymock.IAnswer; -import org.easymock.IMocksControl; -import org.junit.Assert; -import org.junit.Test; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; -import org.osgi.service.remoteserviceadmin.EndpointListener; - -public class EndpointListenerImplTest extends Assert { - - int testCase; - - @SuppressWarnings({ - "rawtypes", "unchecked" - }) - @Test - public void testScopeChange() { - IMocksControl c = EasyMock.createNiceControl(); - BundleContext bc = c.createMock(BundleContext.class); - TopologyManagerImport tm = c.createMock(TopologyManagerImport.class); - ServiceRegistration sr = c.createMock(ServiceRegistration.class); - - // expect Listener registration - EasyMock.expect(bc.registerService(EasyMock.anyObject(Class.class), - EasyMock.anyObject(), - (Dictionary)EasyMock.anyObject())).andReturn(sr).atLeastOnce(); - - sr.setProperties((Dictionary)EasyMock.anyObject()); - - // expect property changes based on later calls - EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { - - public Object answer() throws Throwable { - Object[] args = EasyMock.getCurrentArguments(); - Dictionary props = (Dictionary)args[0]; - List<String> scope = (List<String>)props.get(EndpointListener.ENDPOINT_LISTENER_SCOPE); - switch (testCase) { - case 1: - assertEquals(1, scope.size()); - assertEquals("(a=b)", scope.get(0)); - break; - case 2: - assertEquals(0, scope.size()); - break; - case 3: - assertEquals("adding entry to empty list failed", 1, scope.size()); - assertEquals("(a=b)", scope.get(0)); - break; - case 4: - assertEquals("adding second entry failed", 2, scope.size()); - assertNotNull(scope.contains("(a=b)")); - assertNotNull(scope.contains("(c=d)")); - break; - case 5: - assertEquals("remove failed", 1, scope.size()); - assertEquals("(c=d)", scope.get(0)); - break; - default: - assertTrue("This should not happen!", false); - } - return null; - } - }).atLeastOnce(); - - c.replay(); - - EndpointListenerManager endpointListener = new EndpointListenerManager(bc, tm); - - endpointListener.start(); - - testCase = 1; - endpointListener.extendScope("(a=b)"); - testCase = 2; - endpointListener.reduceScope("(a=b)"); - - testCase = 3; - endpointListener.extendScope("(a=b)"); - testCase = 4; - endpointListener.extendScope("(c=d)"); - testCase = 5; - endpointListener.reduceScope("(a=b)"); - - endpointListener.stop(); - - c.verify(); - } -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java deleted file mode 100644 index 1e2f90c..0000000 --- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -import java.util.Collection; -import java.util.Collections; -import java.util.Dictionary; -import java.util.Hashtable; - -import org.easymock.EasyMock; -import org.easymock.IMocksControl; -import org.junit.Test; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Filter; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.hooks.service.ListenerHook.ListenerInfo; -import org.osgi.service.remoteserviceadmin.RemoteConstants; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -public class ListenerHookImplTest { - - @Test - public void testExtendFilter() throws InvalidSyntaxException { - String filter = "(a=b)"; - BundleContext bc = createBundleContext(); - filter = new ListenerHookImpl(bc, null).extendFilter(filter); - - Filter f = FrameworkUtil.createFilter(filter); - - Dictionary<String, String> m = new Hashtable<String, String>(); - m.put("a", "b"); - assertTrue(filter + " filter must match as uuid is missing", f.match(m)); - m.put(RemoteConstants.ENDPOINT_FRAMEWORK_UUID, "MyUUID"); - assertFalse(filter + " filter must NOT match as uuid is the local one", f.match(m)); - } - - @Test - public void testAddedRemoved() throws InvalidSyntaxException { - IMocksControl c = EasyMock.createControl(); - String filter = "(objectClass=My)"; - BundleContext bc = createBundleContext(); - BundleContext listenerBc = createBundleContext(); - ServiceInterestListener serviceInterestListener = c.createMock(ServiceInterestListener.class); - ListenerHookImpl listenerHook = new ListenerHookImpl(bc, serviceInterestListener); - - ListenerInfo listener = c.createMock(ListenerInfo.class); - EasyMock.expect(listener.getBundleContext()).andReturn(listenerBc); - EasyMock.expect(listener.getFilter()).andReturn(filter).atLeastOnce(); - - // Main assertions - serviceInterestListener.addServiceInterest(listenerHook.extendFilter(filter)); - EasyMock.expectLastCall(); - serviceInterestListener.removeServiceInterest(listenerHook.extendFilter(filter)); - EasyMock.expectLastCall(); - - Collection<ListenerInfo> listeners = Collections.singletonList(listener); - - c.replay(); - listenerHook.added(listeners); - listenerHook.removed(listeners); - c.verify(); - } - - private BundleContext createBundleContext() { - BundleContext bc = EasyMock.createNiceMock(BundleContext.class); - EasyMock.expect(bc.getProperty(EasyMock.eq("org.osgi.framework.uuid"))).andReturn("MyUUID").atLeastOnce(); - EasyMock.replay(bc); - return bc; - } -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ReferenceCounterTest.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ReferenceCounterTest.java b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ReferenceCounterTest.java deleted file mode 100644 index 3ab78db..0000000 --- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ReferenceCounterTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class ReferenceCounterTest { - - @Test - public void testCounter() { - ReferenceCounter<String> counter = new ReferenceCounter<String>(); - assertEquals(-1, counter.remove("a")); - assertEquals(-1, counter.remove("a")); - assertEquals(1, counter.add("a")); - assertEquals(2, counter.add("a")); - assertEquals(3, counter.add("a")); - assertEquals(2, counter.remove("a")); - assertEquals(1, counter.remove("a")); - assertEquals(2, counter.add("a")); - assertEquals(1, counter.remove("a")); - assertEquals(0, counter.remove("a")); - assertEquals(-1, counter.remove("a")); - } -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java ---------------------------------------------------------------------- diff --git a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java b/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java deleted file mode 100644 index 00be969..0000000 --- a/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.dosgi.topologymanager.importer; - -import java.util.Dictionary; -import java.util.concurrent.Semaphore; -import java.util.concurrent.TimeUnit; - -import org.easymock.EasyMock; -import org.easymock.IAnswer; -import org.easymock.IMocksControl; -import org.junit.Test; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.framework.ServiceRegistration; -import org.osgi.service.remoteserviceadmin.EndpointDescription; -import org.osgi.service.remoteserviceadmin.ImportReference; -import org.osgi.service.remoteserviceadmin.ImportRegistration; -import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin; - -import static org.junit.Assert.assertTrue; - -public class TopologyManagerImportTest { - - @SuppressWarnings({ - "rawtypes", "unchecked" - }) - @Test - public void testImportForNewlyAddedRSA() throws InterruptedException { - IMocksControl c = EasyMock.createControl(); - - c.makeThreadSafe(true); - - final Semaphore sema = new Semaphore(0); - - ServiceRegistration sreg = c.createMock(ServiceRegistration.class); - sreg.unregister(); - EasyMock.expectLastCall().once(); - - BundleContext bc = c.createMock(BundleContext.class); - EasyMock.expect(bc.registerService(EasyMock.anyObject(Class.class), - EasyMock.anyObject(), - (Dictionary)EasyMock.anyObject())).andReturn(sreg).anyTimes(); - EasyMock.expect(bc.getProperty(Constants.FRAMEWORK_UUID)).andReturn("myid"); - - EndpointDescription endpoint = c.createMock(EndpointDescription.class); - RemoteServiceAdmin rsa = c.createMock(RemoteServiceAdmin.class); - final ImportRegistration ireg = c.createMock(ImportRegistration.class); - EasyMock.expect(ireg.getException()).andReturn(null).anyTimes(); - ImportReference iref = c.createMock(ImportReference.class); - EasyMock.expect(ireg.getImportReference()).andReturn(iref).anyTimes(); - EasyMock.expect(iref.getImportedEndpoint()).andReturn(endpoint).anyTimes(); - - EasyMock.expect(rsa.importService(EasyMock.eq(endpoint))).andAnswer(new IAnswer<ImportRegistration>() { - public ImportRegistration answer() throws Throwable { - sema.release(); - return ireg; - } - }).once(); - c.replay(); - - TopologyManagerImport tm = new TopologyManagerImport(bc); - tm.start(); - tm.endpointAdded(endpoint, "myFilter"); - tm.add(rsa); - assertTrue("rsa.ImportService should have been called", - sema.tryAcquire(100, TimeUnit.SECONDS)); - tm.stop(); - c.verify(); - } -} http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/dsw/pom.xml ---------------------------------------------------------------------- diff --git a/dsw/pom.xml b/dsw/pom.xml deleted file mode 100644 index 375d8fc..0000000 --- a/dsw/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version='1.0' encoding='UTF-8' ?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you 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. ---> -<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/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <artifactId>cxf-dosgi-ri-dsw</artifactId> - <packaging>pom</packaging> - <name>Distributed OSGI Distributed Software Modules</name> - <url>http://cxf.apache.org</url> - - <parent> - <groupId>org.apache.cxf.dosgi</groupId> - <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.8-SNAPSHOT</version> - <relativePath>../parent/pom.xml</relativePath> - </parent> - - <properties> - <topDirectoryLocation>..</topDirectoryLocation> - </properties> - - <modules> - <module>cxf-topology-manager</module> - <module>cxf-dosgi-provider-api</module> - <module>cxf-dosgi-rsa</module> - <module>cxf-dsw</module> - <module>cxf-dosgi-tcp</module> - </modules> -</project> http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/features/pom.xml ---------------------------------------------------------------------- diff --git a/features/pom.xml b/features/pom.xml new file mode 100644 index 0000000..4c9289c --- /dev/null +++ b/features/pom.xml @@ -0,0 +1,82 @@ +<?xml version='1.0' encoding='UTF-8' ?> +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor + license agreements. See the NOTICE file distributed with this work for additional + information regarding copyright ownership. The ASF licenses this file to + you 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. --> +<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/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.aries.rsa</groupId> + <artifactId>parent</artifactId> + <version>1.8-SNAPSHOT</version> + <relativePath>../parent/pom.xml</relativePath> + </parent> + + <artifactId>rsa-features</artifactId> + <packaging>pom</packaging> + <name>Aries Remote Service Admin Features</name> + + <properties> + <topDirectoryLocation>../..</topDirectoryLocation> + </properties> + + <build> + <resources> + <resource> + <directory>${project.basedir}/src/main/resources</directory> + <filtering>true</filtering> + <includes> + <include>**/features.xml</include> + <include>**/*.cfg</include> + <include>**/*.properties</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>filter</id> + <phase>generate-resources</phase> + <goals> + <goal>resources</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>attach-artifacts</id> + <phase>package</phase> + <goals> + <goal>attach-artifact</goal> + </goals> + <configuration> + <artifacts> + <artifact> + <file>target/classes/features.xml</file> + <type>xml</type> + <classifier>features</classifier> + </artifact> + </artifacts> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/features/src/main/resources/features.xml ---------------------------------------------------------------------- diff --git a/features/src/main/resources/features.xml b/features/src/main/resources/features.xml new file mode 100644 index 0000000..fa14ba6 --- /dev/null +++ b/features/src/main/resources/features.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="cxf-dosgi-${project.version}"> + <repository>mvn:org.apache.cxf.karaf/apache-cxf/${cxf.version}/xml/features</repository> + + <feature name="aries-rsa-core" version="${project.version}"> + <bundle>mvn:org.apache.aries.rsa/core/${project.version}</bundle> + <bundle>mvn:org.apache.aries.rsa/topology-manager/${project.version}</bundle> + </feature> + + <feature name="aries-rsa-provider-tcp" version="${project.version}"> + <feature>aries-rsa-core</feature> + <bundle>mvn:org.apache.aries.rsa.provider/tcp/${project.version}</bundle> + </feature> + + <feature name="aries-rsa-discovery-local" version="${project.version}"> + <feature>caries-rsa-core</feature> + <bundle>mvn:org.apache.aries.rsa.discovery/local/${project.version}</bundle> + </feature> + + <feature name="aries-rsa-discovery-zookeeper" version="${project.version}"> + <feature>aries-rsa-core</feature> + <bundle>mvn:org.apache.zookeeper/zookeeper/${zookeeper.version}</bundle> + <bundle>mvn:org.apache.aries.rsa.discovery/local/${project.version}</bundle> + <bundle>mvn:org.apache.aries.rsa.discovery/zookeeper/${project.version}</bundle> + </feature> + + <feature name="aries-rsa-zookeeper-server" version="${project.version}"> + <bundle>mvn:org.apache.zookeeper/zookeeper/${zookeeper.version}</bundle> + <bundle>mvn:org.apache.aries.rsa.discovery/zookeeper-server/${project.version}</bundle> + </feature> +</features> http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/felix/pom.xml ---------------------------------------------------------------------- diff --git a/felix/pom.xml b/felix/pom.xml deleted file mode 100644 index 0b8b759..0000000 --- a/felix/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version='1.0' encoding='UTF-8' ?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you 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. ---> -<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/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <artifactId>cxf-dosgi-ri-felix</artifactId> - <packaging>pom</packaging> - <name>Distributed OSGi Temporary Private Felix Framework Build</name> - - <parent> - <groupId>org.apache.cxf.dosgi</groupId> - <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.8-SNAPSHOT</version> - <relativePath>../parent/pom.xml</relativePath> - </parent> - - <properties> - <topDirectoryLocation>..</topDirectoryLocation> - </properties> - - <modules> - <module>shell.tui</module> - <module>profiles</module> - </modules> - -</project> http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/felix/profiles/pom.xml ---------------------------------------------------------------------- diff --git a/felix/profiles/pom.xml b/felix/profiles/pom.xml deleted file mode 100644 index 4cc71fe..0000000 --- a/felix/profiles/pom.xml +++ /dev/null @@ -1,201 +0,0 @@ -<?xml version='1.0' encoding='UTF-8' ?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you 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. ---> -<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/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <artifactId>cxf-dosgi-ri-felix-profiles</artifactId> - <packaging>jar</packaging> - <name>Distributed OSGi Felix Profiles</name> - - <parent> - <groupId>org.apache.cxf.dosgi</groupId> - <artifactId>cxf-dosgi-ri-parent</artifactId> - <version>1.8-SNAPSHOT</version> - <relativePath>../../parent/pom.xml</relativePath> - </parent> - - <properties> - <topDirectoryLocation>../..</topDirectoryLocation> - </properties> - - <dependencies> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>${jetty.version}</version> - </dependency> - - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>${jetty.version}</version> - </dependency> - - <dependency> - <groupId>org.apache.servicemix.specs</groupId> - <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId> - <version>${servicemix.specs.version}</version> - </dependency> - <dependency> - <groupId>org.apache.servicemix.specs</groupId> - <artifactId>org.apache.servicemix.specs.jaxb-api-2.1</artifactId> - <version>${servicemix.specs.version}</version> - </dependency> - <dependency> - <groupId>org.apache.servicemix.specs</groupId> - <artifactId>org.apache.servicemix.specs.jaxws-api-2.1</artifactId> - <version>${servicemix.specs.version}</version> - </dependency> - <dependency> - <groupId>org.apache.servicemix.specs</groupId> - <artifactId>org.apache.servicemix.specs.saaj-api-1.3</artifactId> - <version>${servicemix.specs.version}</version> - </dependency> - - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-javamail_1.4_spec</artifactId> - <version>1.7.1</version> - </dependency> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-activation_1.1_spec</artifactId> - <version>1.1</version> - </dependency> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> - <version>1.1.3</version> - </dependency> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-servlet_3.0_spec</artifactId> - <version>1.0</version> - </dependency> - - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-annotation_1.0_spec</artifactId> - <version>1.1.1</version> - </dependency> - - <dependency> - <groupId>org.apache.ws.xmlschema</groupId> - <artifactId>xmlschema-core</artifactId> - <version>${xmlschema.bundle.version}</version> - </dependency> - <dependency> - <groupId>org.apache.servicemix.bundles</groupId> - <artifactId>org.apache.servicemix.bundles.xmlresolver</artifactId> - <version>${xmlresolver.bundle.version}</version> - </dependency> - <dependency> - <groupId>org.apache.neethi</groupId> - <artifactId>neethi</artifactId> - <version>${neethi.bundle.version}</version> - </dependency> - <dependency> - <groupId>org.apache.servicemix.bundles</groupId> - <artifactId>org.apache.servicemix.bundles.wsdl4j</artifactId> - <version>${wsdl4j.bundle.version}</version> - </dependency> - <dependency> - <groupId>org.apache.santuario</groupId> - <artifactId>xmlsec</artifactId> - <version>${xmlsec.version}</version> - </dependency> - - <dependency> - <groupId>org.apache.servicemix.bundles</groupId> - <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId> - <version>${jaxbimpl.bundle.version}</version> - </dependency> - - <dependency> - <groupId>org.apache.servicemix.bundles</groupId> - <artifactId>org.apache.servicemix.bundles.asm</artifactId> - <version>${asm.bundle.version}</version> - </dependency> - - <dependency> - <groupId>org.codehaus.woodstox</groupId> - <artifactId>woodstox-core-asl</artifactId> - <version>${woodstox.bundle.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${spring.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-aop</artifactId> - <version>${spring.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework.osgi</groupId> - <artifactId>spring-osgi-core</artifactId> - <version>${spring.osgi.version}</version> - </dependency> - <dependency> - <groupId>org.springframework.osgi</groupId> - <artifactId>spring-osgi-io</artifactId> - <version>${spring.osgi.version}</version> - </dependency> - <dependency> - <groupId>org.springframework.osgi</groupId> - <artifactId>spring-osgi-extender</artifactId> - <version>${spring.osgi.version}</version> - </dependency> - - <!-- for maven filtering to happen --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <resources> - <resource> - <directory>src/main/resources/</directory> - <filtering>true</filtering> - </resource> - </resources> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/d73a3a7f/felix/profiles/resources/OSGI-INF/remote-service/alt-remote-services.xml ---------------------------------------------------------------------- diff --git a/felix/profiles/resources/OSGI-INF/remote-service/alt-remote-services.xml b/felix/profiles/resources/OSGI-INF/remote-service/alt-remote-services.xml deleted file mode 100644 index 36409ce..0000000 --- a/felix/profiles/resources/OSGI-INF/remote-service/alt-remote-services.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you 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. ---> - -<service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0"> - <service-description> - <provide interface="org.apache.cxf.dosgi.dsw.hooks.TestService" /> - <provide interface="org.apache.cxf.dosgi.dsw.hooks.CxfPublishHookTest$AdditionalInterface" /> - - <property name="osgi.remote.interfaces" value="*" /> - <property name="osgi.remote.requires.intents" value="SOAP HTTP" /> - <property name="osgi.remote.configuration.type" value="pojo" /> - <property name="osgi.remote.configuration.pojo.address" value="http://localhost:9000/hello" /> - </service-description> -</service-descriptions>
