Standardize whitespace style
authoramichai <amichai@unknown>
Wed, 5 Jun 2013 00:40:54 +0000 (00:40 +0000)
committeramichai <amichai@unknown>
Wed, 5 Jun 2013 00:40:54 +0000 (00:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/cxf/dosgi/trunk@1489675 13f79535-47bb-0310-9956-ffa450edef68

220 files changed:
discovery/distributed/cxf-discovery/pom.xml
discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/Activator.java
discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/DiscoveryPlugin.java
discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerTrackerCustomizer.java
discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceMonitor.java
discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceMonitorManager.java
discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/PublishingEndpointListener.java
discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/PublishingEndpointListenerFactory.java
discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/Util.java
discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/DiscoveryDriverTest.java
discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerFactoryTest.java
discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerImplTest.java
discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/FindInZooKeeperCustomizerTest.java
discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceDataMonitorListenerImplTest.java
discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceMonitorManagerTest.java
discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceMonitorTest.java
discovery/distributed/cxf-discovery/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/UtilTest.java
discovery/distributed/pom.xml
discovery/distributed/zookeeper-server-config/pom.xml
discovery/distributed/zookeeper-server-config/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/server/config/Activator.java
discovery/distributed/zookeeper-server/pom.xml
discovery/distributed/zookeeper-server/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/server/Activator.java
discovery/distributed/zookeeper-server/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/server/ZookeeperStarter.java
discovery/distributed/zookeeper-server/src/test/java/org/apache/cxf/dosgi/discovery/zookeeper/server/ZookeeperStarterTest.java
discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtils.java
discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/internal/Activator.java
discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/internal/LocalDiscovery.java
discovery/local/src/test/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtilsTest.java
discovery/local/src/test/java/org/apache/cxf/dosgi/discovery/local/internal/ActivatorTest.java
discovery/local/src/test/java/org/apache/cxf/dosgi/discovery/local/internal/LocalDiscoveryTest.java
discovery/local/src/test/resources/ed1.xml
discovery/local/src/test/resources/ed2-generated.xml
discovery/local/src/test/resources/ed2.xml
discovery/local/src/test/resources/ed3.xml
discovery/local/src/test/resources/ed4.xml
discovery/pom.xml
distribution/features/src/main/resources/features.xml
distribution/multi-bundle/pom.xml
distribution/multi-bundle/src/main/appended-resources/META-INF/LICENSE.vm
distribution/multi-bundle/src/main/appended-resources/META-INF/NOTICE
distribution/multi-bundle/src/main/release/README
distribution/multi-bundle/src/main/release/release_notes.txt
distribution/multi-bundle/src/main/resources/distro_bundles.xml
distribution/pom.xml
distribution/sources/src/main/release/LICENSE
distribution/sources/src/main/release/README
distribution/sources/src/main/release/release_notes.txt
distribution/subsystem/pom.xml
distribution/subsystem/src/main/assembly/subsystem-assembly.xml
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRule.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/Rule.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecorator.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigurationTypeHandler.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ExportResult.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/LocalHostUtil.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContext.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ServiceInvocationHandler.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/DefaultIntentMapFactory.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentManager.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImpl.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentMap.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentTracker.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUnsatisfiedException.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/qos/IntentUtils.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ClientServiceFactory.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportReferenceImpl.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ImportRegistrationImpl.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceadminFactory.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/ClassUtils.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/OsgiUtils.java
dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/util/Utils.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/ActivatorTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/InterfaceRuleTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactoryTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManagerTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/SecurityDelegatingHttpContextTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ServiceInvocationHandlerTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandlerTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/jaxws/MyJaxWsEchoServiceImpl.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/simple/MySimpleEchoServiceImpl.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfFindListenerHookTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtilsTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/TestService.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/qos/IntentManagerImplTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/qos/IntentTrackerTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/qos/IntentUtilsTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/DistributionProviderImplTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/EventProducerTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/ImportRegistrationImplTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCoreTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java
dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/OsgiUtilsTest.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifier.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointRepository.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/exporter/TopologyManagerExport.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerManager.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImpl.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/ServiceInterestListener.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImport.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminLifeCycleListener.java
dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/rsatracker/RemoteServiceAdminTracker.java
dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/EndpointListenerNotifierTest.java
dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/exporter/ExportServiceTest.java
dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/EndpointListenerImplTest.java
dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/ListenerHookImplTest.java
dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/importer/TopologyManagerImportTest.java
dsw/pom.xml
felix/pom.xml
felix/profiles/pom.xml
felix/shell.tui/pom.xml
felix/shell.tui/src/main/java/org/apache/felix/shell/tui/Activator.java
parent/pom.xml
pom.xml
samples/discovery/client/pom.xml
samples/discovery/client/src/main/java/org/apache/cxf/dosgi/samples/discovery/consumer/Activator.java
samples/discovery/impl/pom.xml
samples/discovery/impl/src/main/java/org/apache/cxf/dosgi/samples/discovery/impl/Activator.java
samples/discovery/impl/src/main/java/org/apache/cxf/dosgi/samples/discovery/impl/DisplayServiceImpl.java
samples/discovery/interface/pom.xml
samples/discovery/pom.xml
samples/ds/client/pom.xml
samples/ds/client/src/main/java/org/apache/cxf/dosgi/samples/ds/consumer/Activator.java
samples/ds/client/src/main/java/org/apache/cxf/dosgi/samples/ds/consumer/AdderConsumer.java
samples/ds/impl/pom.xml
samples/ds/impl/src/main/java/org/apache/cxf/dosgi/samples/ds/impl/AdderServiceImpl.java
samples/ds/impl/src/main/resources/OSGI-INF/component.xml
samples/ds/interface/pom.xml
samples/ds/pom.xml
samples/greeter/client/pom.xml
samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/Activator.java
samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDataImpl.java
samples/greeter/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/GreeterDialog.java
samples/greeter/impl/pom.xml
samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/Activator.java
samples/greeter/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/GreeterServiceImpl.java
samples/greeter/interface/pom.xml
samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterException.java
samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreeterService.java
samples/greeter/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/GreetingPhrase.java
samples/greeter/pom.xml
samples/greeter_rest/client/pom.xml
samples/greeter_rest/client/src/main/java/org/apache/cxf/dosgi/samples/greeter/client/rest/Activator.java
samples/greeter_rest/impl/pom.xml
samples/greeter_rest/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/rest/Activator.java
samples/greeter_rest/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/rest/GreeterServiceImpl.java
samples/greeter_rest/impl/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl/rest/GreeterServiceImpl2.java
samples/greeter_rest/impl2/pom.xml
samples/greeter_rest/impl2/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl2/rest/Activator.java
samples/greeter_rest/impl2/src/main/java/org/apache/cxf/dosgi/samples/greeter/impl2/rest/GreeterServiceImpl2.java
samples/greeter_rest/interface/pom.xml
samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterException.java
samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterInfo.java
samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterService.java
samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreeterService2.java
samples/greeter_rest/interface/src/main/java/org/apache/cxf/dosgi/samples/greeter/rest/GreetingPhrase.java
samples/greeter_rest/pom.xml
samples/pom.xml
samples/security_filter/pom.xml
samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/Activator.java
samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SampleSecurityFilter.java
samples/security_filter/src/main/java/org/apache/cxf/dosgi/samples/security/SecureRestEndpoint.java
samples/spring_dm/client/pom.xml
samples/spring_dm/client/src/main/java/org/apache/cxf/dosgi/samples/springdm/client/DinnerServiceConsumer.java
samples/spring_dm/client/src/main/resources/META-INF/spring/client-spring.xml
samples/spring_dm/impl/pom.xml
samples/spring_dm/impl/src/main/java/org/apache/cxf/dosgi/samples/springdm/impl/DinnerServiceImpl.java
samples/spring_dm/impl/src/main/resources/META-INF/spring/spring.xml
samples/spring_dm/interface/pom.xml
samples/spring_dm/interface/src/main/java/org/apache/cxf/dosgi/samples/springdm/DinnerService.java
samples/spring_dm/interface/src/main/java/org/apache/cxf/dosgi/samples/springdm/Restaurant.java
samples/spring_dm/pom.xml
systests2/common/pom.xml
systests2/common/src/main/java/org/apache/cxf/dosgi/systests2/common/test1/GreeterDataImpl.java
systests2/common/src/main/java/org/apache/cxf/dosgi/systests2/common/test1/MyActivator.java
systests2/common/src/main/java/org/apache/cxf/dosgi/systests2/common/test1/MyServiceTracker.java
systests2/common/src/main/java/org/apache/cxf/dosgi/systests2/common/test1/StartServiceTracker.java
systests2/common/src/main/java/org/apache/cxf/dosgi/systests2/common/test2/Test2Service.java
systests2/common/src/main/java/org/apache/cxf/dosgi/systests2/common/test2/client/ClientActivator.java
systests2/common/src/main/java/org/apache/cxf/dosgi/systests2/common/test2/client/Test2ServiceTracker.java
systests2/common/src/main/java/org/apache/cxf/dosgi/systests2/common/test2/server/ServerActivator.java
systests2/common/src/main/java/org/apache/cxf/dosgi/systests2/common/test2/server/Test2ServiceImpl.java
systests2/multi-bundle/pom.xml
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/MultiBundleTools.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestCustomIntent.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestDiscoveryExport.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportService.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestImportService.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/customintent/AddGreetingPhraseInterceptor.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/customintent/CustomFeature.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/customintent/CustomIntentActivator.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/customintent/service/EmptyGreeterService.java
systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/customintent/service/GreeterServiceWithCustomIntentActivator.java
systests2/multi-bundle/src/test/resources/log4j.properties
systests2/pom.xml
tck/apply-to-tck.sh.template

index 29082d4..7bd6ecd 100644 (file)
@@ -64,7 +64,7 @@
                 </exclusion>
             </exclusions>
         </dependency>
-        
+
         <!--  We need the newer log4j as the one from zookeeper has some ugly dependencies -->
         <dependency>
             <groupId>log4j</groupId>
index c62c730..9954285 100644 (file)
@@ -27,6 +27,7 @@ import org.osgi.framework.Constants;
 import org.osgi.service.cm.ManagedService;
 
 public class Activator implements BundleActivator {
+
     private ZooKeeperDiscovery zkd;
 
     public synchronized void start(BundleContext bc) throws Exception {
@@ -39,5 +40,4 @@ public class Activator implements BundleActivator {
     public synchronized void stop(BundleContext bc) throws Exception {
         zkd.stop();
     }
-
 }
index 946076d..09268ae 100644 (file)
@@ -29,13 +29,14 @@ import java.util.Map;
  * lookup process. <p/>
  *
  * DiscoveryPlugins use the OSGi WhiteBoard pattern. To add one to the system, register an instance under this interface
- * with the OSGi Service Registry. All registered DiscoveryPlugin instances are visited and given a chance to 
+ * with the OSGi Service Registry. All registered DiscoveryPlugin instances are visited and given a chance to
  * process the information before it is pushed into ZooKeeper. <p/>
  *
  * Note that the changes made using this plugin do not modify the local service registration.
  *
  */
 public interface DiscoveryPlugin {
+
     /**
      * Process service registration information. Plugins can change this information before it is published into the
      * ZooKeeper discovery system.
@@ -43,10 +44,10 @@ public interface DiscoveryPlugin {
      * @param mutableProperties A map of service registration properties. The map is mutable and any changes to the map
      * will be reflected in the ZooKeeper registration.
      * @param endpointKey The key under which the service is registered in ZooKeeper. This key typically has the
-     * following format: hostname#port##context. While the actual value of this key is not actually used by the 
+     * following format: hostname#port##context. While the actual value of this key is not actually used by the
      * system (people can use it as a hint to understand where the service is located), the value <i>must</i> be
      * unique for all services of a given type.
-     * @return The <tt>endpointKey</tt> value to be used. If there is no need to change this simply return the value 
+     * @return The <tt>endpointKey</tt> value to be used. If there is no need to change this simply return the value
      * of the <tt>endpointKey</tt> parameter.
      */
     String process(Map<String, Object> mutableProperties, String endpointKey);
index ff76e6d..60db69f 100644 (file)
@@ -27,10 +27,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Tracks interest in EndpointListeners. Delegates to InterfaceMonitorManager to manage 
+ * Tracks interest in EndpointListeners. Delegates to InterfaceMonitorManager to manage
  * interest in the scopes of each EndpointListener.
  */
 public class EndpointListenerTrackerCustomizer implements ServiceTrackerCustomizer {
+
     private static final Logger LOG = LoggerFactory.getLogger(EndpointListenerTrackerCustomizer.class);
     private static final Pattern OBJECTCLASS_PATTERN = Pattern.compile(".*\\(objectClass=([^)]+)\\).*");
 
index e6f4e00..2c014d5 100644 (file)
@@ -46,6 +46,7 @@ import org.slf4j.LoggerFactory;
  * notification to other EndpointListeners with a matching scope).
  */
 public class InterfaceMonitor implements Watcher, StatCallback {
+
     private static final Logger LOG = LoggerFactory.getLogger(InterfaceMonitor.class);
 
     private final String znode;
index 834e33a..ad0e0a5 100644 (file)
@@ -44,8 +44,9 @@ import org.slf4j.LoggerFactory;
  * These events are then forwarded to all interested EndpointListeners
  */
 public class InterfaceMonitorManager {
+
     private static final Logger LOG = LoggerFactory.getLogger(InterfaceMonitorManager.class);
-    
+
     private final ZooKeeper zooKeeper;
     private final Map<ServiceReference, List<String> /* scopes of the epl */> handledEndpointListeners
         = new HashMap<ServiceReference, List<String>>();
@@ -56,7 +57,7 @@ public class InterfaceMonitorManager {
         List<ServiceReference> relatedServiceListeners = new CopyOnWriteArrayList<ServiceReference>();
         InterfaceMonitor im;
     }
-    
+
     public InterfaceMonitorManager(BundleContext bctx, ZooKeeper zooKeeper) {
         this.bctx = bctx;
         this.zooKeeper = zooKeeper;
@@ -88,7 +89,7 @@ public class InterfaceMonitorManager {
             handledScopes.add(scope);
         }
     }
-    
+
     /**
      * Only for test case!
      */
@@ -102,14 +103,15 @@ public class InterfaceMonitorManager {
     protected synchronized Map<ServiceReference, List<String>> getHandledEndpointListeners() {
         return handledEndpointListeners;
     }
-    
+
     private InterfaceMonitor createInterfaceMonitor(final String scope, String objClass, final Interest interest) {
         // holding this object's lock in the callbacks can lead to a deadlock with InterfaceMonitor
         EndpointListener epListener = new EndpointListener() {
+
             public void endpointRemoved(EndpointDescription endpoint, String matchedFilter) {
                 notifyListeners(endpoint, scope, false, interest.relatedServiceListeners);
             }
-            
+
             public void endpointAdded(EndpointDescription endpoint, String matchedFilter) {
                 notifyListeners(endpoint, scope, true, interest.relatedServiceListeners);
             }
@@ -135,7 +137,7 @@ public class InterfaceMonitorManager {
         }
         handledEndpointListeners.remove(sref);
     }
-    
+
     private void notifyListeners(EndpointDescription epd, String currentScope, boolean isAdded,
             List<ServiceReference> relatedServiceListeners) {
         for (ServiceReference sref : relatedServiceListeners) {
@@ -165,7 +167,7 @@ public class InterfaceMonitorManager {
             }
         }
     }
-    
+
     private static boolean matches(String scope, EndpointDescription epd) {
         try {
             Filter f = FrameworkUtil.createFilter(scope);
index 7c20332..7450bcf 100644 (file)
@@ -44,6 +44,7 @@ import org.slf4j.LoggerFactory;
  * Listens for local Endpoints and publishes them to Zookeeper
  */
 public class PublishingEndpointListener implements EndpointListener {
+
     private static final Logger LOG = LoggerFactory.getLogger(PublishingEndpointListener.class);
 
     private final ZooKeeper zookeeper;
@@ -76,7 +77,6 @@ public class PublishingEndpointListener implements EndpointListener {
                 LOG.error("Exception while processing the addition of an endpoint.", ex);
             }
         }
-
     }
 
     private void addEndpoint(EndpointDescription endpoint) throws URISyntaxException, KeeperException,
@@ -122,7 +122,6 @@ public class PublishingEndpointListener implements EndpointListener {
                 LOG.error("Exception while processing the removal of an endpoint", ex);
             }
         }
-
     }
 
     private void removeEndpoint(EndpointDescription endpoint) throws UnknownHostException, URISyntaxException {
@@ -143,7 +142,6 @@ public class PublishingEndpointListener implements EndpointListener {
 
     private static void ensurePath(String path, ZooKeeper zk) throws KeeperException, InterruptedException {
         StringBuilder current = new StringBuilder();
-
         String[] parts = Util.removeEmpty(path.split("/"));
         for (String part : parts) {
             current.append('/');
index 2d5d86c..8ac5223 100644 (file)
@@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
  * Creates local EndpointListeners that publish to Zookeeper.
  */
 public class PublishingEndpointListenerFactory implements ServiceFactory {
+
     public static final String DISCOVERY_ZOOKEEPER_ID = "org.apache.cxf.dosgi.discovery.zookeeper";
     private static final Logger LOG = LoggerFactory.getLogger(PublishingEndpointListenerFactory.class);
 
@@ -71,7 +72,7 @@ public class PublishingEndpointListenerFactory implements ServiceFactory {
 
     public synchronized void start() {
         Dictionary<String, String> props = new Hashtable<String, String>();
-        props.put(EndpointListener.ENDPOINT_LISTENER_SCOPE, 
+        props.put(EndpointListener.ENDPOINT_LISTENER_SCOPE,
                   "(&(" + Constants.OBJECTCLASS + "=*)(" + RemoteConstants.ENDPOINT_FRAMEWORK_UUID
                   + "=" + Util.getUUID(bctx) + "))");
         props.put(DISCOVERY_ZOOKEEPER_ID, "true");
@@ -100,5 +101,4 @@ public class PublishingEndpointListenerFactory implements ServiceFactory {
             return listeners;
         }
     }
-    
 }
index b8b6fdf..84470c2 100644 (file)
@@ -21,15 +21,15 @@ package org.apache.cxf.dosgi.discovery.zookeeper;
 import junit.framework.TestCase;
 
 public class DiscoveryDriverTest extends TestCase {
-    
+
     public void testDUMMY() {
         assertTrue(true);
     }
-    
+
 //    public void testDiscoveryDriver() throws Exception {
 //        BundleContext bc = getDefaultBundleContext();
 //        Dictionary<String, String> props = getDefaultProps();
-//        
+//
 //        final StringBuilder sb = new StringBuilder();
 //        DiscoveryDriver dd = new DiscoveryDriver(bc, props) {
 //            @Override
@@ -38,17 +38,17 @@ public class DiscoveryDriverTest extends TestCase {
 //                ZooKeeper zk = EasyMock.createMock(ZooKeeper.class);
 //                EasyMock.replay(zk);
 //                return zk;
-//            }           
+//            }
 //        };
 //        EasyMock.verify(bc);
 //        assertEquals("somehost:1910", sb.toString());
-//        
+//
 //        EasyMock.verify(dd.zooKeeper);
 //        EasyMock.reset(dd.zooKeeper);
 //        dd.zooKeeper.close();
 //        EasyMock.expectLastCall();
 //        EasyMock.replay(dd.zooKeeper);
-//        
+//
 //        ServiceTracker st1 = EasyMock.createMock(ServiceTracker.class);
 //        st1.close();
 //        EasyMock.expectLastCall();
@@ -57,35 +57,35 @@ public class DiscoveryDriverTest extends TestCase {
 //        st2.close();
 //        EasyMock.expectLastCall();
 //        EasyMock.replay(st2);
-//        
+//
 //        dd.lookupTracker = st1;
 //        dd.publicationTracker = st2;
-//        
-//        dd.destroy();        
+//
+//        dd.destroy();
 //    }
 //
 //    private void expectServiceTrackerCalls(BundleContext bc, String objectClass)
 //            throws InvalidSyntaxException {
 //        Filter filter = EasyMock.createNiceMock(Filter.class);
 //        EasyMock.replay(filter);
-//        
+//
 //        EasyMock.expect(bc.createFilter("(objectClass=" + objectClass + ")"))
 //            .andReturn(filter).anyTimes();
-//        bc.addServiceListener((ServiceListener) EasyMock.anyObject(), 
+//        bc.addServiceListener((ServiceListener) EasyMock.anyObject(),
 //            EasyMock.eq("(objectClass=" + objectClass + ")"));
 //        EasyMock.expectLastCall().anyTimes();
 //        EasyMock.expect(bc.getServiceReferences(objectClass, null))
 //            .andReturn(new ServiceReference [0]).anyTimes();
 //    }
-//    
+//
 //    public void testProcessEvent() throws Exception {
 //        DiscoveryDriver db = new DiscoveryDriver(getDefaultBundleContext(), getDefaultProps()) {
 //            @Override
 //            ZooKeeper createZooKeeper() throws IOException {
 //                return null;
-//            }            
+//            }
 //        };
-//        
+//
 //        FindInZooKeeperCustomizer fc = new FindInZooKeeperCustomizer(null, null);
 //        List<InterfaceMonitor> l1 = new ArrayList<InterfaceMonitor>();
 //        InterfaceMonitor dm1a = EasyMock.createMock(InterfaceMonitor.class);
@@ -98,7 +98,7 @@ public class DiscoveryDriverTest extends TestCase {
 //        EasyMock.replay(dm1b);
 //        l1.add(dm1a);
 //        l1.add(dm1b);
-//        
+//
 //        List<InterfaceMonitor> l2 = new ArrayList<InterfaceMonitor>();
 //        InterfaceMonitor dm2 = EasyMock.createMock(InterfaceMonitor.class);
 //        dm2.process();
@@ -108,10 +108,10 @@ public class DiscoveryDriverTest extends TestCase {
 //
 //        fc.watchers.put(EasyMock.createMock(DiscoveredServiceTracker.class), l1);
 //        fc.watchers.put(EasyMock.createMock(DiscoveredServiceTracker.class), l2);
-//        
+//
 //        db.finderCustomizer = fc;
 //        db.process(null);
-//        
+//
 //        EasyMock.verify(dm1a);
 //        EasyMock.verify(dm1b);
 //        EasyMock.verify(dm2);
@@ -132,5 +132,4 @@ public class DiscoveryDriverTest extends TestCase {
 //        props.put("zookeeper.timeout", "1500");
 //        return props;
 //    }
-
 }
index 7137796..fcdc28e 100644 (file)
@@ -38,55 +38,47 @@ public class EndpointListenerFactoryTest extends TestCase {
         BundleContext ctx = c.createMock(BundleContext.class);
         ZooKeeper zk = c.createMock(ZooKeeper.class);
         ServiceRegistration sreg = c.createMock(ServiceRegistration.class);
-        
+
         PublishingEndpointListenerFactory eplf = new PublishingEndpointListenerFactory(zk, ctx);
 
-        EasyMock.expect(
-                        ctx.registerService(EasyMock.eq(EndpointListener.class.getName()), EasyMock.eq(eplf),
+        EasyMock.expect(ctx.registerService(EasyMock.eq(EndpointListener.class.getName()), EasyMock.eq(eplf),
                                             (Dictionary<String, String>)EasyMock.anyObject())).andReturn(sreg).once();
-        
-        EasyMock.expect(ctx.getProperty(EasyMock.eq("org.osgi.framework.uuid"))).andReturn("myUUID")
-            .anyTimes();
-        
+
+        EasyMock.expect(ctx.getProperty(EasyMock.eq("org.osgi.framework.uuid"))).andReturn("myUUID").anyTimes();
+
         c.replay();
         eplf.start();
         c.verify();
-        
+
         c.reset();
         sreg.unregister();
         EasyMock.expectLastCall().once();
         c.replay();
         eplf.stop();
         c.verify();
-        
-        
     }
 
     public void testServiceFactory() {
         IMocksControl c = EasyMock.createNiceControl();
-        
+
         BundleContext ctx = c.createMock(BundleContext.class);
         ZooKeeper zk = c.createMock(ZooKeeper.class);
         ServiceRegistration sreg = c.createMock(ServiceRegistration.class);
-        
+
         PublishingEndpointListenerFactory eplf = new PublishingEndpointListenerFactory(zk, ctx);
 
-        EasyMock.expect(
-                        ctx.registerService(EasyMock.eq(EndpointListener.class.getName()), EasyMock.eq(eplf),
+        EasyMock.expect(ctx.registerService(EasyMock.eq(EndpointListener.class.getName()), EasyMock.eq(eplf),
                                 (Dictionary<String, String>)EasyMock.anyObject())).andReturn(sreg).once();
 
-        
-        EasyMock.expect(ctx.getProperty(EasyMock.eq("org.osgi.framework.uuid"))).andReturn("myUUID")
-            .anyTimes();
+        EasyMock.expect(ctx.getProperty(EasyMock.eq("org.osgi.framework.uuid"))).andReturn("myUUID").anyTimes();
 
         PublishingEndpointListener eli = c.createMock(PublishingEndpointListener.class);
         eli.close();
         EasyMock.expectLastCall().once();
-        
+
         c.replay();
         eplf.start();
-        
-        
+
         Object service = eplf.getService(null, null);
         assertNotNull(service);
         assertTrue(service instanceof EndpointListener);
@@ -94,18 +86,17 @@ public class EndpointListenerFactoryTest extends TestCase {
         List<PublishingEndpointListener> listeners = eplf.getListeners();
         assertEquals(1, listeners.size());
         assertEquals(service, listeners.get(0));
-        
+
         eplf.ungetService(null, null, service);
         listeners = eplf.getListeners();
         assertEquals(0, listeners.size());
-        
-        eplf.ungetService(null, null, eli); // no call to close 
+
+        eplf.ungetService(null, null, eli); // no call to close
         listeners.add(eli);
         eplf.ungetService(null, null, eli); // call to close
         listeners = eplf.getListeners();
         assertEquals(0, listeners.size());
-        
+
         c.verify();
     }
-    
 }
index 7b23f58..7995937 100644 (file)
@@ -44,17 +44,15 @@ import org.osgi.service.remoteserviceadmin.RemoteConstants;
 public class EndpointListenerImplTest extends TestCase {
 
     public void testEndpointRemovalAdding() throws KeeperException, InterruptedException {
-
         IMocksControl c = EasyMock.createNiceControl();
 
         BundleContext ctx = c.createMock(BundleContext.class);
         ZooKeeper zk = c.createMock(ZooKeeper.class);
 
         String path = "/osgi/service_registry/myClass/google.de#80##test";
-        EasyMock.expect(
-                        zk.create(EasyMock.eq(path),
-                                  (byte[])EasyMock.anyObject(), EasyMock.eq(Ids.OPEN_ACL_UNSAFE), EasyMock
-                                      .eq(CreateMode.EPHEMERAL))).andReturn("").once();
+        EasyMock.expect(zk.create(EasyMock.eq(path),
+                (byte[])EasyMock.anyObject(), EasyMock.eq(Ids.OPEN_ACL_UNSAFE),
+                EasyMock.eq(CreateMode.EPHEMERAL))).andReturn("").once();
 
         zk.delete(EasyMock.eq("/osgi/service_registry/myClass/google.de#80##test"), EasyMock.eq(-1));
         EasyMock.expectLastCall().once();
@@ -73,13 +71,12 @@ public class EndpointListenerImplTest extends TestCase {
         EndpointDescription ed = new EndpointDescription(props);
 
         eli.endpointAdded(ed, null);
-        eli.endpointAdded(ed, null);  // should do nothing
+        eli.endpointAdded(ed, null); // should do nothing
 
         eli.endpointRemoved(ed, null);
         eli.endpointRemoved(ed, null); // should do nothing
 
         c.verify();
-
     }
 
     public void testDiscoveryPlugin() throws Exception {
@@ -110,8 +107,8 @@ public class EndpointListenerImplTest extends TestCase {
                 EasyMock.eq("(objectClass=org.apache.cxf.dosgi.discovery.zookeeper.DiscoveryPlugin)"));
         EasyMock.expect(ctx.getService(sr1)).andReturn(plugin1).anyTimes();
         EasyMock.expect(ctx.getService(sr2)).andReturn(plugin2).anyTimes();
-        EasyMock.expect(ctx.getServiceReferences(DiscoveryPlugin.class.getName(), null)).andReturn(
-                new ServiceReference[] {sr1, sr2}).anyTimes();
+        EasyMock.expect(ctx.getServiceReferences(DiscoveryPlugin.class.getName(), null))
+                .andReturn(new ServiceReference[]{sr1, sr2}).anyTimes();
         EasyMock.replay(ctx);
 
         Map<String, Object> props = new HashMap<String, Object>();
@@ -144,7 +141,6 @@ public class EndpointListenerImplTest extends TestCase {
         EasyMock.verify(zk);
     }
 
-
     @SuppressWarnings("unchecked")
     private List<EndpointDescription> getEndpointsList(PublishingEndpointListener eli) throws Exception {
         Field field = eli.getClass().getDeclaredField("endpoints");
@@ -153,17 +149,15 @@ public class EndpointListenerImplTest extends TestCase {
     }
 
     public void testClose() throws KeeperException, InterruptedException {
-
         IMocksControl c = EasyMock.createNiceControl();
 
         BundleContext ctx = c.createMock(BundleContext.class);
         ZooKeeper zk = c.createMock(ZooKeeper.class);
 
         String path = "/osgi/service_registry/myClass/google.de#80##test";
-        EasyMock.expect(
-                        zk.create(EasyMock.eq(path),
-                                  (byte[])EasyMock.anyObject(), EasyMock.eq(Ids.OPEN_ACL_UNSAFE), EasyMock
-                                      .eq(CreateMode.EPHEMERAL))).andReturn("").once();
+        EasyMock.expect(zk.create(EasyMock.eq(path),
+                (byte[])EasyMock.anyObject(), EasyMock.eq(Ids.OPEN_ACL_UNSAFE),
+                EasyMock.eq(CreateMode.EPHEMERAL))).andReturn("").once();
 
         zk.delete(EasyMock.eq("/osgi/service_registry/myClass/google.de#80##test"), EasyMock.eq(-1));
         EasyMock.expectLastCall().once();
@@ -186,13 +180,10 @@ public class EndpointListenerImplTest extends TestCase {
         eli.close(); // should result in zk.delete(...)
 
         c.verify();
-
     }
 
-
     public void testGetKey() throws Exception {
         assertEquals("somehost#9090##org#example#TestEndpoint",
             PublishingEndpointListener.getKey("http://somehost:9090/org/example/TestEndpoint"));
     }
-
 }
index 213c093..eed27d5 100644 (file)
@@ -21,56 +21,56 @@ package org.apache.cxf.dosgi.discovery.zookeeper;
 import junit.framework.TestCase;
 
 public class FindInZooKeeperCustomizerTest extends TestCase {
-    
+
     public void testDUMMY() {
         assertTrue(true);
     }
-    
+
 //    public void testAddingServiceInterface() {
 //        DiscoveredServiceTracker dst = new DiscoveredServiceTracker() {
 //            public void serviceChanged(DiscoveredServiceNotification dsn) {}
 //        };
-//        
+//
 //        ServiceReference sr = EasyMock.createMock(ServiceReference.class);
-//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA)).
-//            andReturn(Collections.singleton(String.class.getName()));
-//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA)).
-//            andReturn(null);
+//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA))
+//            .andReturn(Collections.singleton(String.class.getName()));
+//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA))
+//            .andReturn(null);
 //        EasyMock.replay(sr);
-//        
+//
 //        DiscoveredServiceTracker dst2 = new DiscoveredServiceTracker() {
 //            public void serviceChanged(DiscoveredServiceNotification dsn) {}
 //        };
-//        
+//
 //        ServiceReference sr2 = EasyMock.createMock(ServiceReference.class);
-//        EasyMock.expect(sr2.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA)).
-//            andReturn(Arrays.asList(Integer.class.getName(), Comparable.class.getName()));
-//        EasyMock.expect(sr2.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA)).
-//            andReturn(null);
+//        EasyMock.expect(sr2.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA))
+//            .andReturn(Arrays.asList(Integer.class.getName(), Comparable.class.getName()));
+//        EasyMock.expect(sr2.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA))
+//            .andReturn(null);
 //        EasyMock.replay(sr2);
-//        
+//
 //        BundleContext bc = EasyMock.createMock(BundleContext.class);
 //        EasyMock.expect(bc.getService(sr)).andReturn(dst);
 //        EasyMock.expect(bc.getService(sr2)).andReturn(dst2);
 //        EasyMock.replay(bc);
-//        
+//
 //        ZooKeeper zk = EasyMock.createMock(ZooKeeper.class);
 //        zkExpectExists(zk, String.class.getName());
 //        zkExpectExists(zk, Integer.class.getName());
 //        zkExpectExists(zk, Comparable.class.getName());
 //        EasyMock.expectLastCall();
 //        EasyMock.replay(zk);
-//        
+//
 //        FindInZooKeeperCustomizer fc = new FindInZooKeeperCustomizer(bc, zk);
 //
 //        // ---------------------------------------------------------------
 //        // Test the addingService APIs
 //        // ---------------------------------------------------------------
-//        
+//
 //        assertEquals("Precondition failed", 0, fc.watchers.size());
 //        fc.addingService(sr);
 //        assertEquals(1, fc.watchers.size());
-//        
+//
 //        DiscoveredServiceTracker key = fc.watchers.keySet().iterator().next();
 //        assertSame(dst, key);
 //        List<InterfaceMonitor> dmList = fc.watchers.get(key);
@@ -78,27 +78,27 @@ public class FindInZooKeeperCustomizerTest extends TestCase {
 //        InterfaceMonitor dm = dmList.iterator().next();
 //        assertNotNull(dm.listener);
 //        assertSame(zk, dm.zookeeper);
-//        assertEquals(Util.getZooKeeperPath(String.class.getName()), dm.znode);        
+//        assertEquals(Util.getZooKeeperPath(String.class.getName()), dm.znode);
 //
 //        assertEquals("Precondition failed", 1, fc.watchers.size());
 //        fc.addingService(sr2);
 //        assertEquals(2, fc.watchers.size());
-//        
+//
 //        assertTrue(fc.watchers.containsKey(dst));
 //        assertTrue(fc.watchers.containsKey(dst2));
 //        assertEquals(dmList, fc.watchers.get(dst));
 //        List<InterfaceMonitor> dmList2 = fc.watchers.get(dst2);
 //        assertEquals(2, dmList2.size());
-//        
+//
 //        Set<String> actual = new HashSet<String>();
 //        for (InterfaceMonitor im : dmList2) {
 //            actual.add(im.znode);
 //        }
 //        Set<String> expected = new HashSet<String>(Arrays.asList(
-//                Util.getZooKeeperPath(Integer.class.getName()), 
+//                Util.getZooKeeperPath(Integer.class.getName()),
 //                Util.getZooKeeperPath(Comparable.class.getName())));
 //        assertEquals(expected, actual);
-//        
+//
 //        EasyMock.verify(zk);
 //
 //        // ---------------------------------------------------------------
@@ -107,18 +107,18 @@ public class FindInZooKeeperCustomizerTest extends TestCase {
 //        EasyMock.reset(zk);
 //        zkExpectExists(zk, List.class.getName());
 //        EasyMock.replay(zk);
-//        
+//
 //        EasyMock.reset(sr);
-//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA)).
-//            andReturn(Collections.singleton(List.class.getName()));
-//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA)).
-//            andReturn(null);
+//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA))
+//            .andReturn(Collections.singleton(List.class.getName()));
+//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA))
+//            .andReturn(null);
 //        EasyMock.replay(sr);
-//        
+//
 //        assertEquals("Precondition failed", 2, fc.watchers.size());
 //        fc.modifiedService(sr, dst);
 //        assertEquals("Precondition failed", 2, fc.watchers.size());
-//        
+//
 //        assertTrue(fc.watchers.containsKey(dst));
 //        assertTrue(fc.watchers.containsKey(dst2));
 //        assertEquals(dmList2, fc.watchers.get(dst2));
@@ -126,72 +126,72 @@ public class FindInZooKeeperCustomizerTest extends TestCase {
 //        assertEquals(1, dmList3.size());
 //        assertEquals(Util.getZooKeeperPath(List.class.getName()), dmList3.iterator().next().znode);
 //
-//        EasyMock.verify(zk);    
+//        EasyMock.verify(zk);
 //
 //        // ---------------------------------------------------------------
 //        // Test the removedService APIs
 //        // ---------------------------------------------------------------
 //        EasyMock.reset(zk);
 //        EasyMock.replay(zk);
-//        
+//
 //        assertEquals("Precondition failed", 2, fc.watchers.size());
 //        fc.removedService(sr2, dst2);
 //        assertEquals("Precondition failed", 1, fc.watchers.size());
-//        
+//
 //        assertEquals(dmList3, fc.watchers.get(dst));
 //        assertNull(fc.watchers.get(dst2));
-//        
-//        EasyMock.verify(zk);       
+//
+//        EasyMock.verify(zk);
 //    }
 //
 //    public void testAddingServiceFilter() {
 //        DiscoveredServiceTracker dst = new DiscoveredServiceTracker() {
 //            public void serviceChanged(DiscoveredServiceNotification dsn) {}
 //        };
-//        
+//
 //        ServiceReference sr = EasyMock.createMock(ServiceReference.class);
-//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA)).
-//            andReturn(null);
+//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA))
+//            .andReturn(null);
 //        Set<String> stringFilter = Collections.singleton("(objectClass=java.lang.String)");
-//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA)).
-//            andReturn(stringFilter);
+//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA))
+//            .andReturn(stringFilter);
 //        EasyMock.replay(sr);
-//        
+//
 //        DiscoveredServiceTracker dst2 = new DiscoveredServiceTracker() {
 //            public void serviceChanged(DiscoveredServiceNotification dsn) {}
 //        };
-//        
+//
 //        ServiceReference sr2 = EasyMock.createMock(ServiceReference.class);
-//        EasyMock.expect(sr2.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA)).
-//            andReturn(null);
-//        List<String> combinedFilter = 
-//            Arrays.asList("(objectClass=java.lang.Integer)","(objectClass=java.lang.Comparable)");
-//        EasyMock.expect(sr2.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA)).
-//            andReturn(combinedFilter);
+//        EasyMock.expect(sr2.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA))
+//            .andReturn(null);
+//        List<String> combinedFilter =
+//            Arrays.asList("(objectClass=java.lang.Integer)", "(objectClass=java.lang.Comparable)");
+//        EasyMock.expect(sr2.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA))
+//            .andReturn(combinedFilter);
 //        EasyMock.replay(sr2);
-//        
+//
 //        BundleContext bc = EasyMock.createMock(BundleContext.class);
 //        EasyMock.expect(bc.getService(sr)).andReturn(dst);
 //        EasyMock.expect(bc.getService(sr2)).andReturn(dst2);
 //        EasyMock.replay(bc);
-//        
+//
 //        ZooKeeper zk = EasyMock.createMock(ZooKeeper.class);
 //        zkExpectExists(zk, String.class.getName());
 //        zkExpectExists(zk, Integer.class.getName());
 //        zkExpectExists(zk, Comparable.class.getName());
 //        EasyMock.expectLastCall();
 //        EasyMock.replay(zk);
-//        
+//
 //        FindInZooKeeperCustomizer fc = new FindInZooKeeperCustomizer(bc, zk);
 //
 //        // ---------------------------------------------------------------
 //        // Test the addingService APIs
 //        // ---------------------------------------------------------------
-//        
+//
 //        assertEquals("Precondition failed", 0, fc.watchers.size());
 //        fc.addingService(sr);
 //        assertEquals(1, fc.watchers.size());
-//        
+//
 //        DiscoveredServiceTracker key = fc.watchers.keySet().iterator().next();
 //        assertSame(dst, key);
 //        List<InterfaceMonitor> dmList = fc.watchers.get(key);
@@ -199,12 +199,12 @@ public class FindInZooKeeperCustomizerTest extends TestCase {
 //        InterfaceMonitor dm = dmList.iterator().next();
 //        assertNotNull(dm.listener);
 //        assertSame(zk, dm.zookeeper);
-//        assertEquals(Util.getZooKeeperPath(String.class.getName()), dm.znode);        
+//        assertEquals(Util.getZooKeeperPath(String.class.getName()), dm.znode);
 //
 //        assertEquals("Precondition failed", 1, fc.watchers.size());
 //        fc.addingService(sr2);
 //        assertEquals(2, fc.watchers.size());
-//        
+//
 //        assertTrue(fc.watchers.containsKey(dst));
 //        assertTrue(fc.watchers.containsKey(dst2));
 //        assertEquals(dmList, fc.watchers.get(dst));
@@ -215,10 +215,10 @@ public class FindInZooKeeperCustomizerTest extends TestCase {
 //            actual.add(im.znode);
 //        }
 //        Set<String> expected = new HashSet<String>(Arrays.asList(
-//                Util.getZooKeeperPath(Integer.class.getName()), 
+//                Util.getZooKeeperPath(Integer.class.getName()),
 //                Util.getZooKeeperPath(Comparable.class.getName())));
 //        assertEquals(expected, actual);
-//        
+//
 //        EasyMock.verify(zk);
 //
 //        // ---------------------------------------------------------------
@@ -227,19 +227,19 @@ public class FindInZooKeeperCustomizerTest extends TestCase {
 //        EasyMock.reset(zk);
 //        zkExpectExists(zk, List.class.getName());
 //        EasyMock.replay(zk);
-//        
+//
 //        EasyMock.reset(sr);
 //        Set<String> listFilter = Collections.singleton("(objectClass=java.util.List)");
-//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA)).
-//            andReturn(null);
-//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA)).
-//            andReturn(listFilter);
+//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA))
+//            .andReturn(null);
+//        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.FILTER_MATCH_CRITERIA))
+//            .andReturn(listFilter);
 //        EasyMock.replay(sr);
-//        
+//
 //        assertEquals("Precondition failed", 2, fc.watchers.size());
 //        fc.modifiedService(sr, dst);
 //        assertEquals("Precondition failed", 2, fc.watchers.size());
-//        
+//
 //        assertTrue(fc.watchers.containsKey(dst));
 //        assertTrue(fc.watchers.containsKey(dst2));
 //        assertEquals(dmList2, fc.watchers.get(dst2));
@@ -247,55 +247,55 @@ public class FindInZooKeeperCustomizerTest extends TestCase {
 //        assertEquals(1, dmList3.size());
 //        assertEquals(Util.getZooKeeperPath(List.class.getName()), dmList3.iterator().next().znode);
 //
-//        EasyMock.verify(zk);       
+//        EasyMock.verify(zk);
 //
 //        // ---------------------------------------------------------------
 //        // Test the removedService APIs
 //        // ---------------------------------------------------------------
 //        EasyMock.reset(zk);
 //        EasyMock.replay(zk);
-//        
+//
 //        assertEquals("Precondition failed", 2, fc.watchers.size());
 //        fc.removedService(sr2, dst2);
 //        assertEquals("Precondition failed", 1, fc.watchers.size());
-//        
+//
 //        assertEquals(dmList3, fc.watchers.get(dst));
 //        assertNull(fc.watchers.get(dst2));
-//        
-//        EasyMock.verify(zk);       
+//
+//        EasyMock.verify(zk);
 //    }
-//    
+//
 //    public void testGetInterfacesFromFilter() {
 //        testGetInterfacesFromFilter("objectClass=org.apache_2.Some$FunnyClass",
 //                "org.apache_2.Some$FunnyClass");
-//        testGetInterfacesFromFilter("(&(a=b)(objectClass = org.acme.Q)", 
+//        testGetInterfacesFromFilter("(&(a=b)(objectClass = org.acme.Q)",
 //                "org.acme.Q");
-//        testGetInterfacesFromFilter("(&(objectClassIdentifier=b)(objectClass = org.acme.Q)", 
+//        testGetInterfacesFromFilter("(&(objectClassIdentifier=b)(objectClass = org.acme.Q)",
 //                "org.acme.Q");
-//        testGetInterfacesFromFilter("(|(OBJECTCLASS=   X  )(objectclass = Y)", 
+//        testGetInterfacesFromFilter("(|(OBJECTCLASS=   X  )(objectclass = Y)",
 //                "X", "Y");
-//        testGetInterfacesFromFilter(new String [] {"(objectClass=X)", "(objectClass=Y)"}, 
+//        testGetInterfacesFromFilter(new String[] {"(objectClass=X)", "(objectClass=Y)"},
 //                "X", "Y");
 //    }
 //
 //    private void testGetInterfacesFromFilter(String filter, String ... interfaces) {
-//        testGetInterfacesFromFilter(new String [] {filter}, interfaces);
+//        testGetInterfacesFromFilter(new String[] {filter}, interfaces);
 //    }
-//    
-//    private void testGetInterfacesFromFilter(String [] filters, String ... interfaces) {
+//
+//    private void testGetInterfacesFromFilter(String[] filters, String ... interfaces) {
 //        FindInZooKeeperCustomizer.getInterfacesFromFilter(Arrays.asList(filters));
 //    }
 //
 //    private void zkExpectExists(ZooKeeper zk, String className) {
-//        zk.exists(EasyMock.eq(Util.getZooKeeperPath(className)), 
-//                (Watcher) EasyMock.anyObject(), 
+//        zk.exists(EasyMock.eq(Util.getZooKeeperPath(className)),
+//                (Watcher) EasyMock.anyObject(),
 //                (StatCallback) EasyMock.anyObject(), EasyMock.isNull());
 //        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
 //            public Object answer() throws Throwable {
 //                assertEquals(EasyMock.getCurrentArguments()[1],
 //                        EasyMock.getCurrentArguments()[2]);
 //                return null;
-//            }            
+//            }
 //        });
 //    }
 }
index 267bb13..caa738e 100644 (file)
@@ -21,28 +21,28 @@ package org.apache.cxf.dosgi.discovery.zookeeper;
 import junit.framework.TestCase;
 
 public class InterfaceDataMonitorListenerImplTest extends TestCase {
-    
+
     public void testDUMMY() {
         assertTrue(true);
     }
-    
+
 //    public void testChange() throws Exception {
 //        final List<DiscoveredServiceNotification> dsnCallbacks = new ArrayList<DiscoveredServiceNotification>();
 //        DiscoveredServiceTracker dst = new DiscoveredServiceTracker() {
 //            public void serviceChanged(DiscoveredServiceNotification dsn) {
 //                dsnCallbacks.add(dsn);
-//            }            
+//            }
 //        };
-//        
+//
 //        //----------------------------------------------------------------
 //        // Test DiscoveredServiceNotification.AVAILABLE
 //        //----------------------------------------------------------------
 //        Properties initial = new Properties();
-//        initial.put("a", "b");     
+//        initial.put("a", "b");
 //        initial.put(ServicePublication.ENDPOINT_LOCATION, "http://somehost:12345/some/context");
 //        ByteArrayOutputStream propBytes = new ByteArrayOutputStream();
 //        initial.store(propBytes, "");
-//        
+//
 //        ZooKeeper zk = EasyMock.createMock(ZooKeeper.class);
 //        EasyMock.expect(zk.getChildren(Util.getZooKeeperPath(String.class.getName()), false))
 //            .andReturn(Arrays.asList("x#y#z"));
@@ -51,7 +51,7 @@ public class InterfaceDataMonitorListenerImplTest extends TestCase {
 //        EasyMock.replay(zk);
 //
 //        InterfaceDataMonitorListenerImpl dml = new InterfaceDataMonitorListenerImpl(zk, String.class.getName(), dst);
-//        
+//
 //        assertEquals("Precondition failed", 0, dsnCallbacks.size());
 //        dml.change();
 //        assertEquals(1, dsnCallbacks.size());
@@ -60,16 +60,16 @@ public class InterfaceDataMonitorListenerImplTest extends TestCase {
 //        assertEquals(DiscoveredServiceNotification.AVAILABLE, dsn.getType());
 //        assertEquals(0, dsn.getFilters().size());
 //        ServiceEndpointDescription sed = dsn.getServiceEndpointDescription();
-//        assertEquals(Collections.singleton(String.class.getName()), sed.getProvidedInterfaces());    
-//        
+//        assertEquals(Collections.singleton(String.class.getName()), sed.getProvidedInterfaces());
+//
 //        Properties expected = new Properties();
 //        expected.load(new ByteArrayInputStream(propBytes.toByteArray()));
 //        expected.put("service.exported.configs", "org.apache.cxf.ws");
 //        expected.put("org.apache.cxf.ws.address", "http://somehost:12345/some/context");
-//        
+//
 //        assertEquals(expected, sed.getProperties());
 //        EasyMock.verify(zk);
-//        
+//
 //        // Again with the same data
 //        EasyMock.reset(zk);
 //        EasyMock.expect(zk.getChildren(Util.getZooKeeperPath(String.class.getName()), false))
@@ -82,7 +82,7 @@ public class InterfaceDataMonitorListenerImplTest extends TestCase {
 //        assertEquals("Precondition failed", 0, dsnCallbacks.size());
 //        dml.change();
 //        assertEquals(0, dsnCallbacks.size());
-//        
+//
 //        EasyMock.verify(zk);
 //        //----------------------------------------------------------------
 //        // Test DiscoveredServiceNotification.MODIFIED
@@ -93,7 +93,7 @@ public class InterfaceDataMonitorListenerImplTest extends TestCase {
 //        modified.put("service.exported.configs", "org.apache.cxf.rs");
 //        ByteArrayOutputStream modBytes = new ByteArrayOutputStream();
 //        modified.store(modBytes, "");
-//        
+//
 //        EasyMock.reset(zk);
 //        EasyMock.expect(zk.getChildren(Util.getZooKeeperPath(String.class.getName()), false))
 //            .andReturn(Arrays.asList("x#y#z"));
@@ -110,9 +110,9 @@ public class InterfaceDataMonitorListenerImplTest extends TestCase {
 //        assertEquals(DiscoveredServiceNotification.MODIFIED, dsn2.getType());
 //        assertEquals(0, dsn2.getFilters().size());
 //        ServiceEndpointDescription sed2 = dsn2.getServiceEndpointDescription();
-//        assertEquals(Collections.singleton(String.class.getName()), sed2.getProvidedInterfaces());        
+//        assertEquals(Collections.singleton(String.class.getName()), sed2.getProvidedInterfaces());
 //        assertEquals(modified, sed2.getProperties());
-//        
+//
 //        EasyMock.verify(zk);
 //
 //        //----------------------------------------------------------------
@@ -125,7 +125,7 @@ public class InterfaceDataMonitorListenerImplTest extends TestCase {
 //        modified2.put("org.apache.cxf.ws.address", "http://somewhereelse/123");
 //        ByteArrayOutputStream modBytes2 = new ByteArrayOutputStream();
 //        modified2.store(modBytes2, "");
-//        
+//
 //        EasyMock.reset(zk);
 //        EasyMock.expect(zk.getChildren(Util.getZooKeeperPath(String.class.getName()), false))
 //            .andReturn(Arrays.asList("x#y#z"));
@@ -142,9 +142,9 @@ public class InterfaceDataMonitorListenerImplTest extends TestCase {
 //        assertEquals(DiscoveredServiceNotification.MODIFIED, dsn3.getType());
 //        assertEquals(0, dsn3.getFilters().size());
 //        ServiceEndpointDescription sed3 = dsn3.getServiceEndpointDescription();
-//        assertEquals(Collections.singleton(String.class.getName()), sed3.getProvidedInterfaces());        
+//        assertEquals(Collections.singleton(String.class.getName()), sed3.getProvidedInterfaces());
 //        assertEquals(modified2, sed3.getProperties());
-//        
+//
 //        EasyMock.verify(zk);
 //        //----------------------------------------------------------------
 //        // Test DiscoveredServiceNotification.UNAVAILABLE
@@ -163,11 +163,11 @@ public class InterfaceDataMonitorListenerImplTest extends TestCase {
 //        assertEquals(DiscoveredServiceNotification.UNAVAILABLE, dsn4.getType());
 //        assertEquals(0, dsn4.getFilters().size());
 //        ServiceEndpointDescription sed4 = dsn4.getServiceEndpointDescription();
-//        assertEquals(Collections.singleton(String.class.getName()), sed4.getProvidedInterfaces());        
+//        assertEquals(Collections.singleton(String.class.getName()), sed4.getProvidedInterfaces());
 //        assertEquals(modified2, sed4.getProperties());
-//        
+//
 //        EasyMock.verify(zk);
-//        
+//
 //        // Try the same again...
 //        EasyMock.reset(zk);
 //        EasyMock.expect(zk.getChildren(Util.getZooKeeperPath(String.class.getName()), false))
index b15ff93..206b30c 100644 (file)
@@ -34,49 +34,47 @@ import org.osgi.framework.ServiceReference;
 import static org.junit.Assert.assertEquals;
 
 public class InterfaceMonitorManagerTest {
-    
+
     @Test
     public void testEndpointListenerTrackerCustomizer() {
-        
         IMocksControl c = EasyMock.createNiceControl();
-        
+
         BundleContext ctx = c.createMock(BundleContext.class);
         ZooKeeper zk = c.createMock(ZooKeeper.class);
-        
+
         ServiceReference sref = c.createMock(ServiceReference.class);
         ServiceReference sref2 = c.createMock(ServiceReference.class);
-        
+
         final Map<String, ?> p = new HashMap<String, Object>();
-        
+
         EasyMock.expect(sref.getPropertyKeys()).andAnswer(new IAnswer<String[]>() {
             public String[] answer() throws Throwable {
                 return p.keySet().toArray(new String[p.size()]);
             }
         }).anyTimes();
-        
+
         EasyMock.expect(sref.getProperty((String)EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 String key = (String)(EasyMock.getCurrentArguments()[0]);
                 return p.get(key);
             }
         }).anyTimes();
-        
+
         EasyMock.expect(sref2.getPropertyKeys()).andAnswer(new IAnswer<String[]>() {
             public String[] answer() throws Throwable {
                 return p.keySet().toArray(new String[p.size()]);
             }
         }).anyTimes();
-        
+
         EasyMock.expect(sref2.getProperty((String)EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 String key = (String)(EasyMock.getCurrentArguments()[0]);
                 return p.get(key);
             }
         }).anyTimes();
-        
-        
+
         final List<IMocksControl> controls = new ArrayList<IMocksControl>();
-        
+
         InterfaceMonitorManager eltc = new InterfaceMonitorManager(ctx, zk) {
             protected InterfaceMonitor createInterfaceMonitor(String scope, String objClass, Interest interest) {
                 IMocksControl lc = EasyMock.createNiceControl();
@@ -90,64 +88,61 @@ public class InterfaceMonitorManagerTest {
                 return im;
             }
         };
-        
+
         c.replay();
-        
+
         // sref has no scope -> nothing should happen
-        
+
         assertEquals(0, eltc.getHandledEndpointListeners().size());
         assertEquals(0, eltc.getInterestingScopes().size());
-        
+
         //p.put(EndpointListener.ENDPOINT_LISTENER_SCOPE, );
-        
-        eltc.addInterest(sref, "(objectClass=mine)", "mine"); 
-        
+
+        eltc.addInterest(sref, "(objectClass=mine)", "mine");
+
         assertEquals(1, eltc.getHandledEndpointListeners().size());
         assertEquals(1, eltc.getHandledEndpointListeners().get(sref).size());
         assertEquals("(objectClass=mine)", eltc.getHandledEndpointListeners().get(sref).get(0));
         assertEquals(1, eltc.getInterestingScopes().size());
-        
-        
+
         eltc.addInterest(sref, "(objectClass=mine)", "mine");
-        
+
         assertEquals(1, eltc.getHandledEndpointListeners().size());
         assertEquals(1, eltc.getHandledEndpointListeners().get(sref).size());
         assertEquals("(objectClass=mine)", eltc.getHandledEndpointListeners().get(sref).get(0));
         assertEquals(1, eltc.getInterestingScopes().size());
-        
+
         eltc.addInterest(sref2, "(objectClass=mine)", "mine");
-        
+
         assertEquals(2, eltc.getHandledEndpointListeners().size());
         assertEquals(1, eltc.getHandledEndpointListeners().get(sref).size());
         assertEquals(1, eltc.getHandledEndpointListeners().get(sref2).size());
         assertEquals("(objectClass=mine)", eltc.getHandledEndpointListeners().get(sref).get(0));
         assertEquals("(objectClass=mine)", eltc.getHandledEndpointListeners().get(sref2).get(0));
         assertEquals(1, eltc.getInterestingScopes().size());
-        
-        
+
         eltc.removeInterest(sref);
-        
+
         assertEquals(1, eltc.getHandledEndpointListeners().size());
         assertEquals(1, eltc.getHandledEndpointListeners().get(sref2).size());
         assertEquals("(objectClass=mine)", eltc.getHandledEndpointListeners().get(sref2).get(0));
         assertEquals(1, eltc.getInterestingScopes().size());
-        
+
         eltc.removeInterest(sref);
-        
+
         assertEquals(1, eltc.getHandledEndpointListeners().size());
         assertEquals(1, eltc.getHandledEndpointListeners().get(sref2).size());
         assertEquals("(objectClass=mine)", eltc.getHandledEndpointListeners().get(sref2).get(0));
         assertEquals(1, eltc.getInterestingScopes().size());
-        
+
         eltc.removeInterest(sref2);
-        
+
         assertEquals(0, eltc.getHandledEndpointListeners().size());
         assertEquals(0, eltc.getInterestingScopes().size());
-        
+
         c.verify();
         for (IMocksControl control : controls) {
             control.verify();
         }
     }
-    
 }
index 01b30ac..7dd99ca 100644 (file)
@@ -18,7 +18,6 @@
  */
 package org.apache.cxf.dosgi.discovery.zookeeper;
 
-
 import java.util.Collections;
 
 import junit.framework.TestCase;
@@ -39,7 +38,6 @@ import static org.easymock.EasyMock.expect;
 public class InterfaceMonitorTest extends TestCase {
 
     public void testInterfaceMonitor() throws KeeperException, InterruptedException {
-
         IMocksControl c = EasyMock.createControl();
 
         ZooKeeper zk = c.createMock(ZooKeeper.class);
index 3f5bddc..fcab227 100644 (file)
@@ -30,9 +30,9 @@ import org.osgi.service.remoteserviceadmin.EndpointListener;
 public class UtilTest extends TestCase {
 
     public void testGetZooKeeperPath() {
-        assertEquals(Util.PATH_PREFIX + '/' + "org/example/Test", 
+        assertEquals(Util.PATH_PREFIX + '/' + "org/example/Test",
             Util.getZooKeeperPath("org.example.Test"));
-        
+
         // used for the recursive discovery
         assertEquals(Util.PATH_PREFIX, Util.getZooKeeperPath(null));
         assertEquals(Util.PATH_PREFIX, Util.getZooKeeperPath(""));
@@ -43,11 +43,11 @@ public class UtilTest extends TestCase {
         String[] out = Util.getStringPlusProperty("MyString");
         assertEquals(1, out.length);
         assertEquals("MyString", out[0]);
-        
+
         out = Util.getStringPlusProperty(new String[]{"MyString"});
         assertEquals(1, out.length);
         assertEquals("MyString", out[0]);
-        
+
         out = Util.getStringPlusProperty(Arrays.asList("MyString"));
         assertEquals(1, out.length);
         assertEquals("MyString", out[0]);
@@ -89,23 +89,22 @@ public class UtilTest extends TestCase {
         assertEquals("hi", out[0]);
         assertEquals("bye", out[1]);
     }
-    
+
     public void testGetScopes() {
         IMocksControl c = EasyMock.createNiceControl();
-        
+
         String[] scopes = new String[]{"myScope=test", ""};
-        
+
         ServiceReference sref = c.createMock(ServiceReference.class);
         EasyMock.expect(sref.getProperty(EasyMock.eq(EndpointListener.ENDPOINT_LISTENER_SCOPE)))
             .andReturn(scopes).anyTimes();
-        
+
         c.replay();
-        
+
         String[] ret = Util.getScopes(sref);
-        
+
         c.verify();
         assertEquals(1, ret.length);
         assertEquals(scopes[0], ret[0]);
-        
     }
 }
index f1d51c5..f545a66 100644 (file)
@@ -38,5 +38,5 @@
       <module>zookeeper-server</module>
       <module>zookeeper-server-config</module>
       <module>cxf-discovery</module>
-    </modules> 
+    </modules>
 </project>
index 6328ee0..232e028 100644 (file)
     <properties>
         <topDirectoryLocation>../../..</topDirectoryLocation>
     </properties>
-    
+
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.enterprise</artifactId>
         </dependency>
 
-        <dependency> 
+        <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.framework</artifactId>
             <version>${felix.version}</version>
                     <artifactId>org.osgi.foundation</artifactId>
                 </exclusion>
             </exclusions>
-        </dependency>    
+        </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-        </dependency>      
-    </dependencies> 
+        </dependency>
+    </dependencies>
 
     <build>
         <plugins>
@@ -77,7 +77,7 @@
                         <Export-Package />
                     </instructions>
                 </configuration>
-            </plugin> 
+            </plugin>
         </plugins>
-    </build>    
+    </build>
 </project>
index 03f8dff..9a1beed 100644 (file)
@@ -34,6 +34,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class Activator implements BundleActivator {
+
     private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
     private static final String ZOOKEEPER_PORT = "org.apache.cxf.dosgi.discovery.zookeeper.port";
     private static final String PID = "org.apache.cxf.dosgi.discovery.zookeeper.server";
@@ -48,7 +49,7 @@ public class Activator implements BundleActivator {
                 LOG.info("Global zookeeper port: {}", port);
             }
         }
-        
+
         st = new ServiceTracker(context, ConfigurationAdmin.class.getName(), null) {
             @Override
             public Object addingService(ServiceReference reference) {
@@ -67,12 +68,12 @@ public class Activator implements BundleActivator {
                     }
                 }
                 return svc;
-            }            
+            }
         };
         st.open();
-        
+
         // The following section is done synchronously otherwise it doesn't happen in time for the CT
-        ServiceReference[] refs = context.getServiceReferences(ManagedService.class.getName(), 
+        ServiceReference[] refs = context.getServiceReferences(ManagedService.class.getName(),
                 "(service.pid=org.apache.cxf.dosgi.discovery.zookeeper)");
         if (refs == null || refs.length == 0) {
             throw new RuntimeException("This bundle must be started after the bundle with the Zookeeper "
@@ -93,7 +94,7 @@ public class Activator implements BundleActivator {
         }
         LOG.debug("Passed the zookeeper.host property to the Zookeeper Client managed service.");
     }
-    
+
     private String getFreePort() {
         try {
             ServerSocket ss = new ServerSocket(0);
@@ -104,8 +105,8 @@ public class Activator implements BundleActivator {
             LOG.error("Failed to find a free port!", e);
             return null;
         }
-    }    
-    
+    }
+
     public void stop(BundleContext context) throws Exception {
         st.close();
     }
index ea64c30..976394e 100644 (file)
@@ -34,7 +34,7 @@
     <properties>
         <topDirectoryLocation>../../..</topDirectoryLocation>
     </properties>
-    
+
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
             <exclusions>
                 <exclusion>
                    <groupId>com.sun.jdmk</groupId>
-                   <artifactId>jmxtools</artifactId> 
+                   <artifactId>jmxtools</artifactId>
                 </exclusion>
                 <exclusion>
                    <groupId>com.sun.jmx</groupId>
-                   <artifactId>jmxri</artifactId> 
+                   <artifactId>jmxri</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
-        
+
         <!--  We need the newer log4j as the one from zookeeper has some ugly dependencies -->
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
             <version>${log4j.version}</version>
         </dependency>
-        
+
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
-        </dependency>  
+        </dependency>
         <dependency>
             <groupId>org.easymock</groupId>
             <artifactId>easymockclassextension</artifactId>
             <scope>test</scope>
-        </dependency> 
-    </dependencies> 
+        </dependency>
+    </dependencies>
 
     <build>
         <plugins>
@@ -96,7 +96,7 @@
                         <Export-Package />
                     </instructions>
                 </configuration>
-            </plugin> 
+            </plugin>
         </plugins>
-    </build>    
+    </build>
 </project>
index 4858b02..6adf700 100644 (file)
@@ -26,6 +26,7 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 
 public class Activator implements BundleActivator {
+
     ZookeeperStarter zkStarter;
 
     public void start(BundleContext context) throws Exception {
@@ -34,7 +35,7 @@ public class Activator implements BundleActivator {
         props.put(Constants.SERVICE_PID, "org.apache.cxf.dosgi.discovery.zookeeper.server");
         context.registerService(org.osgi.service.cm.ManagedService.class.getName(), zkStarter, props);
     }
-    
+
     public void stop(BundleContext context) throws Exception {
         if (zkStarter != null) {
             zkStarter.shutdown();
index 02fffeb..9207b67 100644 (file)
@@ -37,6 +37,7 @@ import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.ConfigurationException;
 
 public class ZookeeperStarter implements org.osgi.service.cm.ManagedService {
+
     private static final Logger LOG = Logger.getLogger(ZookeeperStarter.class); //NOPMD - using log4j here
 
     protected ZookeeperServer main;
@@ -74,7 +75,7 @@ public class ZookeeperStarter implements org.osgi.service.cm.ManagedService {
 
     /**
      * Remove empty values to avoid NumberFormatExceptions
-     * 
+     *
      * @param dict
      */
     private void removeEmptyValues(Dictionary<String, Object> dict) {
@@ -145,13 +146,14 @@ public class ZookeeperStarter implements org.osgi.service.cm.ManagedService {
         });
         zkMainThread.start();
     }
-    
+
     interface ZookeeperServer {
         void startup() throws IOException;
         void shutdown();
     }
 
     static class MyQuorumPeerMain extends QuorumPeerMain implements ZookeeperServer {
+
         private QuorumPeerConfig config;
 
         public MyQuorumPeerMain(QuorumPeerConfig config) {
@@ -170,12 +172,13 @@ public class ZookeeperStarter implements org.osgi.service.cm.ManagedService {
     }
 
     static class MyZooKeeperServerMain extends ZooKeeperServerMain implements ZookeeperServer {
+
         private QuorumPeerConfig config;
 
         public MyZooKeeperServerMain(QuorumPeerConfig config) {
             this.config = config;
         }
-        
+
         public void startup() throws IOException {
             ServerConfig serverConfig = new ServerConfig();
             serverConfig.readFrom(config);
@@ -190,5 +193,4 @@ public class ZookeeperStarter implements org.osgi.service.cm.ManagedService {
             }
         }
     }
-
 }
index 4b3895a..17ca117 100644 (file)
@@ -35,6 +35,7 @@ import static org.easymock.classextension.EasyMock.replay;
 import static org.easymock.classextension.EasyMock.verify;
 
 public class ZookeeperStarterTest extends TestCase {
+
     public void testUpdateConfig() throws Exception {
         final File tempDir = new File("target");
         IMocksControl control = EasyMock.createControl();
@@ -42,9 +43,8 @@ public class ZookeeperStarterTest extends TestCase {
         expect(bc.getDataFile("")).andReturn(tempDir);
         final MyZooKeeperServerMain mockServer = control.createMock(MyZooKeeperServerMain.class);
         control.replay();
-        
-        ZookeeperStarter starter = new ZookeeperStarter(bc) {
 
+        ZookeeperStarter starter = new ZookeeperStarter(bc) {
             @Override
             protected void startFromConfig(QuorumPeerConfig config) {
                 assertEquals(1234, config.getClientPortAddress().getPort());
@@ -54,7 +54,6 @@ public class ZookeeperStarterTest extends TestCase {
                 assertEquals(5, config.getSyncLimit());
                 this.main = mockServer;
             }
-
         };
         Dictionary<String, Object> props = new Hashtable<String, Object>();
         props.put("clientPort", "1234");
@@ -63,21 +62,20 @@ public class ZookeeperStarterTest extends TestCase {
 
         control.verify();
     }
-    
+
     public void testRemoveConfiguration() throws Exception {
         BundleContext bc = EasyMock.createMock(BundleContext.class);
         MyZooKeeperServerMain zkServer = EasyMock.createMock(MyZooKeeperServerMain.class);
         zkServer.shutdown();
         EasyMock.expectLastCall();
-        
+
         replay(zkServer);
 
         ZookeeperStarter starter = new ZookeeperStarter(bc);
         starter.main = zkServer;
         starter.updated(null);
-        
+
         verify(zkServer);
         assertNull("main should be null", starter.main);
     }
-
 }
index df153da..1917e57 100644 (file)
@@ -49,19 +49,15 @@ import org.osgi.service.remoteserviceadmin.EndpointDescription;
 import org.osgi.service.remoteserviceadmin.RemoteConstants;\r
 import org.slf4j.LoggerFactory;\r
 \r
-\r
 public final class LocalDiscoveryUtils {\r
-    private static final org.slf4j.Logger LOG =\r
-        LoggerFactory.getLogger(LocalDiscoveryUtils.class);\r
 \r
-    private static final String REMOTE_SERVICES_HEADER_NAME = "Remote-Service";\r
-    private static final String REMOTE_SERVICES_DIRECTORY =\r
-        "OSGI-INF/remote-service/";\r
-    private static final String REMOTE_SERVICES_NS =\r
-        "http://www.osgi.org/xmlns/sd/v1.0.0"; // this one was replaced by the RSA one in the spec\r
-    private static final String REMOTE_SERVICES_ADMIN_NS =\r
-        "http://www.osgi.org/xmlns/rsa/v1.0.0";\r
+    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(LocalDiscoveryUtils.class);\r
 \r
+    private static final String REMOTE_SERVICES_HEADER_NAME = "Remote-Service";\r
+    private static final String REMOTE_SERVICES_DIRECTORY = "OSGI-INF/remote-service/";\r
+    // this one was replaced by the RSA one in the spec\r
+    private static final String REMOTE_SERVICES_NS = "http://www.osgi.org/xmlns/sd/v1.0.0";\r
+    private static final String REMOTE_SERVICES_ADMIN_NS = "http://www.osgi.org/xmlns/rsa/v1.0.0";\r
 \r
     private static final String SERVICE_DESCRIPTION_ELEMENT = "service-description";\r
     private static final String ENDPOINT_DESCRIPTION_ELEMENT = "endpoint-description";\r
@@ -503,15 +499,15 @@ public final class LocalDiscoveryUtils {
         return new XMLOutputter(Format.getPrettyFormat()).outputString(d);\r
     }\r
 \r
-    private static Object [] normalizeArray(Object val) {\r
+    private static Object[] normalizeArray(Object val) {\r
         List<Object> l = new ArrayList<Object>();\r
         if (val instanceof int[]) {\r
-            int[] ia = (int []) val;\r
+            int[] ia = (int[]) val;\r
             for (int i : ia) {\r
                 l.add(i);\r
             }\r
         } else if (val instanceof long[]) {\r
-            long[] la = (long []) val;\r
+            long[] la = (long[]) val;\r
             for (long i : la) {\r
                 l.add(i);\r
             }\r
@@ -521,27 +517,27 @@ public final class LocalDiscoveryUtils {
                 l.add(f);\r
             }\r
         } else if (val instanceof byte[]) {\r
-            byte[] ba = (byte []) val;\r
+            byte[] ba = (byte[]) val;\r
             for (byte b : ba) {\r
                 l.add(b);\r
             }\r
         } else if (val instanceof boolean[]) {\r
-            boolean[] ba = (boolean []) val;\r
+            boolean[] ba = (boolean[]) val;\r
             for (boolean b : ba) {\r
                 l.add(b);\r
             }\r
         } else if (val instanceof short[]) {\r
-            short[] sa = (short []) val;\r
+            short[] sa = (short[]) val;\r
             for (short s : sa) {\r
                 l.add(s);\r
             }\r
         } else if (val instanceof char[]) {\r
-            char[] ca = (char []) val;\r
+            char[] ca = (char[]) val;\r
             for (char c : ca) {\r
                 l.add(c);\r
             }\r
         } else {\r
-            return (Object []) val;\r
+            return (Object[]) val;\r
         }\r
         return l.toArray();\r
     }\r
@@ -569,7 +565,6 @@ public final class LocalDiscoveryUtils {
 \r
     @SuppressWarnings("unchecked")\r
     public static List<Element> getElements(InputStream in) throws JDOMException, IOException {\r
-\r
         List<Element> elements = new ArrayList<Element>();\r
 \r
         Document d = new SAXBuilder().build(in);\r
index 4880735..918f009 100644 (file)
@@ -28,7 +28,7 @@ public class Activator implements BundleActivator {
     private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
 
     LocalDiscovery localDiscovery;
-    
+
     public synchronized void start(BundleContext context) {
         localDiscovery = new LocalDiscovery(context);
         LOG.info("Local D-OSGi service discovery started");
index 6dacdde..dc5a043 100644 (file)
@@ -41,16 +41,17 @@ import org.osgi.util.tracker.ServiceTracker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class LocalDiscovery implements BundleListener {   
+public class LocalDiscovery implements BundleListener {
+
     private static final Logger LOG = LoggerFactory.getLogger(LocalDiscovery.class);
-    
+
     // this is effectively a set which allows for multiple service descriptions with the
-    // same interface name but different properties and takes care of itself with respect to concurrency 
-    ConcurrentHashMap<EndpointDescription, Bundle> endpointDescriptions = 
+    // same interface name but different properties and takes care of itself with respect to concurrency
+    ConcurrentHashMap<EndpointDescription, Bundle> endpointDescriptions =
         new ConcurrentHashMap<EndpointDescription, Bundle>();
-    Map<EndpointListener, Collection<String>> listenerToFilters = 
+    Map<EndpointListener, Collection<String>> listenerToFilters =
         new HashMap<EndpointListener, Collection<String>>();
-    Map<String, Collection<EndpointListener>> filterToListeners = 
+    Map<String, Collection<EndpointListener>> filterToListeners =
         new HashMap<String, Collection<EndpointListener>>();
     final BundleContext bundleContext;
 
@@ -58,7 +59,7 @@ public class LocalDiscovery implements BundleListener {
 
     public LocalDiscovery(BundleContext bc) {
         bundleContext = bc;
-        
+
         listenerTracker = new ServiceTracker(bundleContext, EndpointListener.class.getName(), null) {
 
             @Override
@@ -72,7 +73,7 @@ public class LocalDiscovery implements BundleListener {
             public void modifiedService(ServiceReference reference, Object service) {
                 super.modifiedService(reference, service);
                 clearTracker(service);
-                
+
                 // This may cause duplicate registrations of remote services,
                 // but that's fine and should be filtered out on another level.
                 // See Remove Service Admin spec section 122.6.3
@@ -84,20 +85,19 @@ public class LocalDiscovery implements BundleListener {
                 super.removedService(reference, service);
                 clearTracker(service);
             }
-            
         };
         listenerTracker.open();
-        
+
         bundleContext.addBundleListener(this);
         processExistingBundles();
     }
 
     private void processExistingBundles() {
-        Bundle [] bundles = bundleContext.getBundles();
+        Bundle[] bundles = bundleContext.getBundles();
         if (bundles == null) {
             return;
         }
-        
+
         for (Bundle b : bundles) {
             if (b.getState() == Bundle.ACTIVE) {
                 findDeclaredRemoteServices(b);
@@ -117,7 +117,7 @@ public class LocalDiscovery implements BundleListener {
         if (svc instanceof EndpointListener) {
             EndpointListener listener = (EndpointListener) svc;
             removeListener(listener);
-            // If the tracker was removed or the scope was changed this doesn't require 
+            // If the tracker was removed or the scope was changed this doesn't require
             // additional callbacks on the tracker. Its the responsibility of the tracker
             // itself to clean up any orphans. See Remote Service Admin spec 122.6.3
         }
@@ -125,12 +125,12 @@ public class LocalDiscovery implements BundleListener {
 
     private Collection<String> addListener(ServiceReference reference,
             EndpointListener listener) {
-        List<String> filters = 
+        List<String> filters =
             LocalDiscoveryUtils.getStringPlusProperty(reference, EndpointListener.ENDPOINT_LISTENER_SCOPE);
         if (filters.isEmpty()) {
             return filters;
         }
-        
+
         listenerToFilters.put(listener, filters);
         for (String filter : filters) {
             Collection<EndpointListener> listeners = filterToListeners.get(filter);
@@ -142,22 +142,22 @@ public class LocalDiscovery implements BundleListener {
                 filterToListeners.put(filter, list);
             }
         }
-        
+
         return filters;
     }
-    
+
     private void removeListener(EndpointListener listener) {
         Collection<String> filters = listenerToFilters.remove(listener);
         if (filters == null) {
             return;
         }
-        
+
         for (String filter : filters) {
             Collection<EndpointListener> listeners = filterToListeners.get(filter);
             if (listeners != null) {
                 listeners.remove(listener);
             }
-        }        
+        }
     }
 
     public void shutDown() {
@@ -218,37 +218,37 @@ public class LocalDiscovery implements BundleListener {
         if (!filterMatches(toMatch, ed)) {
             return;
         }
-        
+
         if (added) {
             listener.endpointAdded(ed, toMatch);
         } else {
             listener.endpointRemoved(ed, toMatch);
         }
     }
-    
+
     private void triggerCallbacks(Collection<String> filters, EndpointListener listener) {
         for (String filter : filters) {
             for (EndpointDescription ed : endpointDescriptions.keySet()) {
                 triggerCallbacks(listener, filter, ed, true);
             }
         }
-    }    
+    }
 
     private boolean filterMatches(String match, EndpointDescription ed) {
         Filter filter = createFilter(match);
         return filter != null && filter.match(new Hashtable<String, Object>(ed.getProperties()));
-    } 
-    
-    private Filter createFilter(String filterValue) {        
+    }
+
+    private Filter createFilter(String filterValue) {
         if (filterValue == null) {
             return null;
         }
-        
+
         try {
-            return bundleContext.createFilter(filterValue); 
+            return bundleContext.createFilter(filterValue);
         } catch (Exception ex) {
-            LOG.error("Problem creating a Filter from " + filterValue, ex); 
+            LOG.error("Problem creating a Filter from " + filterValue, ex);
         }
         return null;
-    }    
+    }
 }
index e901426..068a49d 100644 (file)
@@ -49,6 +49,7 @@ import org.osgi.service.remoteserviceadmin.EndpointDescription;
 import org.osgi.service.remoteserviceadmin.RemoteConstants;
 
 public class LocalDiscoveryUtilsTest extends TestCase {
+
     private static final String LF = "\n";
 
     public void testNoRemoteServicesXMLFiles() {
@@ -152,10 +153,10 @@ public class LocalDiscoveryUtilsTest extends TestCase {
         assertEquals('@', props.get("char"));
         assertEquals('X', props.get("Character2"));
 
-        int [] intArray = (int []) props.get("int-array");
+        int[] intArray = (int[]) props.get("int-array");
         assertTrue(Arrays.equals(new int[] {1, 2}, intArray));
 
-        Integer [] integerArray = (Integer []) props.get("Integer-array");
+        Integer[] integerArray = (Integer[]) props.get("Integer-array");
         assertTrue(Arrays.equals(new Integer[] {2, 1}, integerArray));
 
         assertEquals(Arrays.asList(true, false), props.get("bool-list"));
@@ -222,7 +223,7 @@ public class LocalDiscoveryUtilsTest extends TestCase {
         Map<String, Object> m = new LinkedHashMap<String, Object>();
         m.put("service.imported.configs", "org.apache.cxf.ws");
         m.put("endpoint.id", "foo:bar");
-        m.put("objectClass", new String [] {"com.acme.HelloService", "some.other.Service"});
+        m.put("objectClass", new String[] {"com.acme.HelloService", "some.other.Service"});
         m.put("SomeObject", new Object());
         m.put("long", 9223372036854775807L);
         m.put("Long2", -1L);
@@ -255,9 +256,9 @@ public class LocalDiscoveryUtilsTest extends TestCase {
         int[] intArray = new int[] {1, 2};
         m.put("int-array", intArray);
 
-        String xml = "<xml>" + LF 
-            + "<t1 xmlns=\"http://www.acme.org/xmlns/other/v1.0.0\">" + LF 
-            +     "<foo type='bar'>haha</foo>" + LF
+        String xml = "<xml>" + LF
+            + "<t1 xmlns=\"http://www.acme.org/xmlns/other/v1.0.0\">" + LF
+            + "<foo type='bar'>haha</foo>" + LF
             + "</t1>" + LF
             + "</xml>";
         m.put("someXML", xml);
@@ -273,7 +274,7 @@ public class LocalDiscoveryUtilsTest extends TestCase {
         String s2 = stripComment(s);
         String s3 = stripProlog(s2);
         Document d = new SAXBuilder().build(new ByteArrayInputStream(s3.getBytes()));
-        XMLOutputter outputter  = new XMLOutputter(Format.getPrettyFormat());
+        XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
         return outputter.outputString(d);
     }
 
@@ -304,7 +305,7 @@ public class LocalDiscoveryUtilsTest extends TestCase {
         }
     }
 
-    public static byte [] drainStream(InputStream is) throws IOException {
+    public static byte[] drainStream(InputStream is) throws IOException {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try {
             drainStream(is, baos);
@@ -313,5 +314,4 @@ public class LocalDiscoveryUtilsTest extends TestCase {
             is.close();
         }
     }
-
 }
index 7e9fdc8..a0bdc87 100644 (file)
@@ -27,25 +27,26 @@ import org.osgi.framework.Filter;
 import org.osgi.framework.FrameworkUtil;
 
 public class ActivatorTest extends TestCase {
+
     public void testActivator() throws Exception {
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
-        EasyMock.expect(bc.createFilter((String) EasyMock.anyObject())).andAnswer(new IAnswer<Filter>() {            
-            public Filter answer() throws Throwable {                
+        EasyMock.expect(bc.createFilter((String) EasyMock.anyObject())).andAnswer(new IAnswer<Filter>() {
+            public Filter answer() throws Throwable {
                 return FrameworkUtil.createFilter((String) EasyMock.getCurrentArguments()[0]);
             }
         }).anyTimes();
         EasyMock.replay(bc);
-        
+
         Activator a = new Activator();
         a.start(bc);
         assertNotNull(a.localDiscovery);
-        
+
         a.localDiscovery = EasyMock.createMock(LocalDiscovery.class);
         a.localDiscovery.shutDown();
         EasyMock.expectLastCall();
         EasyMock.replay(a.localDiscovery);
         a.stop(bc);
-        
+
         EasyMock.verify(a.localDiscovery);
     }
 }
index 9a155b2..d586f77 100644 (file)
@@ -48,20 +48,21 @@ import org.osgi.service.remoteserviceadmin.EndpointDescription;
 import org.osgi.service.remoteserviceadmin.EndpointListener;
 
 public class LocalDiscoveryTest extends TestCase {
+
     public void testLocalDiscovery() throws Exception {
         Filter filter = EasyMock.createMock(Filter.class);
         EasyMock.replay(filter);
-        
+
         BundleContext bc = EasyMock.createMock(BundleContext.class);
         EasyMock.expect(bc.createFilter("(objectClass=org.osgi.service.remoteserviceadmin.EndpointListener)"))
             .andReturn(filter);
-        bc.addServiceListener((ServiceListener) EasyMock.anyObject(), 
+        bc.addServiceListener((ServiceListener) EasyMock.anyObject(),
             EasyMock.eq("(objectClass=org.osgi.service.remoteserviceadmin.EndpointListener)"));
         EasyMock.expectLastCall();
         EasyMock.expect(bc.getServiceReferences("org.osgi.service.remoteserviceadmin.EndpointListener", null))
             .andReturn(null);
         bc.addBundleListener((BundleListener) EasyMock.anyObject());
-        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {            
+        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 assertEquals(LocalDiscovery.class, EasyMock.getCurrentArguments()[0].getClass());
                 return null;
@@ -69,15 +70,15 @@ public class LocalDiscoveryTest extends TestCase {
         });
         EasyMock.expect(bc.getBundles()).andReturn(null);
         EasyMock.replay(bc);
-                
+
         LocalDiscovery ld = new LocalDiscovery(bc);
         assertSame(bc, ld.bundleContext);
-        assertNotNull(ld.listenerTracker);        
-        
+        assertNotNull(ld.listenerTracker);
+
         EasyMock.verify(bc);
-        
+
         EasyMock.reset(bc);
-        bc.removeBundleListener(ld);        
+        bc.removeBundleListener(ld);
         EasyMock.expectLastCall();
         bc.removeServiceListener((ServiceListener) EasyMock.anyObject());
         EasyMock.expectLastCall();
@@ -86,22 +87,22 @@ public class LocalDiscoveryTest extends TestCase {
         ld.shutDown();
         EasyMock.verify(bc);
     }
-    
+
     public void testPreExistingBundles() throws Exception {
         Filter filter = EasyMock.createMock(Filter.class);
         EasyMock.replay(filter);
-        
+
         BundleContext bc = EasyMock.createMock(BundleContext.class);
         EasyMock.expect(bc.createFilter("(objectClass=org.osgi.service.remoteserviceadmin.EndpointListener)"))
             .andReturn(filter);
-        bc.addServiceListener((ServiceListener) EasyMock.anyObject(), 
+        bc.addServiceListener((ServiceListener) EasyMock.anyObject(),
             EasyMock.eq("(objectClass=org.osgi.service.remoteserviceadmin.EndpointListener)"));
         EasyMock.expectLastCall();
         EasyMock.expect(bc.getServiceReferences("org.osgi.service.remoteserviceadmin.EndpointListener", null))
             .andReturn(null);
         bc.addBundleListener((BundleListener) EasyMock.anyObject());
         EasyMock.expectLastCall();
-        
+
         Bundle b1 = EasyMock.createMock(Bundle.class);
         EasyMock.expect(b1.getState()).andReturn(Bundle.RESOLVED);
         EasyMock.replay(b1);
@@ -110,19 +111,19 @@ public class LocalDiscoveryTest extends TestCase {
         Dictionary<String, Object> headers = new Hashtable<String, Object>();
         headers.put("Remote-Service", "OSGI-INF/remote-service/");
         EasyMock.expect(b2.getHeaders()).andReturn(headers);
-        
+
         URL rs3URL = getClass().getResource("/ed3.xml");
-        URL rs4URL = getClass().getResource("/ed4.xml");        
+        URL rs4URL = getClass().getResource("/ed4.xml");
         List<URL> urls = Arrays.asList(rs3URL, rs4URL);
         EasyMock.expect(b2.findEntries("OSGI-INF/remote-service", "*.xml", false))
             .andReturn(Collections.enumeration(urls));
         EasyMock.replay(b2);
-        
-        EasyMock.expect(bc.getBundles()).andReturn(new Bundle [] {b1, b2});
+
+        EasyMock.expect(bc.getBundles()).andReturn(new Bundle[] {b1, b2});
         EasyMock.replay(bc);
-                
+
         LocalDiscovery ld = new LocalDiscovery(bc);
-                
+
         assertEquals(3, ld.endpointDescriptions.size());
         Set<String> expected = new HashSet<String>(
                 Arrays.asList("http://somewhere:12345", "http://somewhere:1", "http://somewhere"));
@@ -133,7 +134,7 @@ public class LocalDiscoveryTest extends TestCase {
         }
         assertEquals(expected, actual);
     }
-    
+
     public void testBundleChanged() throws Exception {
         LocalDiscovery ld = getLocalDiscovery();
 
@@ -147,21 +148,21 @@ public class LocalDiscoveryTest extends TestCase {
             .andReturn(Collections.enumeration(
                 Collections.singleton(getClass().getResource("/ed3.xml"))));
         EasyMock.replay(bundle);
-                
+
         BundleEvent be0 = new BundleEvent(BundleEvent.INSTALLED, bundle);
         ld.bundleChanged(be0);
         assertEquals(0, ld.endpointDescriptions.size());
-        
+
         // Create an EndpointListener
         final Map<String, Object> props = new Hashtable<String, Object>();
         props.put(EndpointListener.ENDPOINT_LISTENER_SCOPE, "(objectClass=*)");
         ServiceReference sr = EasyMock.createMock(ServiceReference.class);
-        EasyMock.expect(sr.getPropertyKeys()).andReturn(props.keySet().toArray(new String [] {})).anyTimes();
+        EasyMock.expect(sr.getPropertyKeys()).andReturn(props.keySet().toArray(new String[] {})).anyTimes();
         EasyMock.expect(sr.getProperty((String) EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return props.get(EasyMock.getCurrentArguments()[0]);
             }
-        }).anyTimes();                
+        }).anyTimes();
         EasyMock.replay(sr);
 
         EndpointListener el = EasyMock.createMock(EndpointListener.class);
@@ -169,7 +170,7 @@ public class LocalDiscoveryTest extends TestCase {
         EasyMock.expectLastCall();
         EasyMock.replay(el);
         ld.registerTracker(sr, el);
-        
+
         // Start the bundle
         BundleEvent be = new BundleEvent(BundleEvent.STARTED, bundle);
         ld.bundleChanged(be);
@@ -177,7 +178,7 @@ public class LocalDiscoveryTest extends TestCase {
         EndpointDescription ed = ld.endpointDescriptions.keySet().iterator().next();
         assertEquals("http://somewhere:12345", ed.getId());
         assertSame(bundle, ld.endpointDescriptions.get(ed));
-        
+
         EasyMock.verify(el);
 
         // Stop the bundle
@@ -185,14 +186,14 @@ public class LocalDiscoveryTest extends TestCase {
         el.endpointRemoved((EndpointDescription) EasyMock.anyObject(), EasyMock.eq("(objectClass=*)"));
         EasyMock.expectLastCall();
         EasyMock.replay(el);
-        
+
         BundleEvent be1 = new BundleEvent(BundleEvent.STOPPED, bundle);
         ld.bundleChanged(be1);
         assertEquals(0, ld.endpointDescriptions.size());
-        
+
         EasyMock.verify(el);
     }
-    
+
     public void testEndpointListenerService() throws Exception {
         LocalDiscovery ld = getLocalDiscovery();
 
@@ -205,23 +206,23 @@ public class LocalDiscoveryTest extends TestCase {
             .andReturn(Collections.enumeration(
                 Collections.singleton(getClass().getResource("/ed4.xml"))));
         EasyMock.replay(bundle);
-                        
+
         BundleEvent be = new BundleEvent(BundleEvent.STARTED, bundle);
         ld.bundleChanged(be);
-        assertEquals(2, ld.endpointDescriptions.size());        
+        assertEquals(2, ld.endpointDescriptions.size());
 
         final Map<String, Object> props = new Hashtable<String, Object>();
-        props.put(EndpointListener.ENDPOINT_LISTENER_SCOPE, new String [] {"(objectClass=org.example.ClassA)"});
+        props.put(EndpointListener.ENDPOINT_LISTENER_SCOPE, new String[] {"(objectClass=org.example.ClassA)"});
         ServiceReference sr = EasyMock.createMock(ServiceReference.class);
-        EasyMock.expect(sr.getPropertyKeys()).andReturn(props.keySet().toArray(new String [] {})).anyTimes();
+        EasyMock.expect(sr.getPropertyKeys()).andReturn(props.keySet().toArray(new String[] {})).anyTimes();
         EasyMock.expect(sr.getProperty((String) EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return props.get(EasyMock.getCurrentArguments()[0]);
             }
         }).anyTimes();
-                
+
         EasyMock.replay(sr);
-        
+
         EasyMock.reset(ld.bundleContext);
         EndpointListener el = EasyMock.createMock(EndpointListener.class);
         EasyMock.expect(ld.bundleContext.getService(sr)).andReturn(el);
@@ -232,32 +233,32 @@ public class LocalDiscoveryTest extends TestCase {
             }
         }).anyTimes();
         EasyMock.replay(ld.bundleContext);
-        
-        el.endpointAdded((EndpointDescription) EasyMock.anyObject(), 
+
+        el.endpointAdded((EndpointDescription) EasyMock.anyObject(),
                 EasyMock.eq("(objectClass=org.example.ClassA)"));
         EasyMock.expectLastCall();
         EasyMock.replay(el);
-        
+
         // Add the EndpointListener Service
         assertEquals("Precondition failed", 0, ld.listenerToFilters.size());
-        assertEquals("Precondition failed", 0, ld.filterToListeners.size());        
+        assertEquals("Precondition failed", 0, ld.filterToListeners.size());
         assertSame(el, ld.listenerTracker.addingService(sr));
-        
+
         assertEquals(1, ld.listenerToFilters.size());
         assertEquals(Collections.singletonList("(objectClass=org.example.ClassA)"), ld.listenerToFilters.get(el));
-        assertEquals(1, ld.filterToListeners.size()); 
+        assertEquals(1, ld.filterToListeners.size());
         assertEquals(Collections.singletonList(el), ld.filterToListeners.get("(objectClass=org.example.ClassA)"));
 
         EasyMock.verify(el);
-        
+
         // Modify the EndpointListener Service
         // no need to reset the mock for this...
         props.put(EndpointListener.ENDPOINT_LISTENER_SCOPE,
                   "(|(objectClass=org.example.ClassA)(objectClass=org.example.ClassB))");
-        
+
         EasyMock.reset(el);
         final Set<String> actualEndpoints = new HashSet<String>();
-        el.endpointAdded((EndpointDescription) EasyMock.anyObject(), 
+        el.endpointAdded((EndpointDescription) EasyMock.anyObject(),
                 EasyMock.eq("(|(objectClass=org.example.ClassA)(objectClass=org.example.ClassB))"));
         EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
@@ -270,17 +271,17 @@ public class LocalDiscoveryTest extends TestCase {
 
         ld.listenerTracker.modifiedService(sr, el);
         assertEquals(1, ld.listenerToFilters.size());
-        assertEquals(Arrays.asList("(|(objectClass=org.example.ClassA)(objectClass=org.example.ClassB))"), 
+        assertEquals(Arrays.asList("(|(objectClass=org.example.ClassA)(objectClass=org.example.ClassB))"),
             ld.listenerToFilters.get(el));
-        assertEquals(2, ld.filterToListeners.size()); 
-        assertEquals(Collections.singletonList(el), 
+        assertEquals(2, ld.filterToListeners.size());
+        assertEquals(Collections.singletonList(el),
             ld.filterToListeners.get("(|(objectClass=org.example.ClassA)(objectClass=org.example.ClassB))"));
         assertEquals(0, ld.filterToListeners.get("(objectClass=org.example.ClassA)").size());
-        
+
         EasyMock.verify(el);
         Set<String> expectedEndpoints = new HashSet<String>(Arrays.asList("org.example.ClassA", "org.example.ClassB"));
         assertEquals(expectedEndpoints, actualEndpoints);
-        
+
         // Remove the EndpointListener Service
         ld.listenerTracker.removedService(sr, el);
         assertEquals(0, ld.listenerToFilters.size());
@@ -289,41 +290,41 @@ public class LocalDiscoveryTest extends TestCase {
         assertEquals(0, valIter.next().size());
         assertEquals(0, valIter.next().size());
     }
-    
+
     public void testRegisterTracker() throws Exception {
         LocalDiscovery ld = getLocalDiscovery();
 
         final Map<String, Object> props = new Hashtable<String, Object>();
         props.put(EndpointListener.ENDPOINT_LISTENER_SCOPE, "(objectClass=Aaaa)");
         ServiceReference sr = EasyMock.createMock(ServiceReference.class);
-        EasyMock.expect(sr.getPropertyKeys()).andReturn(props.keySet().toArray(new String [] {})).anyTimes();
+        EasyMock.expect(sr.getPropertyKeys()).andReturn(props.keySet().toArray(new String[] {})).anyTimes();
         EasyMock.expect(sr.getProperty((String) EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return props.get(EasyMock.getCurrentArguments()[0]);
             }
-        }).anyTimes();                
+        }).anyTimes();
         EasyMock.replay(sr);
 
         EndpointListener el = EasyMock.createMock(EndpointListener.class);
         EasyMock.replay(el);
-        
+
         assertEquals("Precondition failed", 0, ld.listenerToFilters.size());
         assertEquals("Precondition failed", 0, ld.filterToListeners.size());
         ld.registerTracker(sr, el);
-        
+
         assertEquals(1, ld.listenerToFilters.size());
         assertEquals(Collections.singletonList("(objectClass=Aaaa)"), ld.listenerToFilters.get(el));
         assertEquals(1, ld.filterToListeners.size());
         assertEquals(Collections.singletonList(el), ld.filterToListeners.get("(objectClass=Aaaa)"));
-        
+
         // Add another one with the same scope filter
         ServiceReference sr2 = EasyMock.createMock(ServiceReference.class);
-        EasyMock.expect(sr2.getPropertyKeys()).andReturn(props.keySet().toArray(new String [] {})).anyTimes();
+        EasyMock.expect(sr2.getPropertyKeys()).andReturn(props.keySet().toArray(new String[] {})).anyTimes();
         EasyMock.expect(sr2.getProperty((String) EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return props.get(EasyMock.getCurrentArguments()[0]);
             }
-        }).anyTimes();                
+        }).anyTimes();
         EasyMock.replay(sr2);
 
         EndpointListener el2 = EasyMock.createMock(EndpointListener.class);
@@ -333,20 +334,20 @@ public class LocalDiscoveryTest extends TestCase {
         assertEquals(2, ld.listenerToFilters.size());
         assertEquals(Collections.singletonList("(objectClass=Aaaa)"), ld.listenerToFilters.get(el));
         assertEquals(Collections.singletonList("(objectClass=Aaaa)"), ld.listenerToFilters.get(el2));
-        
+
         assertEquals(1, ld.filterToListeners.size());
         assertEquals(Arrays.asList(el, el2), ld.filterToListeners.get("(objectClass=Aaaa)"));
-        
+
         // Add another listener with a multi-value scope
         final Map<String, Object> props2 = new Hashtable<String, Object>();
         props2.put(EndpointListener.ENDPOINT_LISTENER_SCOPE, Arrays.asList("(objectClass=X)", "(objectClass=Y)"));
         ServiceReference sr3 = EasyMock.createMock(ServiceReference.class);
-        EasyMock.expect(sr3.getPropertyKeys()).andReturn(props2.keySet().toArray(new String [] {})).anyTimes();
+        EasyMock.expect(sr3.getPropertyKeys()).andReturn(props2.keySet().toArray(new String[] {})).anyTimes();
         EasyMock.expect(sr3.getProperty((String) EasyMock.anyObject())).andAnswer(new IAnswer<Object>() {
             public Object answer() throws Throwable {
                 return props2.get(EasyMock.getCurrentArguments()[0]);
             }
-        }).anyTimes();                
+        }).anyTimes();
         EasyMock.replay(sr3);
 
         EndpointListener el3 = EasyMock.createMock(EndpointListener.class);
@@ -363,17 +364,17 @@ public class LocalDiscoveryTest extends TestCase {
         assertEquals(Collections.singletonList(el3), ld.filterToListeners.get("(objectClass=X)"));
         assertEquals(Collections.singletonList(el3), ld.filterToListeners.get("(objectClass=Y)"));
     }
-    
+
     public void testClearTracker() throws Exception {
         LocalDiscovery ld = getLocalDiscovery();
-        
+
         EndpointListener el = EasyMock.createMock(EndpointListener.class);
         ld.listenerToFilters.put(el, new ArrayList<String>(Arrays.asList("(a=b)", "(objectClass=foo.bar.Bheuaark)")));
         ld.filterToListeners.put("(a=b)", new ArrayList<EndpointListener>(Arrays.asList(el)));
         ld.filterToListeners.put("(objectClass=foo.bar.Bheuaark)", new ArrayList<EndpointListener>(Arrays.asList(el)));
-                        
+
         ld.clearTracker("foobar"); // should not barf
-        
+
         assertEquals(1, ld.listenerToFilters.size());
         assertEquals(2, ld.filterToListeners.size());
         assertEquals(1, ld.filterToListeners.values().iterator().next().size());
@@ -382,10 +383,10 @@ public class LocalDiscoveryTest extends TestCase {
         assertEquals(2, ld.filterToListeners.size());
         assertEquals(1, ld.filterToListeners.values().iterator().next().size());
         ld.clearTracker(el);
-        assertEquals(0, ld.listenerToFilters.size());        
+        assertEquals(0, ld.listenerToFilters.size());
         assertEquals(2, ld.filterToListeners.size());
         assertEquals(0, ld.filterToListeners.values().iterator().next().size());
-    }    
+    }
 
     private LocalDiscovery getLocalDiscovery() throws InvalidSyntaxException {
         BundleContext bc = EasyMock.createMock(BundleContext.class);
@@ -394,7 +395,7 @@ public class LocalDiscoveryTest extends TestCase {
                 return FrameworkUtil.createFilter((String) EasyMock.getCurrentArguments()[0]);
             }
         }).anyTimes();
-        bc.addServiceListener((ServiceListener) EasyMock.anyObject(), 
+        bc.addServiceListener((ServiceListener) EasyMock.anyObject(),
             EasyMock.eq("(objectClass=org.osgi.service.remoteserviceadmin.EndpointListener)"));
         EasyMock.expectLastCall();
         EasyMock.expect(bc.getServiceReferences("org.osgi.service.remoteserviceadmin.EndpointListener", null))
@@ -403,7 +404,7 @@ public class LocalDiscoveryTest extends TestCase {
         EasyMock.expectLastCall();
         EasyMock.expect(bc.getBundles()).andReturn(null);
         EasyMock.replay(bc);
-                
+
         return new LocalDiscovery(bc);
-    }    
+    }
 }
index 0412ede..95b1994 100644 (file)
     <property name="osgi.remote.requires.intents">
       <list>
         <value>confidentiality</value>
-      </list>    
+      </list>
     </property>
     <property name="testKey" value="testValue"/>
     <property name="endpoint.id">http://somewhere:12345</property>
     <property name="service.imported.configs" value="org.apache.cxf.ws"/>
   </endpoint-description>
-  
+
   <endpoint-description>
     <property name="objectClass">
       <array>
@@ -70,4 +70,3 @@
     <property name="service.imported.configs" value="org.apache.cxf.ws"/>
   </endpoint-description>
 </endpoint-descriptions>
-  
index 5cb571a..5f67241 100644 (file)
@@ -26,7 +26,7 @@
     <property name="Short2" value-type="Short" value="-99"/>\r
     <property name="char" value-type="Character" value="@"/>\r
     <property name="Character2" value-type="Character" value="X"/>\r
-    \r
+\r
     <property name="bool-list" value-type="Boolean">\r
       <list>\r
         <value>true</value>\r
@@ -48,6 +48,6 @@
         <value>2</value>\r
       </array>\r
     </property>\r
-    <property name="someXML" value="&lt;xml&gt;&#xA;&lt;t1 xmlns=&quot;http://www.acme.org/xmlns/other/v1.0.0&quot;&gt;&#xA;&lt;foo type='bar'&gt;haha&lt;/foo&gt;&#xA;&lt;/t1&gt;&#xA;&lt;/xml&gt;"/>   \r
+    <property name="someXML" value="&lt;xml&gt;&#xA;&lt;t1 xmlns=&quot;http://www.acme.org/xmlns/other/v1.0.0&quot;&gt;&#xA;&lt;foo type='bar'&gt;haha&lt;/foo&gt;&#xA;&lt;/t1&gt;&#xA;&lt;/xml&gt;"/>\r
   </endpoint-description>\r
 </endpoint-descriptions>\r
index 7e8568e..e3c42b9 100644 (file)
@@ -20,7 +20,7 @@
         <value>some.other.Service</value>
       </array>
     </property>
-    
+
     <property name="someXML" value-type="String">
       <!-- Literal XML to be parsed into the String -->
       <xml>
@@ -46,7 +46,7 @@
     <property name="Short2" value-type="Short" value="-99"/>
     <property name="char" value-type="char">@</property>
     <property name="Character2" value-type="Character" value="X"/>
-    
+
     <property name="bool-list" value-type="boolean">
       <list>
         <value>true</value>
@@ -80,7 +80,7 @@
 
     <property name="other1">
         Hello
-      <other:t1/>        
+      <other:t1/>
       <!-- the above tag is a custom extension -->
     </property>
     <property name="other2">
           <!-- A value specified as literal XML -->
           <xml>
             <other:t2/>
-          </xml>        
+          </xml>
         </value>
       </list>
       <!-- This is a custom extension -->
-      <other:t1/>                    
-    </property>    
+      <other:t1/>
+    </property>
   </endpoint-description>
 </endpoint-descriptions>
index 55f6c28..7d4d681 100644 (file)
@@ -30,4 +30,3 @@
     <property name="service.imported.configs" value="org.apache.cxf.ws"/>
   </endpoint-description>
 </endpoint-descriptions>
-  
index e21c0fb..cef5d18 100644 (file)
@@ -41,4 +41,3 @@
     <property name="service.imported.configs" value="org.apache.cxf.ws"/>
   </endpoint-description>
 </endpoint-descriptions>
-  
index 43e214b..4830a60 100644 (file)
@@ -37,6 +37,5 @@
       <module>local</module>
       <module>distributed</module>
     </modules>
-    
 
 </project>
index 6b3b34f..dc77c89 100644 (file)
@@ -8,12 +8,12 @@
         <feature>cxf-jaxrs</feature>
         <feature>cxf-databinding-aegis</feature>
         <feature>cxf-http-jetty</feature>
-        <bundle>mvn:org.osgi/org.osgi.enterprise/4.2.0</bundle>        
+        <bundle>mvn:org.osgi/org.osgi.enterprise/4.2.0</bundle>
         <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jdom/1.1_3</bundle>
         <bundle>mvn:${project.groupId}/cxf-dosgi-ri-topology-manager/${project.version}</bundle>
         <bundle>mvn:${project.groupId}/cxf-dosgi-ri-dsw-cxf/${project.version}</bundle>
     </feature>
-    
+
     <feature name="cxf-dosgi-discovery-local" version="${project.version}">
         <feature>cxf-dosgi-core</feature>
         <bundle>mvn:${project.groupId}/cxf-dosgi-ri-discovery-local/${project.version}</bundle>
@@ -25,7 +25,7 @@
         <bundle>mvn:${project.groupId}/cxf-dosgi-ri-discovery-local/${project.version}</bundle>
         <bundle>mvn:${project.groupId}/cxf-dosgi-ri-discovery-distributed/${project.version}</bundle>
     </feature>
-    
+
     <feature name="cxf-dosgi-zookeeper-server">
         <bundle>mvn:org.apache.zookeeper/zookeeper/3.3.1</bundle>
         <bundle>mvn:${project.groupId}/cxf-dosgi-ri-discovery-distributed-zookeeper-server/${project.version}</bundle>
index 4aa0ace..f0a129a 100644 (file)
             <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>org.apache.aries.blueprint.api</artifactId>
             <version>1.0.0</version>
-        </dependency>        
+        </dependency>
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>org.apache.aries.blueprint.core</artifactId>
             <artifactId>org.apache.aries.blueprint.cm</artifactId>
             <version>1.0.1</version>
         </dependency>
-        
 
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-bundle-compatible</artifactId>
             <version>${cxf.version}</version>
-            <!-- <exclusions> <exclusion> <groupId>org.apache.cxf</groupId> 
+            <!-- <exclusions> <exclusion> <groupId>org.apache.cxf</groupId>
                 <artifactId>cxf-rt-transports-jms</artifactId> </exclusion> </exclusions> -->
         </dependency>
 
             <version>${project.version}</version>
         </dependency>
 
-    </dependencies>        
-  
+    </dependencies>
 
   <build>
     <resources>
           </execution>
         </executions>
       </plugin>
-      
 
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
                   <pathelement location="." />
                 </path>
                 <pathconvert targetos="unix" property="current.dir" refid="current.dir.path" />
-                
+
                 <xslt processor="trax" in="target/classes/distro_bundles.xml" out="target/distribution_configs/felix.config.properties.append" style="src/main/xsl/felix_distro_config.xslt">
                     <param name="Version" expression="${dosgi.version}" />
                     <param name="Offset" expression="50" />
                 </xslt>
-                
+
                 <xslt processor="trax" in="target/classes/distro_bundles.xml" out="target/felix.config.properties.append" style="src/main/xsl/felix_buildsystem_config.xslt">
                       <param name="TargetDir" expression="${current.dir}/target/" />
                       <param name="Offset" expression="50" />
                 </xslt>
-                
+
                 <xslt processor="trax" in="target/classes/distro_bundles.xml" out="target/distribution_configs/equinox.config.ini.append" style="src/main/xsl/equinox_distro_config.xslt">
                     <param name="Version" expression="${dosgi.version}" />
                 </xslt>
-                
+
                 <xslt processor="trax" in="target/classes/distro_bundles.xml" out="target/equinox.config.ini.append" style="src/main/xsl/equinox_buildsystem_config.xslt">
                       <param name="TargetDir" expression="${current.dir}/target/" />
                 </xslt>
-                
+
                 <xslt processor="trax" in="target/classes/distro_discovery_bundles.xml" out="target/distribution_configs/felix.discovery.config.properties.append" style="src/main/xsl/felix_distro_config.xslt">
                     <param name="Version" expression="${dosgi.version}" />
                     <param name="Offset" expression="120" />
                 </xslt>
-                
+
                 <xslt processor="trax" in="target/classes/distro_discovery_bundles.xml" out="target/felix.discovery.config.properties.append" style="src/main/xsl/felix_buildsystem_config.xslt">
                       <param name="TargetDir" expression="${current.dir}/target/" />
                       <param name="Offset" expression="120" />
                 </xslt>
-                
+
                 <xslt processor="trax" in="target/classes/distro_discovery_bundles.xml" out="target/distribution_configs/equinox.discovery.config.ini.append" style="src/main/xsl/equinox_distro_config.xslt">
                     <param name="Version" expression="${dosgi.version}" />
                 </xslt>
-                
+
                 <xslt processor="trax" in="target/classes/distro_discovery_bundles.xml" out="target/equinox.discovery.config.ini.append" style="src/main/xsl/equinox_buildsystem_config.xslt">
                       <param name="TargetDir" expression="${current.dir}/target/" />
                 </xslt>
             </goals>
           </execution>
         </executions>
-      </plugin> 
+      </plugin>
     </plugins>
   </build>
 </project>
index 4dac9a7..8569572 100644 (file)
 
 
 The $projectName
-includes a number of components and libraries with separate 
-copyright notices and license terms. Your use of those components are 
-subject to the terms and conditions of the following licenses. 
+includes a number of components and libraries with separate
+copyright notices and license terms. Your use of those components are
+subject to the terms and conditions of the following licenses.
 #set ( $apacheTxt = "The Apache Software License, Version 2.0" )
 
 #foreach ( $project in $projects )
 #foreach ( $license in $project.licenses)
-#if ( ! ($apacheTxt == $license.name) ) 
+#if ( ! ($apacheTxt == $license.name) )
 
 $project.name #if ($project.url)($project.url)#end $project.artifact
     License: $license.name #if ($license.url) ($license.url)#end
index b3e7e5e..9eab472 100644 (file)
@@ -5,9 +5,9 @@ This product also includes schemas and specification developed by:
       - the W3C consortium (http://www.w3c.org)\r
       (http://www.w3.org/XML/1998/namespace)\r
 \r
-      \r
+\r
 This product also includes WS-* schemas developed by International\r
-   Business Machines Corporation, Microsoft Corporation, BEA Systems, \r
+   Business Machines Corporation, Microsoft Corporation, BEA Systems,\r
    TIBCO Software, SAP AG, Sonic Software, and VeriSign\r
    (http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd)\r
    (http://schemas.xmlsoap.org/ws/2004/08/addressing/)\r
index 1b214a8..40d7b0d 100644 (file)
@@ -8,17 +8,17 @@ Compendium Specification, and OSGi Remote Service Admin Specification
 version 1.0, Chapter 122 in the OSGi Enterprise Specification[1].
 
 
-This release is provided for your convenience in three different 
+This release is provided for your convenience in three different
 distribution formats:
 
 1. Multi-bundle distro: cxf-dosgi-ri-multibundle-distribution-1.2.{tar.gaz|zip}
 
-Contains the dOSGi implementation and all 3rd party dependencies as 
+Contains the dOSGi implementation and all 3rd party dependencies as
 separate bundles within an archive. The current distribution is an
 instance of this type. The easiest way to get started is to explode
 this archive into your Felix or Equinox installation tree. Then
 append the contents of the felix.config.properties.append or
-equinox.config.ini.append snippets found in the conf directory to 
+equinox.config.ini.append snippets found in the conf directory to
 your felix.config.properties or equinox.config.ini. This will cause
 all the required bundles to be loaded on start-up. The bundles required
 for the Zookeeper-based Discovery Service implementation are also provided
@@ -30,10 +30,10 @@ equinox.discovery.config.ini.append snippets as appropriate.
 2. Single-bundle distro: cxf-dosgi-ri-singlebundle-distribution-1.2.jar
 
 Contains the dOSGi implementation and all 3rd party dependencies wrapped
-in a single OSGi bundle so as to allow direct installation in your favourite 
+in a single OSGi bundle so as to allow direct installation in your favourite
 OSGi container in one fell swoop.
 
-       
+
 3. Source distro: cxf-dosgi-ri-source-distribution-1.2.{tar.gz|zip}
 
 Contains the entire source tree for dOSGi.
@@ -43,9 +43,9 @@ The best starting point for using dOSGi is the Getting Started Guide[2].
 
 Also note the very detailed walk-through of the greeter demo[3].
 
-If you need more help, or want to provide any feedback, please feel free 
+If you need more help, or want to provide any feedback, please feel free
 to drop us a note on the CXF dev or users list[4].
+
 If you trip over any problems with dOSGi, don't hesitate to submit an issue
 to the CXF JIRA[5] with the component set to "Distributed-OSGi".
 
index 1af027f..8602095 100644 (file)
@@ -26,11 +26,11 @@ Many dependencies have been updated, including the update to CXF 2.5.1. See also
 Additionally, a number of bugs has been fixed including:
 
 DOSGI-108   service.exported.interfaces doesn't support comma-seperated String value
-DOSGI-107   Support for a 'wsdl' configuration type    
-DOSGI-105   Update greeter_rest demo to use OSGI HttpService    
+DOSGI-107   Support for a 'wsdl' configuration type
+DOSGI-105   Update greeter_rest demo to use OSGI HttpService
 DOSGI-103   Improve multi-bundle distro configuration for Felix
 DOSGI-102   DOSGI RI can not map invocation exceptions to custom exceptions on the client side
-DOSGI-97    Automatically unregister HTTP servlets/resources if exported service goes down     
+DOSGI-97    Automatically unregister HTTP servlets/resources if exported service goes down
 DOSGI-94    Enhancement to deal with registered services that might have been proxied
 DOSGI-91    DOSGI RS Proxies ignore ResponseExceptionMapper providers
 DOSGI-85    Unable to export services started after Topology manager
@@ -38,7 +38,7 @@ DOSGI-82    Populate custom servicename, portname and targetnamespace for jax-ws
 DOSGI-79    RemoteServiceAdmin.getImportedEndpoints() returns collection of incorrect type
 DOSGI-77    NullPointerException from Distributed OSGI when bundle with wanted properties is started.
 DOSGI-76    EndpointListener.endpointRemoved
-DOSGI-75    CXF Distributed OSGi isn't using org.apache.cxf.common.logging.LogUtils 
+DOSGI-75    CXF Distributed OSGi isn't using org.apache.cxf.common.logging.LogUtils
 
 
 Apache CXF Distributed OSGi 1.2 Release Notes
@@ -103,7 +103,7 @@ Additionally, a number of bugs has been fixed including:
              version
 [DOSGI-61] - The Zookeeper Discovery only supports primitive types as service
              properties
-[DOSGI-62] - The DSW creates endpoints with localhost URLs 
+[DOSGI-62] - The DSW creates endpoints with localhost URLs
 [DOSGI-66] - The DSW only loads the intent map when certain spring bundles
              are loaded and started upfront
 [DOSGI-67] - Enable filters on DOSGi endpoints
@@ -141,7 +141,7 @@ New features in this release include:
 [CXF-2435] - Distributed OSGi having a problem with a custom type method
              argument
 [CXF-2288] - Bundle cannot be restarted
-[CXF-2385] - Discovery doesn't fully translate 'localhost' into a proper 
+[CXF-2385] - Discovery doesn't fully translate 'localhost' into a proper
              machine name
 [CXF-2200] - Consuming more than 1 service using Spring-DM doesn't work
 
index 8df28a3..14cfb27 100644 (file)
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.servicemix.specs.jaxws-api-2.2-${servicemix.specs.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.servicemix.specs.jsr339-api-m10-${servicemix.specs.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.servicemix.bundles.joda-time-1.5.2_4.jar</bundle>
-  
+
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.aries.util-1.1.0.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.aries.proxy.api-1.0.0.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.aries.proxy.impl-1.0.1.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.aries.blueprint.api-1.0.0.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.aries.blueprint.core-1.1.0.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.aries.blueprint.cm-1.0.1.jar</bundle>
-  
+
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.osgi.enterprise-${osgi.enterprise.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.felix.configadmin-1.6.0.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/org.apache.felix.fileinstall-3.2.6.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-rt-bindings-xml-${cxf.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-rt-bindings-soap-${cxf.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-rt-transports-http-${cxf.version}.jar</bundle>
-  <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-rt-transports-http-jetty-${cxf.version}.jar</bundle>  
+  <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-rt-transports-http-jetty-${cxf.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-rt-ws-policy-${cxf.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-rt-rs-extension-providers-${cxf.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-bundle-compatible-${cxf.version}.jar</bundle>
-  
+
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-dosgi-ri-dsw-cxf-${project.version}.jar</bundle>
   <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-dosgi-ri-topology-manager-${project.version}.jar</bundle>
-  <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-dosgi-ri-discovery-local-${project.version}.jar</bundle>  
+  <bundle>cxf-dosgi-ri-multibundle-distribution-${project.version}-dir/apache-cxf-dosgi-ri-${project.version}/dosgi_bundles/cxf-dosgi-ri-discovery-local-${project.version}.jar</bundle>
 </bundles>
index 4ced1b7..930f48b 100644 (file)
@@ -41,5 +41,5 @@
       <module>features</module>
       <module>multi-bundle</module>
       <module>sources</module>
-    </modules> 
+    </modules>
 </project>
index 34db5e8..172feda 100644 (file)
 
 
 The Apache CXF Distributed OSGi DSW Reference Implementation
-includes a number of components and libraries with separate 
-copyright notices and license terms. Your use of those components are 
-subject to the terms and conditions of the following licenses. 
+includes a number of components and libraries with separate
+copyright notices and license terms. Your use of those components are
+subject to the terms and conditions of the following licenses.
 
 
 AOP alliance (http://aopalliance.sourceforge.net) aopalliance:aopalliance:jar:1.0
-    License: Public Domain 
+    License: Public Domain
 
 Unnamed - asm:asm:jar:2.2.3 (http://asm.objectweb.org/asm/asm) asm:asm:jar:2.2.3:compile
     License: BSD  (http://asm.objectweb.org/license.html)
index ea027d4..f2f7ffe 100644 (file)
@@ -8,12 +8,12 @@ Compendium Specification, and OSGi Remote Service Admin Specification
 version 1.0, Chapter 122 in the OSGi Enterprise Specification[1].
 
 
-This release is provided for your convenience in three different 
+This release is provided for your convenience in three different
 distribution formats:
 
 1. Multi-bundle distro: cxf-dosgi-ri-multibundle-distribution-1.3.{tar.gaz|zip}
 
-Contains the dOSGi implementation and all 3rd party dependencies as 
+Contains the dOSGi implementation and all 3rd party dependencies as
 separate bundles within an archive. The current distribution is an
 instance of this type.
 
@@ -21,7 +21,7 @@ instance of this type.
 2. Single-bundle distro: cxf-dosgi-ri-singlebundle-distribution-1.3.jar
 
 Contains the dOSGi implementation and all 3rd party dependencies wrapped
-in a single OSGi bundle so as to allow direct installation in your favourite 
+in a single OSGi bundle so as to allow direct installation in your favourite
 OSGi container in one fell swoop.
 
 3. Source distro: cxf-dosgi-ri-source-distribution-1.3.{tar.gz|zip}
@@ -37,9 +37,9 @@ The best starting point for using dOSGi is the Getting Started Guide[2].
 
 Also note the very detailed walk-through of the greeter demo[3].
 
-If you need more help, or want to provide any feedback, please feel free 
+If you need more help, or want to provide any feedback, please feel free
 to drop us a note on the CXF dev or users list[4].
+
 If you trip over any problems with dOSGi, don't hesitate to submit an issue
 to the CXF Distributed OSGI JIRA[5].
 
index 05eca4c..0b29007 100644 (file)
@@ -42,11 +42,11 @@ Many dependencies have been updated, including the update to CXF 2.5.1. See also
 Additionally, a number of bugs has been fixed including:
 
 DOSGI-108   service.exported.interfaces doesn't support comma-seperated String value
-DOSGI-107   Support for a 'wsdl' configuration type    
-DOSGI-105   Update greeter_rest demo to use OSGI HttpService    
+DOSGI-107   Support for a 'wsdl' configuration type
+DOSGI-105   Update greeter_rest demo to use OSGI HttpService
 DOSGI-103   Improve multi-bundle distro configuration for Felix
 DOSGI-102   DOSGI RI can not map invocation exceptions to custom exceptions on the client side
-DOSGI-97    Automatically unregister HTTP servlets/resources if exported service goes down     
+DOSGI-97    Automatically unregister HTTP servlets/resources if exported service goes down
 DOSGI-94    Enhancement to deal with registered services that might have been proxied
 DOSGI-91    DOSGI RS Proxies ignore ResponseExceptionMapper providers
 DOSGI-85    Unable to export services started after Topology manager
@@ -54,7 +54,7 @@ DOSGI-82    Populate custom servicename, portname and targetnamespace for jax-ws
 DOSGI-79    RemoteServiceAdmin.getImportedEndpoints() returns collection of incorrect type
 DOSGI-77    NullPointerException from Distributed OSGI when bundle with wanted properties is started.
 DOSGI-76    EndpointListener.endpointRemoved
-DOSGI-75    CXF Distributed OSGi isn't using org.apache.cxf.common.logging.LogUtils 
+DOSGI-75    CXF Distributed OSGi isn't using org.apache.cxf.common.logging.LogUtils
 
 
 Apache CXF Distributed OSGi 1.2 Release Notes
@@ -119,7 +119,7 @@ Additionally, a number of bugs has been fixed including:
              version
 [DOSGI-61] - The Zookeeper Discovery only supports primitive types as service
              properties
-[DOSGI-62] - The DSW creates endpoints with localhost URLs 
+[DOSGI-62] - The DSW creates endpoints with localhost URLs
 [DOSGI-66] - The DSW only loads the intent map when certain spring bundles
              are loaded and started upfront
 [DOSGI-67] - Enable filters on DOSGi endpoints
@@ -157,7 +157,7 @@ New features in this release include:
 [CXF-2435] - Distributed OSGi having a problem with a custom type method
              argument
 [CXF-2288] - Bundle cannot be restarted
-[CXF-2385] - Discovery doesn't fully translate 'localhost' into a proper 
+[CXF-2385] - Discovery doesn't fully translate 'localhost' into a proper
              machine name
 [CXF-2200] - Consuming more than 1 service using Spring-DM doesn't work
 
index 2e56c7c..bade03c 100644 (file)
          <groupId>org.osgi</groupId>
          <artifactId>org.osgi.enterprise</artifactId>
     </dependency>
-    <dependency>  
-        <groupId>org.slf4j</groupId>  
-        <artifactId>slf4j-api</artifactId>  
+    <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-api</artifactId>
     </dependency>
-    <dependency>  
-        <groupId>org.slf4j</groupId>  
-        <artifactId>slf4j-jcl</artifactId>  
+    <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-jcl</artifactId>
     </dependency>
-    
+
     <dependency>
       <groupId>org.jdom</groupId>
       <artifactId>com.springsource.org.jdom</artifactId>
     <dependency>
       <groupId>org.apache.ws.xmlschema</groupId>
       <artifactId>xmlschema-core</artifactId>
-      <version>${xmlschema.bundle.version}</version> 
+      <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> 
+      <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> 
+       <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> 
+      <groupId>org.apache.servicemix.bundles</groupId>
+      <artifactId>org.apache.servicemix.bundles.wsdl4j</artifactId>
       <version>${wsdl4j.bundle.version}</version>
     </dependency>
     <dependency>
-       <groupId>org.apache.servicemix.bundles</groupId> 
-       <artifactId>org.apache.servicemix.bundles.xmlsec</artifactId> 
+       <groupId>org.apache.servicemix.bundles</groupId>
+       <artifactId>org.apache.servicemix.bundles.xmlsec</artifactId>
        <version>${xmlsec.bundle.version}</version>
-    </dependency>  
+    </dependency>
     <dependency>
-       <groupId>org.apache.servicemix.bundles</groupId> 
-       <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId> 
-       <version>${jaxbimpl.bundle.version}</version> 
-    </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> 
+       <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>stax2-api</artifactId> 
-       <version>3.1.1</version> 
+       <groupId>org.codehaus.woodstox</groupId>
+       <artifactId>stax2-api</artifactId>
+       <version>3.1.1</version>
     </dependency>
     <dependency>
-       <groupId>org.codehaus.woodstox</groupId> 
-       <artifactId>woodstox-core-asl</artifactId> 
-       <version>${woodstox.bundle.version}</version> 
+       <groupId>org.codehaus.woodstox</groupId>
+       <artifactId>woodstox-core-asl</artifactId>
+       <version>${woodstox.bundle.version}</version>
     </dependency>
     <dependency>
-       <groupId>org.apache.servicemix.bundles</groupId> 
-       <artifactId>org.apache.servicemix.bundles.commons-pool</artifactId> 
-       <version>${commons.pool.bundle.version}</version> 
+       <groupId>org.apache.servicemix.bundles</groupId>
+       <artifactId>org.apache.servicemix.bundles.commons-pool</artifactId>
+       <version>${commons.pool.bundle.version}</version>
     </dependency>
     <dependency>
-       <groupId>org.apache.servicemix.bundles</groupId> 
+       <groupId>org.apache.servicemix.bundles</groupId>
        <artifactId>org.apache.servicemix.bundles.joda-time</artifactId>
        <version>1.5.2_4</version>
     </dependency>
     <dependency>
-       <groupId>org.apache.servicemix.bundles</groupId> 
+       <groupId>org.apache.servicemix.bundles</groupId>
        <artifactId>org.apache.servicemix.bundles.opensaml</artifactId>
        <version>2.4.1_1</version>
     </dependency>
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.configadmin</artifactId>
       <version>1.2.8</version>
-    </dependency>      
+    </dependency>
     <dependency>
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.fileinstall</artifactId>
       <version>3.1.10</version>
-    </dependency>      
+    </dependency>
 
-    <dependency> 
-      <groupId>org.apache.log4j</groupId> 
-      <artifactId>com.springsource.org.apache.log4j</artifactId> 
+    <dependency>
+      <groupId>org.apache.log4j</groupId>
+      <artifactId>com.springsource.org.apache.log4j</artifactId>
       <version>${log4j.version}</version>
     </dependency>
     <dependency>
             <exclusions>
                 <exclusion>
                    <groupId>com.sun.jdmk</groupId>
-                   <artifactId>jmxtools</artifactId> 
+                   <artifactId>jmxtools</artifactId>
                 </exclusion>
                 <exclusion>
                    <groupId>com.sun.jmx</groupId>
-                   <artifactId>jmxri</artifactId> 
+                   <artifactId>jmxri</artifactId>
                 </exclusion>
                 <exclusion>
                    <groupId>log4j</groupId>
-                   <artifactId>log4j</artifactId> 
+                   <artifactId>log4j</artifactId>
                 </exclusion>
             </exclusions>
     </dependency>
         <artifactId>cxf-dosgi-ri-discovery-distributed-zookeeper-server-config</artifactId>
         <version>${project.version}</version>
     </dependency>
-    
-  </dependencies>        
-  
+
+  </dependencies>
 
   <build>
     <resources>
           </execution>
         </executions>
       </plugin>
-      <!-- Since the assembly plugin has no way to output to an .esa file extension use the antrun 
+      <!-- Since the assembly plugin has no way to output to an .esa file extension use the antrun
            plugin to copy the file to one with the proper extension -->
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
             </goals>
           </execution>
         </executions>
-      </plugin>     
+      </plugin>
       <!-- Attach the .esa file to the project so that it ends up in the repo -->
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
index 6e67996..c0daf6c 100644 (file)
       <scope>runtime</scope>
       <useTransitiveDependencies>false</useTransitiveDependencies>
       <excludes>
-        <!-- Exclude the current artifact as it doesn't contribute anything other than the 
+        <!-- Exclude the current artifact as it doesn't contribute anything other than the
              logic to build the subsystem. -->
         <exclude>org.apache.cxf.dosgi:cxf-dosgi-ri-subsystem-distribution</exclude>
       </excludes>
     </dependencySet>
   </dependencySets>
 </assembly>
-
-
index 68b6beb..88d2641 100644 (file)
@@ -51,6 +51,7 @@ import org.slf4j.LoggerFactory;
 
 // registered as spring bean -> start / stop called accordingly
 public class Activator implements ManagedService, BundleActivator {
+
     private static final int DEFAULT_INTENT_TIMEOUT = 30000;
     private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
     private static final String CONFIG_SERVICE_PID = "cxf-dsw";
@@ -85,14 +86,14 @@ public class Activator implements ManagedService, BundleActivator {
         Dictionary<String, Object> props = new Hashtable<String, Object>();
         String[] supportedIntents = intentMap.keySet().toArray(new String[] {});
         props.put("remote.intents.supported", supportedIntents);
-        props.put("remote.configs.supported", 
+        props.put("remote.configs.supported",
                   obtainSupportedConfigTypes(configTypeHandlerFactory.getSupportedConfigurationTypes()));
         LOG.info("Registering RemoteServiceAdminFactory...");
         rsaFactoryReg = bc.registerService(RemoteServiceAdmin.class.getName(), rsaf, props);
         decoratorReg = bc.registerService(ServiceDecorator.class.getName(), new ServiceDecoratorImpl(bc), null);
     }
 
-    // The CT sometimes uses the first element returned to register a service, but 
+    // The CT sometimes uses the first element returned to register a service, but
     // does not provide any additional configuration.
     // Return the configuration type that works without additional configuration as the first in the list.
     private String[] obtainSupportedConfigTypes(List<String> types) {
index 62ff44d..4d27447 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.cxf.dosgi.dsw;
 import org.osgi.service.remoteserviceadmin.RemoteConstants;
 
 public final class Constants {
+
     // Constants from RFC 119, they should ultimately be picked up from an OSGi class.
     @Deprecated
     public static final String EXPORTED_INTERFACES = RemoteConstants.SERVICE_EXPORTED_INTERFACES;
@@ -30,23 +31,23 @@ public final class Constants {
     @Deprecated
     public static final String EXPORTED_CONFIGS = RemoteConstants.SERVICE_EXPORTED_CONFIGS;
     @Deprecated
-    public static final String EXPORTED_CONFIGS_OLD = "osgi.remote.configuration.type"; // for BW comp.
-    
+    public static final String EXPORTED_CONFIGS_OLD = "osgi.remote.configuration.type"; // for BW compatibility
+
     @Deprecated
     public static final String EXPORTED_INTENTS = RemoteConstants.SERVICE_EXPORTED_INTENTS;
     @Deprecated
     public static final String EXPORTED_INTENTS_EXTRA = RemoteConstants.SERVICE_EXPORTED_INTENTS_EXTRA;
     @Deprecated
     public static final String EXPORTED_INTENTS_OLD = "osgi.remote.requires.intents";
-    
+
     @Deprecated
     public static final String IMPORTED = RemoteConstants.SERVICE_IMPORTED;
     @Deprecated
     public static final String IMPORTD_CONFIGS = RemoteConstants.SERVICE_IMPORTED_CONFIGS;
-    
+
     @Deprecated
     public static final String INTENTS = RemoteConstants.SERVICE_INTENTS;
-        
+
     // WSDL
     public static final String WSDL_CONFIG_TYPE = "wsdl";
     public static final String WSDL_CONFIG_PREFIX = "osgi.remote.configuration" + "." + WSDL_CONFIG_TYPE;
@@ -57,7 +58,7 @@ public final class Constants {
     public static final String WSDL_HTTP_SERVICE_CONTEXT = WSDL_CONFIG_PREFIX + ".httpservice.context";
     // Provider prefix
     public static final String PROVIDER_PREFIX = "org.apache.cxf";
-    
+
     // WS
     public static final String WS_CONFIG_TYPE = PROVIDER_PREFIX + ".ws";
     public static final String WS_ADDRESS_PROPERTY = WS_CONFIG_TYPE + ".address";
@@ -79,10 +80,10 @@ public final class Constants {
     public static final String WS_DATA_BINDING_JAXB = "jaxb";
     public static final String WS_DATA_BINDING_AEGIS = "aegis";
 
-    public static final String WS_WSDL_SERVICE_NAMESPACE =  WS_CONFIG_TYPE + ".service.ns";
-    public static final String WS_WSDL_SERVICE_NAME =  WS_CONFIG_TYPE + ".service.name";
-    public static final String WS_WSDL_PORT_NAME =  WS_CONFIG_TYPE + ".port.name";
-    public static final String WS_WSDL_LOCATION =  WS_CONFIG_TYPE + ".wsdl.location";
+    public static final String WS_WSDL_SERVICE_NAMESPACE = WS_CONFIG_TYPE + ".service.ns";
+    public static final String WS_WSDL_SERVICE_NAME = WS_CONFIG_TYPE + ".service.name";
+    public static final String WS_WSDL_PORT_NAME = WS_CONFIG_TYPE + ".port.name";
+    public static final String WS_WSDL_LOCATION = WS_CONFIG_TYPE + ".wsdl.location";
     // Rest
     public static final String RS_CONFIG_TYPE = PROVIDER_PREFIX + ".rs";
     public static final String RS_ADDRESS_PROPERTY = RS_CONFIG_TYPE + ".address";
@@ -102,11 +103,11 @@ public final class Constants {
     public static final String WS_CONFIG_TYPE_OLD = "pojo";
     public static final String WS_CONFIG_OLD_PREFIX = "osgi.remote.configuration." + WS_CONFIG_TYPE_OLD;
     public static final String WS_ADDRESS_PROPERTY_OLD = WS_CONFIG_OLD_PREFIX + ".address";
-    public static final String WS_HTTP_SERVICE_CONTEXT_OLD = WS_CONFIG_OLD_PREFIX + ".httpservice.context"; 
+    public static final String WS_HTTP_SERVICE_CONTEXT_OLD = WS_CONFIG_OLD_PREFIX + ".httpservice.context";
 
     // Common Configuration Properties
     public static final String CHECK_BUNDLE = "check.bundle";
-    
+
     // The following constants are not evaluated anymore
     @Deprecated
     public static final String DEFAULT_PORT_CONFIG = "default.port";
@@ -118,26 +119,26 @@ public final class Constants {
     public static final String DEFAULT_HOST_VALUE = "localhost";
     @Deprecated
     public static final String USE_MASTER_MAP = "use.master.map";
-    
+
     // DSW Identification - TODO do we really need this one?
     public static final String DSW_CLIENT_ID = PROVIDER_PREFIX + ".remote.dsw.client";
 
     public static final String INTENT_NAME_PROP = "org.apache.cxf.dosgi.IntentName";
-    
+
     /**
      * Prefix to create an absolute URL from a relative URL.
-     * See HttpServiceManager.getAbsoluteAddress 
-     * 
+     * See HttpServiceManager.getAbsoluteAddress
+     *
      * Defaults to: http://<host name>:8181
      */
     public static final String HTTP_BASE = "httpBase";
-    
+
     /**
      * Name of the cxf servlet alias
      */
     public static final String CXF_SERVLET_ALIAS = "cxfServletAlias";
     public static final String DEFAULT_CXF_SERVLET_ALIAS = "/cxf";
-    
+
     private Constants() {
         // never constructed
     }
index 8ef0cdd..a2b524d 100644 (file)
@@ -31,13 +31,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class InterfaceRule implements Rule {
+
     private static final Logger LOG = LoggerFactory.getLogger(InterfaceRule.class);
-    
+
     private final Bundle bundle;
     private final Pattern matchPattern;
     private final Map<String, String> propMatches = new HashMap<String, String>();
     private final Map<String, Object> addProps = new HashMap<String, Object>();
-    
+
     public InterfaceRule(Bundle b, String im) {
         bundle = b;
         matchPattern = Pattern.compile(im);
@@ -49,26 +50,26 @@ public class InterfaceRule implements Rule {
 
     public synchronized void addProperty(String name, String value, String type) {
         Object obj = value;
-        
+
         if (!String.class.getName().equals(type)) {
             try {
                 Class<?> cls = getClass().getClassLoader().loadClass(type);
-                Constructor<?> ctor = cls.getConstructor(new Class [] {String.class});
+                Constructor<?> ctor = cls.getConstructor(new Class[] {String.class});
                 obj = ctor.newInstance(value);
             } catch (Throwable th) {
-                LOG.warn("Could not handle property '" + name 
+                LOG.warn("Could not handle property '" + name
                          + "' with value '" + value + "' of type: " + type, th);
                 return;
             }
         }
-        
+
         addProps.put(name, obj);
     }
 
     public synchronized void apply(ServiceReference sref, Map<String, Object> target) {
-        String [] objectClass = (String[]) sref.getProperty(Constants.OBJECTCLASS);
+        String[] objectClass = (String[]) sref.getProperty(Constants.OBJECTCLASS);
         boolean matches = false;
-        for (String cls : objectClass) {            
+        for (String cls : objectClass) {
             Matcher m = matchPattern.matcher(cls);
             if (m.matches()) {
                 for (Map.Entry<String, String> pm : propMatches.entrySet()) {
@@ -87,12 +88,12 @@ public class InterfaceRule implements Rule {
         if (!matches) {
             return;
         }
-        
+
         LOG.info("Adding the following properties to " + sref + ": " + addProps);
         target.putAll(addProps);
     }
 
     public Bundle getBundle() {
         return bundle;
-    }    
+    }
 }
index 6c7f96c..a280442 100644 (file)
@@ -24,14 +24,17 @@ import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
 
 public interface Rule {
-    /** When the ServiceReference passed in matches the rule's condition,
+
+    /**
+     * When the ServiceReference passed in matches the rule's condition,
      * set the additional properties in the target.
      * @param sref The Service Reference to be checked.
      * @param target Any additional properties are to be set in this map.
      */
     void apply(ServiceReference sref, Map<String, Object> target);
-    
-    /** Returns the bundle that provided this rule.
+
+    /**
+     * Returns the bundle that provided this rule.
      * @return The Bundle where the Rule was defined.
      */
     Bundle getBundle();
index 98bf69b..07a0b85 100644 (file)
@@ -23,5 +23,6 @@ import java.util.Map;
 import org.osgi.framework.ServiceReference;
 
 public interface ServiceDecorator {
+
     void decorate(ServiceReference sref, Map<String, Object> properties);
 }
index 4a72a86..52353e4 100644 (file)
@@ -39,8 +39,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class ServiceDecoratorImpl implements ServiceDecorator {
+
     private static final Logger LOG = LoggerFactory.getLogger(ServiceDecoratorImpl.class);
-    
+
     final List<Rule> decorations = new CopyOnWriteArrayList<Rule>();
     private final BundleContext bundleContext;
     private final BundleListenerImpl bundleListener;
@@ -50,7 +51,7 @@ public class ServiceDecoratorImpl implements ServiceDecorator {
         bundleListener = new BundleListenerImpl();
         bc.addBundleListener(bundleListener);
     }
-    
+
     public void shutdown() {
         bundleContext.removeBundleListener(bundleListener);
     }
@@ -60,7 +61,7 @@ public class ServiceDecoratorImpl implements ServiceDecorator {
             matcher.apply(sref, target);
         }
     }
-    
+
     @SuppressWarnings("unchecked")
     void addDecorations(Bundle bundle) {
         Namespace ns = Namespace.getNamespace("http://cxf.apache.org/xmlns/service-decoration/1.0.0");
@@ -71,7 +72,7 @@ public class ServiceDecoratorImpl implements ServiceDecorator {
                     m.addPropMatch(propMatch.getAttributeValue("name"), propMatch.getAttributeValue("value"));
                 }
                 for (Element addProp : (List<Element>) match.getChildren("add-property", ns)) {
-                    m.addProperty(addProp.getAttributeValue("name"), 
+                    m.addProperty(addProp.getAttributeValue("name"),
                                   addProp.getAttributeValue("value"),
                                   addProp.getAttributeValue("type", String.class.getName()));
                 }
@@ -86,7 +87,7 @@ public class ServiceDecoratorImpl implements ServiceDecorator {
         if (entries == null) {
             return Collections.emptyList();
         }
-        
+
         List<Element> elements = new ArrayList<Element>();
         while (entries.hasMoreElements()) {
             URL resourceURL = (URL) entries.nextElement();
@@ -100,7 +101,7 @@ public class ServiceDecoratorImpl implements ServiceDecorator {
         }
         return elements;
     }
-    
+
     void removeDecorations(Bundle bundle) {
         for (Rule r : decorations) {
             if (bundle.equals(r.getBundle())) {
@@ -120,6 +121,6 @@ public class ServiceDecoratorImpl implements ServiceDecorator {
                 break;
             default:
             }
-        }        
+        }
     }
 }
index 505430a..387cdc2 100644 (file)
@@ -47,6 +47,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public abstract class AbstractPojoConfigurationTypeHandler implements ConfigurationTypeHandler {
+
     private static final Logger LOG = LoggerFactory.getLogger(AbstractPojoConfigurationTypeHandler.class);
     protected BundleContext bundleContext;
     protected IntentManager intentManager;
@@ -98,7 +99,6 @@ public abstract class AbstractPojoConfigurationTypeHandler implements Configurat
         props.put(RemoteConstants.SERVICE_INTENTS, allIntents);
         props.put(RemoteConstants.ENDPOINT_ID, address);
         return props;
-
     }
 
     private void copyEndpointProperties(Map<String, Object> sd, Map<String, Object> endpointProps) {
@@ -110,7 +110,7 @@ public abstract class AbstractPojoConfigurationTypeHandler implements Configurat
                     endpointProps.put(skey, entry.getValue());
                 }
             } catch (ClassCastException e) {
-                LOG.warn("ServiceProperties Map contained non String key. Skipped  " + entry + "   "
+                LOG.warn("ServiceProperties Map contained non String key. Skipped " + entry + "   "
                          + e.getLocalizedMessage());
             }
         }
@@ -225,7 +225,6 @@ public abstract class AbstractPojoConfigurationTypeHandler implements Configurat
 
     private static void addInterceptors(AbstractEndpointFactory factory, BundleContext callingContext,
                                         Map<String, Object> sd, String propName) {
-
         List<Object> providers = ClassUtils.loadProviderClasses(callingContext, sd, propName);
         boolean in = propName.contains("in.interceptors");
         boolean out = propName.contains("out.interceptors");
@@ -247,7 +246,6 @@ public abstract class AbstractPojoConfigurationTypeHandler implements Configurat
 
     private static void addFeatures(AbstractEndpointFactory factory, BundleContext callingContext,
                                     Map<String, Object> sd, String propName) {
-
         List<Object> providers = ClassUtils.loadProviderClasses(callingContext, sd, propName);
         if (!providers.isEmpty()) {
             factory.getFeatures().addAll(CastUtils.cast(providers, AbstractFeature.class));
index 07e9422..b7380fb 100644 (file)
@@ -35,6 +35,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class ConfigTypeHandlerFactory {
+
     protected static final String DEFAULT_CONFIGURATION_TYPE = Constants.WS_CONFIG_TYPE;
     private static final Logger LOG = LoggerFactory.getLogger(ConfigTypeHandlerFactory.class);
 
@@ -79,9 +80,7 @@ public class ConfigTypeHandlerFactory {
         if (configurationTypes.contains(Constants.WS_CONFIG_TYPE)
             || configurationTypes.contains(Constants.WS_CONFIG_TYPE_OLD)
             || configurationTypes.contains(Constants.RS_CONFIG_TYPE)) {
-
             boolean jaxrs = isJaxrsRequested(configurationTypes, serviceProperties);
-
             return jaxrs ? jaxRsPojoConfigurationTypeHandler : pojoConfigurationTypeHandler;
         } else if (configurationTypes.contains(Constants.WSDL_CONFIG_TYPE)) {
             return wsdlConfigurationTypeHandler;
@@ -89,14 +88,13 @@ public class ConfigTypeHandlerFactory {
         throw new RuntimeException("None of the configuration types in " + configurationTypes + " is supported.");
     }
 
-    private boolean isJaxrsRequested(Collection<String> types,  Map<String, Object> serviceProperties) {
-
+    private boolean isJaxrsRequested(Collection<String> types, Map<String, Object> serviceProperties) {
         if (types == null) {
             return false;
         }
 
         if (types.contains(Constants.RS_CONFIG_TYPE)) {
-            Collection<String> intentsProperty 
+            Collection<String> intentsProperty
                 = OsgiUtils.getMultiValueProperty(serviceProperties.get(RemoteConstants.SERVICE_EXPORTED_INTENTS));
             boolean hasHttpIntent = false;
             boolean hasSoapIntent = false;
@@ -159,10 +157,8 @@ public class ConfigTypeHandlerFactory {
 
         if (usableConfigurationTypes.isEmpty()) {
             throw new RuntimeException("The supplied endpoint has no compatible configuration type. "
-                                       + "Supported types are: "
-                                       + supportedConfigurationTypes
-                                       + "    Types needed by the endpoint: "
-                                       + remoteConfigurationTypes);
+                    + "Supported types are: " + supportedConfigurationTypes
+                    + "    Types needed by the endpoint: " + remoteConfigurationTypes);
         }
         return usableConfigurationTypes;
     }
@@ -170,5 +166,4 @@ public class ConfigTypeHandlerFactory {
     public List<String> getSupportedConfigurationTypes() {
         return supportedConfigurationTypes;
     }
-
 }
index 9a10040..1b5bca9 100644 (file)
@@ -26,13 +26,14 @@ import org.osgi.framework.ServiceReference;
 import org.osgi.service.remoteserviceadmin.EndpointDescription;
 
 public interface ConfigurationTypeHandler {
+
     String[] getSupportedTypes();
-    
+
     ExportResult createServer(ServiceReference serviceReference,
                         BundleContext dswContext,
-                        BundleContext callingContext, 
-                        Map<String, Object> sd, 
-                        Class<?> iClass, 
+                        BundleContext callingContext,
+                        Map<String, Object> sd,
+                        Class<?> iClass,
                         Object serviceBean);
 
     Object createProxy(ServiceReference serviceReference,
index f30426b..47b7bf6 100644 (file)
@@ -23,6 +23,7 @@ import java.util.Map;
 import org.apache.cxf.endpoint.Server;
 
 public class ExportResult {
+
     private final Map<String, Object> endpointProps;
     private final Server server;
     private final Exception exception;
@@ -32,7 +33,7 @@ public class ExportResult {
         this.server = server;
         this.exception = null;
     }
-    
+
     public ExportResult(Map<String, Object> endpointProps, Exception ex) {
         this.endpointProps = endpointProps;
         this.server = null;
@@ -50,6 +51,4 @@ public class ExportResult {
     public Exception getException() {
         return exception;
     }
-    
-    
 }
index 820029f..28823bd 100644 (file)
@@ -44,6 +44,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class HttpServiceManager {
+
     private static final Logger LOG = LoggerFactory.getLogger(HttpServiceManager.class);
     private ServiceTracker tracker;
     private BundleContext bundleContext;
@@ -52,25 +53,25 @@ public class HttpServiceManager {
     private String cxfServletAlias;
 
     public HttpServiceManager(BundleContext bundleContext, String httpBase, String cxfServletAlias) {
-        this(bundleContext, httpBase, cxfServletAlias, 
+        this(bundleContext, httpBase, cxfServletAlias,
              new ServiceTracker(bundleContext, HttpService.class.getName(), null));
         this.tracker.open();
     }
 
     // Only for tests
-    public HttpServiceManager(BundleContext bundleContext, 
-                              String httpBase, String cxfServletAlias, 
+    public HttpServiceManager(BundleContext bundleContext,
+                              String httpBase, String cxfServletAlias,
                               ServiceTracker tracker) {
         this.bundleContext = bundleContext;
         this.tracker = tracker;
         this.httpBase = getWithDefault(httpBase, "http://" + LocalHostUtil.getLocalIp() + ":8181");
         this.cxfServletAlias = getWithDefault(cxfServletAlias, "/cxf");
     }
-    
+
     private String getWithDefault(String value, String defaultValue) {
         return value == null ? defaultValue : value;
     }
-    
+
     public Bus registerServletAndGetBus(String contextRoot, BundleContext callingContext,
             ServiceReference sref) {
         Bus bus = BusFactory.newInstance().createBus();
@@ -79,10 +80,10 @@ public class HttpServiceManager {
         cxf.setBus(bus);
         try {
             HttpService httpService = getHttpService();
-            httpService.registerServlet(contextRoot, cxf, new Hashtable<String, String>(), 
+            httpService.registerServlet(contextRoot, cxf, new Hashtable<String, String>(),
                                        getHttpContext(callingContext, httpService));
             registerUnexportHook(sref, contextRoot);
-            
+
             LOG.info("Successfully registered CXF DOSGi servlet at " + contextRoot);
         } catch (Exception e) {
             throw new ServiceException("CXF DOSGi: problem registering CXF HTTP Servlet", e);
@@ -99,7 +100,7 @@ public class HttpServiceManager {
     }
 
     public String getServletContextRoot(Map<?, ?> sd, Class<?> iClass) {
-        return OsgiUtils.getFirstNonEmptyStringProperty(sd, 
+        return OsgiUtils.getFirstNonEmptyStringProperty(sd,
                 Constants.WS_HTTP_SERVICE_CONTEXT,
                 Constants.WS_HTTP_SERVICE_CONTEXT_OLD,
                 Constants.WSDL_HTTP_SERVICE_CONTEXT,
@@ -110,26 +111,26 @@ public class HttpServiceManager {
         HttpContext httpContext = httpService.createDefaultHttpContext();
         return new SecurityDelegatingHttpContext(bc, httpContext);
     }
-    
+
     /**
      * This listens for service removal events and "un-exports" the service
      * from the HttpService.
-     * 
+     *
      * @param sref the service reference to track
      * @param alias the HTTP servlet context alias
      */
     private void registerUnexportHook(ServiceReference sref, String alias) {
         final Long sid = (Long) sref.getProperty(org.osgi.framework.Constants.SERVICE_ID);
         LOG.debug("Registering service listener for service with ID {}", sid);
-     
+
         String previous = exportedAliases.put(sid, alias);
         if (previous != null) {
             LOG.warn("Overwriting service export for service with ID {}", sid);
         }
-        
+
         try {
             Filter f = bundleContext.createFilter("(" + org.osgi.framework.Constants.SERVICE_ID + "=" + sid + ")");
-            
+
             if (f != null) {
                 bundleContext.addServiceListener(new UnregisterListener(), f.toString());
             } else {
@@ -139,7 +140,7 @@ public class HttpServiceManager {
             LOG.warn("Service listener could not be started. The service will not be automatically unexported.", e);
         }
     }
-    
+
     protected String getDefaultAddress(Class<?> type) {
         return "/" + type.getName().replace('.', '/');
     }
@@ -148,17 +149,17 @@ public class HttpServiceManager {
         if (relativeEndpointAddress.startsWith("http")) {
             return relativeEndpointAddress;
         }
-        String effContextRoot = contextRoot == null ? cxfServletAlias : contextRoot; 
+        String effContextRoot = contextRoot == null ? cxfServletAlias : contextRoot;
         return this.httpBase + effContextRoot + relativeEndpointAddress;
     }
-    
+
     public void close() {
         tracker.close();
     }
-    
+
     private final class UnregisterListener implements ServiceListener {
-        public void serviceChanged(ServiceEvent event) {
 
+        public void serviceChanged(ServiceEvent event) {
             if (!(event.getType() == ServiceEvent.UNREGISTERING)) {
                 return;
             }
@@ -166,8 +167,7 @@ public class HttpServiceManager {
             final Long sid = (Long) sref.getProperty(org.osgi.framework.Constants.SERVICE_ID);
             final String alias = exportedAliases.remove(sid);
             if (alias == null) {
-                LOG.error(
-                        "Unable to unexport HTTP servlet for service class ''{0}'',"
+                LOG.error("Unable to unexport HTTP servlet for service class ''{0}'',"
                         + " service-id {1}: no servlet alias found",
                         new Object[] {sref.getProperty(org.osgi.framework.Constants.OBJECTCLASS), sid});
                 return;
@@ -177,7 +177,7 @@ public class HttpServiceManager {
                 HttpService http = getHttpService();
                 http.unregister(alias);
             } catch (Exception e) {
-                LOG.warn("An exception occurred while unregistering service for HTTP servlet alias '" 
+                LOG.warn("An exception occurred while unregistering service for HTTP servlet alias '"
                         + alias + "'", e);
             }
         }
index 2c77026..458180d 100644 (file)
@@ -41,10 +41,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfigurationTypeHandler {
+
     private static final Logger LOG = LoggerFactory.getLogger(JaxRSPojoConfigurationTypeHandler.class);
 
     public JaxRSPojoConfigurationTypeHandler(BundleContext dswBC,
-                                             IntentManager intentManager, 
+                                             IntentManager intentManager,
                                              HttpServiceManager httpServiceManager) {
         super(dswBC, intentManager, httpServiceManager);
     }
@@ -52,11 +53,10 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
     public String[] getSupportedTypes() {
         return new String[] {Constants.RS_CONFIG_TYPE};
     }
-    
+
     public Object createProxy(ServiceReference serviceReference, BundleContext dswContext,
                               BundleContext callingContext, Class<?> iClass,
                               EndpointDescription sd) throws IntentUnsatisfiedException {
-
         String address = getPojoAddress(sd, iClass);
         if (address == null) {
             LOG.warn("Remote address is unavailable");
@@ -69,7 +69,7 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
         } catch (Throwable e) {
             Thread.currentThread().setContextClassLoader(oldClassLoader);
         }
-        
+
         try {
             ProxyClassLoader cl = new ProxyClassLoader();
             cl.addLoader(iClass.getClassLoader());
@@ -78,12 +78,11 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
         } catch (Throwable e) {
             LOG.warn("proxy creation failed", e);
         }
-        
-        return null;
 
+        return null;
     }
 
-    protected Object createJaxrsProxy(String address, 
+    protected Object createJaxrsProxy(String address,
                                       BundleContext dswContext,
                                       BundleContext callingContext,
                                       Class<?> iClass,
@@ -94,9 +93,9 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
         if (loader != null) {
             bean.setClassLoader(loader);
         }
-        
+
         addRsInterceptorsFeaturesProps(bean, callingContext, sd.getProperties());
-        
+
         List<UserResource> resources = JaxRSUtils.getModel(callingContext, iClass);
         if (resources != null) {
             bean.setModelBeansWithServiceClass(resources, iClass);
@@ -110,13 +109,12 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
         Thread.currentThread().setContextClassLoader(JAXRSClientFactoryBean.class.getClassLoader());
         return getProxy(bean.create(), iClass);
     }
-    
+
     public ExportResult createServer(ServiceReference sref,
                                      BundleContext dswContext,
-                                     BundleContext callingContext, 
+                                     BundleContext callingContext,
                                      Map<String, Object> sd, Class<?> iClass,
                                      Object serviceBean) throws IntentUnsatisfiedException {
-
         String contextRoot = httpServiceManager.getServletContextRoot(sd, iClass);
         String address;
         if (contextRoot == null) {
@@ -128,7 +126,7 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
             }
         }
 
-        Bus bus = contextRoot != null 
+        Bus bus = contextRoot != null
                 ? httpServiceManager.registerServletAndGetBus(contextRoot, callingContext, sref) : null;
 
         LOG.info("Creating a " + iClass.getName()
@@ -144,7 +142,7 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
 
         return createServerFromFactory(factory, endpointProps);
     }
-    
+
     private ExportResult createServerFromFactory(JAXRSServerFactoryBean factory,
                                                        Map<String, Object> endpointProps) {
         ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
@@ -158,13 +156,13 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
             Thread.currentThread().setContextClassLoader(oldClassLoader);
         }
     }
-    
-    private JAXRSServerFactoryBean createServerFactory(BundleContext dswContext, 
+
+    private JAXRSServerFactoryBean createServerFactory(BundleContext dswContext,
                                                        BundleContext callingContext,
                                                        Map<String, Object> sd,
-                                                       Class<?> iClass, 
-                                                       Object serviceBean, 
-                                                       String address, 
+                                                       Class<?> iClass,
+                                                       Object serviceBean,
+                                                       String address,
                                                        Bus bus) {
         JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
         if (bus != null) {
@@ -205,5 +203,4 @@ public class JaxRSPojoConfigurationTypeHandler extends AbstractPojoConfiguration
         }
         return address;
     }
-
 }
index 3e293be..567befc 100644 (file)
@@ -38,14 +38,14 @@ public final class JaxRSUtils {
 
     public static final String MODEL_FOLDER = "/OSGI-INF/cxf/jaxrs/";
     public static final String DEFAULT_MODEL = "/OSGI-INF/cxf/jaxrs/model.xml";
-    public static final String PROVIDERS_FILTER = "(|" 
+    public static final String PROVIDERS_FILTER = "(|"
             + "(objectClass=javax.ws.rs.ext.MessageBodyReader)"
-            + "(objectClass=javax.ws.rs.ext.MessageBodyWriter)" 
-            + "(objectClass=javax.ws.rs.ext.ExceptionMapper)" 
-            + "(objectClass=org.apache.cxf.jaxrs.ext.RequestHandler)" 
-            + "(objectClass=org.apache.cxf.jaxrs.ext.ResponseHandler)" 
-            + "(objectClass=org.apache.cxf.jaxrs.ext.ParameterHandler)" 
-            + "(objectClass=org.apache.cxf.jaxrs.ext.ResponseExceptionMapper)" 
+            + "(objectClass=javax.ws.rs.ext.MessageBodyWriter)"
+            + "(objectClass=javax.ws.rs.ext.ExceptionMapper)"
+            + "(objectClass=org.apache.cxf.jaxrs.ext.RequestHandler)"
+            + "(objectClass=org.apache.cxf.jaxrs.ext.ResponseHandler)"
+            + "(objectClass=org.apache.cxf.jaxrs.ext.ParameterHandler)"
+            + "(objectClass=org.apache.cxf.jaxrs.ext.ResponseExceptionMapper)"
             + ")";
     private static final Logger LOG = LoggerFactory.getLogger(JaxRSUtils.class);
 
@@ -55,14 +55,13 @@ public final class JaxRSUtils {
 
     @SuppressWarnings("rawtypes")
     static List<Object> getProviders(BundleContext callingContext, BundleContext dswBC, Map sd) {
-
         List<Object> providers = new ArrayList<Object>();
         if ("aegis".equals(sd.get(org.apache.cxf.dosgi.dsw.Constants.RS_DATABINDING_PROP_KEY))) {
             providers.add(new AegisElementProvider());
         }
-        
-        providers.addAll(ClassUtils.loadProviderClasses(callingContext, 
-                                                        sd, 
+
+        providers.addAll(ClassUtils.loadProviderClasses(callingContext,
+                                                        sd,
                                                         org.apache.cxf.dosgi.dsw.Constants.RS_PROVIDER_PROP_KEY));
 
         Object globalQueryProp = sd.get(org.apache.cxf.dosgi.dsw.Constants.RS_PROVIDER_GLOBAL_PROP_KEY);
@@ -118,5 +117,4 @@ public final class JaxRSUtils {
         }
         return null;
     }
-
 }
index 9689998..50e2127 100644 (file)
@@ -39,8 +39,8 @@ public final class LocalHostUtil {
      * Returns an InetAddress representing the address of the localhost. Every
      * attempt is made to find an address for this host that is not the loopback
      * address. If no other address can be found, the loopback will be returned.
-     * 
-     * @return InetAddress the address of localhost
+     *
+     * @return InetAddress the address of localhost
      * @throws UnknownHostException if there is a problem determining the address
      */
     public static InetAddress getLocalHost() throws UnknownHostException {
@@ -60,10 +60,9 @@ public final class LocalHostUtil {
     /**
      * Utility method that delegates to the methods of NetworkInterface to
      * determine addresses for this machine.
-     * 
-     * @return InetAddress[] - all addresses found from the NetworkInterfaces
-     * @throws UnknownHostException
-     *             - if there is a problem determining addresses
+     *
+     * @return all addresses found from the NetworkInterfaces
+     * @throws UnknownHostException if there is a problem determining addresses
      */
     private static InetAddress[] getAllLocalUsingNetworkInterface() throws UnknownHostException {
         try {
@@ -90,5 +89,4 @@ public final class LocalHostUtil {
         }
         return localIP;
     }
-
 }
index 21001aa..a8c6cc3 100644 (file)
@@ -40,6 +40,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class PojoConfigurationTypeHandler extends AbstractPojoConfigurationTypeHandler {
+
     private static final Logger LOG = LoggerFactory.getLogger(PojoConfigurationTypeHandler.class);
 
     public PojoConfigurationTypeHandler(BundleContext dswBC,
@@ -166,5 +167,4 @@ public class PojoConfigurationTypeHandler extends AbstractPojoConfigurationTypeH
             || Constants.WS_FRONTEND_JAXWS.equals(frontEnd))
             && !Constants.WS_FRONTEND_SIMPLE.equals(frontEnd);
     }
-
 }
index 4f1dc42..d2ad339 100644 (file)
@@ -48,6 +48,7 @@ import org.slf4j.LoggerFactory;
  * </p>
  */
 public class SecurityDelegatingHttpContext implements HttpContext {
+
     public static final String FILTER_PROP = "org.apache.cxf.httpservice.filter";
     public static final String FILTER_REQUIRED_PROP = "org.apache.cxf.httpservice.requirefilter";
     private static final Logger LOG = LoggerFactory.getLogger(SecurityDelegatingHttpContext.class);
@@ -109,6 +110,7 @@ public class SecurityDelegatingHttpContext implements HttpContext {
  * A {@link FilterChain} composed of {@link Filter}s with the
  */
 class Chain implements FilterChain {
+
     private static final Logger LOG = LoggerFactory.getLogger(Chain.class);
 
     int current;
index c33211d..6171a53 100644 (file)
@@ -33,19 +33,18 @@ import java.util.Map;
 import org.osgi.framework.ServiceException;
 
 public class ServiceInvocationHandler implements InvocationHandler {
+
     private static final String REMOTE_EXCEPTION_TYPE = "REMOTE";
-    private static final Collection<Method> OBJECT_METHODS = 
-        Arrays.asList(Object.class.getMethods());
+    private static final Collection<Method> OBJECT_METHODS = Arrays.asList(Object.class.getMethods());
 
-    private Map<Method, List<Class<?>>> exceptionsMap
-        = new HashMap<Method, List<Class<?>>>();
+    private Map<Method, List<Class<?>>> exceptionsMap = new HashMap<Method, List<Class<?>>>();
     private Object serviceObject;
-    
+
     public ServiceInvocationHandler(Object serviceObject, Class<?> iType) {
         this.serviceObject = serviceObject;
         introspectType(iType);
     }
-    
+
     public Object invoke(Object proxy, final Method m, Object[] params) throws Throwable {
         if (OBJECT_METHODS.contains(m)) {
             if (m.getName().equals("equals")) {
@@ -55,14 +54,14 @@ public class ServiceInvocationHandler implements InvocationHandler {
         }
 
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
-        try {            
+        try {
             Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
             final Object[] paramsFinal = params;
             return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                 public Object run() throws Exception {
                     return m.invoke(serviceObject, paramsFinal);
                 }
-            }); 
+            });
         } catch (Throwable ex) {
             Throwable theCause = ex.getCause() == null ? ex : ex.getCause();
             Throwable theCauseCause = theCause.getCause() == null ? theCause : theCause.getCause();
@@ -76,9 +75,8 @@ public class ServiceInvocationHandler implements InvocationHandler {
                         throw theCauseCause;
                     }
                 }
-                
             }
-                        
+
             throw new ServiceException(REMOTE_EXCEPTION_TYPE, theCause);
         } finally {
             Thread.currentThread().setContextClassLoader(oldCl);
index 8db2fb4..3fb3869 100644 (file)
@@ -40,30 +40,30 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class WsdlConfigurationTypeHandler extends AbstractPojoConfigurationTypeHandler {
+
     private static final Logger LOG = LoggerFactory.getLogger(WsdlConfigurationTypeHandler.class);
-    
+
     public WsdlConfigurationTypeHandler(BundleContext dswBC,
                                         IntentManager intentManager,
                                         HttpServiceManager httpServiceManager) {
         super(dswBC, intentManager, httpServiceManager);
     }
-    
+
     public String[] getSupportedTypes() {
         return new String[] {Constants.WSDL_CONFIG_TYPE};
     }
-    
+
     public Object createProxy(ServiceReference serviceReference,
                               BundleContext dswContext,
                               BundleContext callingContext,
-                              Class<?> iClass, 
+                              Class<?> iClass,
                               EndpointDescription sd) {
-        
         String wsdlAddressProp = getWsdlAddress(sd, iClass);
         if (wsdlAddressProp == null) {
             LOG.warn("WSDL address is unavailable");
             return null;
         }
-        
+
         URL wsdlAddress;
         try {
             wsdlAddress = new URL(wsdlAddressProp);
@@ -71,14 +71,13 @@ public class WsdlConfigurationTypeHandler extends AbstractPojoConfigurationTypeH
             LOG.warn("WSDL address is malformed");
             return null;
         }
-        
+
         LOG.info("Creating a " + sd.getInterfaces().toArray()[0] + " client, wsdl address is "
                  + OsgiUtils.getProperty(sd, Constants.WSDL_CONFIG_PREFIX));
-        
+
         String serviceNs = OsgiUtils.getProperty(sd, Constants.WSDL_SERVICE_NAMESPACE);
         if (serviceNs == null) {
-            serviceNs = PackageUtils.getNamespace(
-                            PackageUtils.getPackageName(iClass));
+            serviceNs = PackageUtils.getNamespace(PackageUtils.getPackageName(iClass));
         }
         String serviceName = OsgiUtils.getProperty(sd, Constants.WSDL_SERVICE_NAME);
         if (serviceName == null) {
@@ -89,11 +88,10 @@ public class WsdlConfigurationTypeHandler extends AbstractPojoConfigurationTypeH
                                              Constants.WSDL_SERVICE_NAME);
         QName portQname = getPortQName(serviceQname.getNamespaceURI(), sd.getProperties(), Constants.WSDL_PORT_NAME);
         Service service = createWebService(wsdlAddress, serviceQname);
-        Object proxy = getProxy(portQname == null ? service.getPort(iClass) : service.getPort(portQname, iClass), 
+        Object proxy = getProxy(portQname == null ? service.getPort(iClass) : service.getPort(portQname, iClass),
                                 iClass);
         // MARC: FIXME!!!! getDistributionProvider().addRemoteService(serviceReference);
         return proxy;
-        
     }
 
     // Isolated so that it can be overridden for test purposes.
@@ -104,10 +102,9 @@ public class WsdlConfigurationTypeHandler extends AbstractPojoConfigurationTypeH
     public ExportResult createServer(ServiceReference sref,
                                BundleContext dswContext,
                                BundleContext callingContext,
-                               Map<String, Object> sd, 
-                               Class<?> iClass, 
+                               Map<String, Object> sd,
+                               Class<?> iClass,
                                Object serviceBean) {
-        
         String location = OsgiUtils.getProperty(sd, Constants.WSDL_LOCATION);
         if (location == null) {
             throw new RuntimeException("WSDL location property is unavailable");
@@ -116,7 +113,7 @@ public class WsdlConfigurationTypeHandler extends AbstractPojoConfigurationTypeH
         if (wsdlURL == null) {
             throw new RuntimeException("WSDL resource at " + location + " is unavailable");
         }
-        
+
         String address = getServerAddress(sd, iClass);
         String contextRoot = httpServiceManager.getServletContextRoot(sd, iClass);
         if (address == null && contextRoot == null) {
@@ -137,28 +134,26 @@ public class WsdlConfigurationTypeHandler extends AbstractPojoConfigurationTypeH
         factory.setServiceBean(serviceBean);
 
         addWsInterceptorsFeaturesProps(factory, callingContext, sd);
-        
+
         setWsdlProperties(factory, callingContext, sd, true);
-        
+
         String[] intents = intentManager.applyIntents(factory.getFeatures(), factory, sd);
 
         // The properties for the EndpointDescription
         Map<String, Object> endpointProps = createEndpointProps(sd, iClass,
-                                                                new String[]{Constants.WS_CONFIG_TYPE}, 
+                                                                new String[]{Constants.WS_CONFIG_TYPE},
                                                                 address, intents);
-
         return createServerFromFactory(factory, endpointProps);
     }
-    
+
     private String getWsdlAddress(EndpointDescription sd, Class<?> iClass) {
         String address = OsgiUtils.getProperty(sd, Constants.WSDL_CONFIG_PREFIX);
         if (address == null) {
             address = httpServiceManager.getDefaultAddress(iClass);
             if (address != null) {
-                address += "?wsdl";    
+                address += "?wsdl";
             }
         }
         return address;
     }
-
 }
index 9fdf93e..7e0dd2e 100644 (file)
@@ -28,6 +28,7 @@ import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.feature.LoggingFeature;
 
 public class DefaultIntentMapFactory {
+
     public Map<String, Object> create() {
         Map<String, Object> intentMap = new HashMap<String, Object>();
         intentMap.put("logging", getLoggingFeature());
@@ -48,5 +49,4 @@ public class DefaultIntentMapFactory {
         soapBindingConfig.setVersion(soapVersion);
         return soapBindingConfig;
     }
-
 }
index b17bebd..ecaf070 100644 (file)
@@ -25,6 +25,7 @@ import org.apache.cxf.endpoint.AbstractEndpointFactory;
 import org.apache.cxf.feature.Feature;
 
 public interface IntentManager {
+
     String[] applyIntents(List<Feature> features, AbstractEndpointFactory factory, Map<String, Object> props);
     void assertAllIntentsSupported(Map<String, Object> serviceProperties);
 }
index 38d1e4f..289cbad 100644 (file)
@@ -33,21 +33,22 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class IntentManagerImpl implements IntentManager {
+
     static final Logger LOG = LoggerFactory.getLogger(IntentManagerImpl.class);
     private static final String PROVIDED_INTENT_VALUE = "PROVIDED";
 
     private final IntentMap intentMap;
     private long maxIntentWaitTime;
-    
+
     public IntentManagerImpl(IntentMap intentMap) {
         this(intentMap, 0);
     }
-    
+
     public IntentManagerImpl(IntentMap intentMap, int maxIntentWaitTime) {
         this.intentMap = intentMap;
         this.maxIntentWaitTime = maxIntentWaitTime;
     }
-    
+
     public String[] applyIntents(List<Feature> features, AbstractEndpointFactory factory,
                                  Map<String, Object> props) throws IntentUnsatisfiedException {
         Set<String> requestedIntents = IntentUtils.getRequestedIntents(props);
@@ -66,7 +67,7 @@ public class IntentManagerImpl implements IntentManager {
         appliedIntents.addAll(addSynonymIntents(appliedIntents, intentMap));
         return appliedIntents.toArray(new String[appliedIntents.size()]);
     }
-    
+
     private boolean processIntent(List<Feature> features, AbstractEndpointFactory factory,
                                   String intentName, Object intent) throws IntentUnsatisfiedException {
         if (intent instanceof String) {
@@ -120,7 +121,7 @@ public class IntentManagerImpl implements IntentManager {
         }
         return intentsFound;
     }
-    
+
     public void assertAllIntentsSupported(Map<String, Object> serviceProperties) {
         long endTime = System.currentTimeMillis() + maxIntentWaitTime;
         Set<String> requiredIntents = IntentUtils.getRequestedIntents(serviceProperties);
@@ -144,12 +145,10 @@ public class IntentManagerImpl implements IntentManager {
                 }
             }
         } while (!unsupportedIntents.isEmpty() && System.currentTimeMillis() < endTime);
-        
+
         if (!unsupportedIntents.isEmpty()) {
             throw new RuntimeException("service cannot be exported because the following "
-                                       + "intents are not supported by this RSA: "
-                                       + unsupportedIntents);
+                                       + "intents are not supported by this RSA: " + unsupportedIntents);
         }
     }
-
 }
index 4108ae1..ef33144 100644 (file)
@@ -25,22 +25,23 @@ import java.util.concurrent.ConcurrentHashMap;
 /**
  * Maps intent names to intent objects
  * An intent object can be a Feature, a BindingConfiguration or a String
- * 
- * Also supports a default intent map. Custom intents can override the defaults 
+ *
+ * Also supports a default intent map. Custom intents can override the defaults
  */
 public class IntentMap extends ConcurrentHashMap<String, Object> {
+
     private static final long serialVersionUID = 2606460607920520767L;
     private Map<String, Object> defaultMap;
-    
+
     public IntentMap() {
         this(new HashMap<String, Object>());
     }
-    
+
     public IntentMap(Map<String, Object> defaultMap) {
         this.defaultMap = defaultMap;
         putAll(defaultMap);
     }
-    
+
     @Override
     public Object put(String key, Object value) {
         Object result = super.put(key, value);
@@ -58,5 +59,4 @@ public class IntentMap extends ConcurrentHashMap<String, Object> {
         }
         return old;
     }
-    
 }
index 81c1bb1..4cae464 100644 (file)
@@ -26,13 +26,14 @@ import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
 
 public class IntentTracker extends ServiceTracker {
+
     private final IntentMap intentMap;
 
     public IntentTracker(BundleContext context, IntentMap intentMap) {
         super(context, getFilter(context), null);
         this.intentMap = intentMap;
     }
-    
+
     static Filter getFilter(BundleContext context) {
         try {
             return context.createFilter("(" + Constants.INTENT_NAME_PROP + "=*)");
index fd47ba8..4f7fac9 100644 (file)
 package org.apache.cxf.dosgi.dsw.qos;
 
 public class IntentUnsatisfiedException extends RuntimeException {
+
     private static final long serialVersionUID = 1L;
-    
+
     private String intent;
-    
+
     public IntentUnsatisfiedException(String theIntent) {
         super(theIntent);
         intent = theIntent;
     }
-    
+
     public String getIntent() {
         return intent;
     }
index e951c2c..1302b13 100644 (file)
@@ -33,6 +33,7 @@ import org.apache.cxf.dosgi.dsw.util.Utils;
 import org.osgi.service.remoteserviceadmin.RemoteConstants;
 
 public final class IntentUtils {
+
     private IntentUtils() {
         // never constructed
     }
@@ -64,7 +65,7 @@ public final class IntentUtils {
 
     public static Set<String> getRequestedIntents(Map<?, ?> sd) {
         Collection<String> intents = OsgiUtils.getMultiValueProperty(sd.get(RemoteConstants.SERVICE_EXPORTED_INTENTS));
-        Collection<String> intents2 
+        Collection<String> intents2
             = OsgiUtils.getMultiValueProperty(sd.get(RemoteConstants.SERVICE_EXPORTED_INTENTS_EXTRA));
         @SuppressWarnings("deprecation")
         Collection<String> oldIntents = OsgiUtils.getMultiValueProperty(sd.get(Constants.EXPORTED_INTENTS_OLD));
index 3a3ff8c..2df4840 100644 (file)
@@ -76,15 +76,13 @@ public class ClientServiceFactory implements ServiceFactory {
             LOG.info("Did not create proxy for " + interfaceName + " because intent " + iue.getIntent()
                      + " could not be satisfied");
         } catch (Exception ex) {
-            LOG.warn("Problem creating a remote proxy for " + interfaceName
-                                   + " from CXF FindHook: ", ex);
+            LOG.warn("Problem creating a remote proxy for " + interfaceName + " from CXF FindHook: ", ex);
         }
 
         return null;
     }
 
     public void ungetService(Bundle requestingBundle, ServiceRegistration sreg, Object serviceObject) {
-
         StringBuilder sb = new StringBuilder();
         sb.append("Releasing a client object");
         Object objectClass = sreg.getReference().getProperty(org.osgi.framework.Constants.OBJECTCLASS);
index 46d5122..51cfd1a 100644 (file)
@@ -44,7 +44,6 @@ public class EventAdminHelper {
 
     @SuppressWarnings("rawtypes")
     private Event createEvent(Properties props, String type) {
-
         String topic = "org/osgi/service/remoteserviceadmin/" + type;
         props.put("bundle", bctx.getBundle());
         props.put("bundle.id", bctx.getBundle().getBundleId());
@@ -64,13 +63,11 @@ public class EventAdminHelper {
     }
 
     public void notifyEventAdmin(RemoteServiceAdminEvent rsae) {
-
         String topic = remoteServiceAdminEventTypeToString(rsae.getType());
 
         Properties props = new Properties();
         setIfNotNull(props, "cause", rsae.getException());
 
-
         EndpointDescription epd = null;
         if (rsae.getImportReference() != null) {
             epd = ((ImportRegistrationImpl)rsae.getImportReference()).getImportedEndpointAlways();
@@ -110,7 +107,7 @@ public class EventAdminHelper {
         }
 
         if (refs != null) {
-            LOG.debug("Publishing event to {} EventAdmins;  Topic:[{}]", refs.length, topic);
+            LOG.debug("Publishing event to {} EventAdmins; Topic:[{}]", refs.length, topic);
             for (ServiceReference serviceReference : refs) {
                 EventAdmin eventAdmin = (EventAdmin) bctx.getService(serviceReference);
                 try {
@@ -156,5 +153,4 @@ public class EventAdminHelper {
         }
         return retval;
     }
-
 }
index 705553b..9fb7a04 100644 (file)
@@ -48,8 +48,8 @@ public class EventProducer {
     }
 
     protected void publishNotification(ExportRegistration er) {
-        int type = er.getException() == null 
-            ? RemoteServiceAdminEvent.EXPORT_REGISTRATION 
+        int type = er.getException() == null
+            ? RemoteServiceAdminEvent.EXPORT_REGISTRATION
             : RemoteServiceAdminEvent.EXPORT_ERROR;
         RemoteServiceAdminEvent rsae = new RemoteServiceAdminEvent(type, bctx.getBundle(), er.getExportReference(),
                 er.getException());
@@ -76,7 +76,6 @@ public class EventProducer {
                     }
                 }
             }
-
         } catch (InvalidSyntaxException e) {
             LOG.error(e.getMessage(), e);
         }
@@ -105,7 +104,6 @@ public class EventProducer {
         eaHelper.notifyEventAdmin(rsae);
     }
 
-
     public void notifyRemoval(ImportRegistration eri) {
         RemoteServiceAdminEvent rsae = new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_UNREGISTRATION,
                 bctx.getBundle(), eri.getImportReference(), eri.getException());
@@ -113,5 +111,4 @@ public class EventProducer {
         notifyListeners(rsae);
         eaHelper.notifyEventAdmin(rsae);
     }
-
 }
index e528384..2816877 100644 (file)
@@ -23,6 +23,7 @@ import org.osgi.service.remoteserviceadmin.EndpointDescription;
 import org.osgi.service.remoteserviceadmin.ExportReference;
 
 public class ExportReferenceImpl implements ExportReference {
+
     private ServiceReference serviceReference;
     private EndpointDescription endpointDescription;
 
@@ -65,7 +66,7 @@ public class ExportReferenceImpl implements ExportReference {
             return false;
         }
         ExportReferenceImpl other = (ExportReferenceImpl) obj;
-        if (endpointDescription == null) { 
+        if (endpointDescription == null) {
             if (other.endpointDescription != null) {
                 return false;
             }
index 6df93bd..23c251c 100644 (file)
@@ -73,7 +73,6 @@ public class ExportRegistrationImpl implements ExportRegistration {
         ++instanceCount;
     }
 
-
     public synchronized void close() {
         if (closed) {
             return;
@@ -134,8 +133,8 @@ public class ExportRegistrationImpl implements ExportRegistration {
             Set<Map.Entry<String, Object>> props = endpointDescription.getProperties().entrySet();
             for (Map.Entry<String, Object> entry : props) {
                 Object value = entry.getValue();
-                r += entry.getKey() + "  => "
-                    + (value instanceof Object[] ? Arrays.toString((Object []) value) : value) + "\n";
+                r += entry.getKey() + " => "
+                    + (value instanceof Object[] ? Arrays.toString((Object[]) value) : value) + "\n";
             }
         }
         return r;
@@ -162,7 +161,6 @@ public class ExportRegistrationImpl implements ExportRegistration {
      * is exported by this exportRegistration
      * */
     public void startServiceTracker(BundleContext bctx) {
-
         // only the parent should do this
         if (parent != this) {
             parent.startServiceTracker(bctx);
index e295269..0d211f6 100644 (file)
@@ -201,5 +201,4 @@ public class ImportRegistrationImpl implements ImportRegistration, ImportReferen
     public EndpointDescription getImportedEndpointAlways() {
         return importedEndpoint;
     }
-
 }
index 9325f65..dea49ff 100644 (file)
@@ -78,7 +78,6 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin {
     @SuppressWarnings({ "rawtypes", "unchecked" })
     public List<ExportRegistration> exportService(ServiceReference serviceReference, Map additionalProperties)
         throws IllegalArgumentException, UnsupportedOperationException {
-
         Map<String, Object> serviceProperties = getProperties(serviceReference);
         if (additionalProperties != null) {
             OsgiUtils.overlayProperties(serviceProperties, additionalProperties);
@@ -280,7 +279,6 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin {
         return copy;
     }
 
-
     private boolean isCreatedByThisRSA(ServiceReference sref) {
         return (sref.getBundle() != null) && sref.getBundle().equals(bctx.getBundle());
     }
@@ -313,7 +311,6 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin {
      * Importing form here...
      */
     public ImportRegistration importService(EndpointDescription endpoint) {
-
         LOG.debug("importService() Endpoint: {}", endpoint.getProperties());
 
         synchronized (importedServices) {
@@ -363,7 +360,6 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin {
 
     protected void proxifyMatchingInterface(String interfaceName, ImportRegistrationImpl imReg,
                                             ConfigurationTypeHandler handler, BundleContext requestingContext) {
-
         try {
             // MARC: relies on dynamic imports?
             Class<?> iClass = bctx.getBundle().loadClass(interfaceName);
@@ -376,7 +372,7 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin {
             if (actualClass != iClass) {
                 LOG.info("Class " + interfaceName + " loaded by DSW's bundle context is not "
                              + "equal to the one loaded by the requesting bundle context, "
-                             + "DSW will use the requesting bundle context to register " + "a proxy service");
+                             + "DSW will use the requesting bundle context to register a proxy service");
                 iClass = actualClass;
                 actualContext = requestingContext;
             }
index 1981f07..7684616 100644 (file)
@@ -35,6 +35,7 @@ import org.osgi.service.remoteserviceadmin.ImportRegistration;
 import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin;
 
 public class RemoteServiceAdminInstance implements RemoteServiceAdmin {
+
     private BundleContext bctx;
     private RemoteServiceAdminCore rsaCore;
 
@@ -48,7 +49,6 @@ public class RemoteServiceAdminInstance implements RemoteServiceAdmin {
     @SuppressWarnings({ "rawtypes", "unchecked" })
     public List /* ExportRegistration */exportService(final ServiceReference ref, final Map properties)
         throws IllegalArgumentException, UnsupportedOperationException {
-
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             EndpointPermission epp = new EndpointPermission("*", EndpointPermission.EXPORT);
@@ -60,7 +60,6 @@ public class RemoteServiceAdminInstance implements RemoteServiceAdmin {
                 if (closed) {
                     return Collections.emptyList();
                 }
-
                 return rsaCore.exportService(ref, properties);
             }
         });
@@ -68,7 +67,6 @@ public class RemoteServiceAdminInstance implements RemoteServiceAdmin {
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
     public Collection getExportedServices() {
-
         SecurityManager sm = System.getSecurityManager();
         EndpointPermission epp = new EndpointPermission("*", EndpointPermission.READ);
         if (sm != null) {
@@ -83,7 +81,6 @@ public class RemoteServiceAdminInstance implements RemoteServiceAdmin {
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
     public Collection getImportedEndpoints() {
-
         SecurityManager sm = System.getSecurityManager();
         EndpointPermission epp = new EndpointPermission("*", EndpointPermission.READ);
         if (sm != null) {
@@ -97,9 +94,7 @@ public class RemoteServiceAdminInstance implements RemoteServiceAdmin {
     }
 
     public ImportRegistration importService(EndpointDescription endpoint) {
-
         final EndpointDescription epd = endpoint;
-
         SecurityManager sm = System.getSecurityManager();
         EndpointPermission epp = new EndpointPermission(epd, OsgiUtils.getUUID(bctx),
                                                         EndpointPermission.IMPORT);
@@ -109,11 +104,9 @@ public class RemoteServiceAdminInstance implements RemoteServiceAdmin {
 
         return AccessController.doPrivileged(new PrivilegedAction<ImportRegistration>() {
             public ImportRegistration run() {
-
                 if (closed) {
                     return null;
                 }
-
                 return rsaCore.importService(epd);
             }
         });
@@ -121,7 +114,6 @@ public class RemoteServiceAdminInstance implements RemoteServiceAdmin {
 
     public void close() {
         closed = true;
-
         rsaCore.removeExportRegistrations(bctx.getBundle());
     }
 }
index fb524f1..42aa4a8 100644 (file)
@@ -29,6 +29,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public final class ClassUtils {
+
     private static final Logger LOG = LoggerFactory.getLogger(ClassUtils.class);
 
     private ClassUtils() {
@@ -63,13 +64,13 @@ public final class ClassUtils {
 
     /**
      * <pre>
-     * 
-     * The following method tries to deal specifically with classes that might have been proxied 
+     *
+     * The following method tries to deal specifically with classes that might have been proxied
      * eg. CGLIB proxies of which there might be a chain of proxies as different osgi frameworks
      * might be proxying the original service class that has been registered and then proxying the proxy.
-     * 
+     *
      * </pre>
-     * 
+     *
      * @param serviceClass
      * @param interfaceName
      * @return
@@ -96,7 +97,6 @@ public final class ClassUtils {
 
     @SuppressWarnings("rawtypes")
     public static List<Object> loadProviderClasses(BundleContext callingContext, Map sd, String propName) {
-
         Object serviceProviders = sd.get(propName);
         if (serviceProviders != null) {
             if (serviceProviders.getClass().isArray()) {
index b4d79e8..f35bcad 100644 (file)
@@ -87,15 +87,14 @@ public final class OsgiUtils {
     }
 
     /**
-     * Tries to retrieve the version of iClass via the PackageAdmin
+     * Tries to retrieve the version of iClass via the PackageAdmin.
      *
-     * @param iClass The interface for which the version should be found
-     * @param bc any valid BundleContext
+     * @param iClass tThe interface for which the version should be found
+     * @param bc any valid BundleContext
      * @return the version of the interface or "0.0.0" if no version information could be found or an error
      *         occurred during the retrieval
      */
     public static String getVersion(Class<?> iClass, BundleContext bc) {
-
         ServiceReference paRef = bc.getServiceReference(PackageAdmin.class.getName());
         if (paRef != null) {
             PackageAdmin pa = (PackageAdmin)bc.getService(paRef);