Author: sergeyb
Date: Fri Jun 15 12:32:04 2012
New Revision: 1350599
URL: http://svn.apache.org/viewvc?rev=1350599&view=rev
Log:
[DOSGI-121] Improving DOSGi CXF logging, applying a patch on behalf of Bert
Jacobs
Modified:
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/Activator.java
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerImpl.java
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerTrackerCustomizer.java
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceDataMonitorListenerImpl.java
cxf/dosgi/trunk/discovery/distributed/zookeeper-server-config/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/server/config/Activator.java
cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/AggregatedActivator.java
cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/SPIActivator.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/ClassUtils.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/EndpointListenerImpl.java
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ListenerHookImpl.java
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ServiceListenerImpl.java
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java
Modified:
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/Activator.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/Activator.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/Activator.java
(original)
+++
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/Activator.java
Fri Jun 15 12:32:04 2012
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.osgi.framework.BundleActivator;
@@ -53,7 +54,8 @@ public class Activator implements Bundle
}
public synchronized void updated(Dictionary configuration) throws
ConfigurationException {
- LOG.info("Received configuration update for Zookeeper Discovery: " +
configuration);
+ if (LOG.isLoggable(Level.FINE))
+ LOG.fine("Received configuration update for Zookeeper Discovery: "
+ configuration);
if (configuration == null)
return;
@@ -68,8 +70,10 @@ public class Activator implements Bundle
}
if (zkProperties.equals(effective)) {
- LOG.info("properties haven't changed ...");
+ LOG.info("Update called, but actual settings haven't changed ...");
return;
+ } else if (LOG.isLoggable(Level.INFO)) {
+ LOG.info("Updating configuration for Zookeeper Discovery: " +
configuration);
}
zkProperties = effective;
@@ -84,7 +88,7 @@ public class Activator implements Bundle
try {
zkd.start();
} catch (IOException e) {
- e.printStackTrace();
+ LOG.log(Level.SEVERE, "Failed to start the Zookeeper Discovery
component.", e);
}
}
Modified:
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerImpl.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerImpl.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerImpl.java
(original)
+++
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerImpl.java
Fri Jun 15 12:32:04 2012
@@ -79,7 +79,7 @@ public class EndpointListenerImpl implem
for (String name : interfaces) {
String path = Util.getZooKeeperPath(name);
String fullPath = path + '/' + endpointKey;
- LOG.info("Creating ZooKeeper node: " + fullPath);
+ LOG.fine("Creating ZooKeeper node: " + fullPath);
ensurePath(path, zk);
zk.create(fullPath, getData(endpoint),
Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
Modified:
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerTrackerCustomizer.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerTrackerCustomizer.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerTrackerCustomizer.java
(original)
+++
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/EndpointListenerTrackerCustomizer.java
Fri Jun 15 12:32:04 2012
@@ -24,6 +24,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -57,31 +58,36 @@ public class EndpointListenerTrackerCust
}
public Object addingService(ServiceReference sref) {
- LOG.fine("addingService: " + sref);
+ LOG.info("addingService: " + sref);
handleEndpointListener(sref);
return sref;
}
public void modifiedService(ServiceReference sref, Object service) {
- LOG.fine("modifiedService: " + sref);
+ LOG.info("modifiedService: " + sref);
handleEndpointListener(sref);
}
private void handleEndpointListener(ServiceReference sref) {
- for (String key : sref.getPropertyKeys()) {
- LOG.finest("modifiedService: property: " + key + " => " +
sref.getProperty(key));
+ if (LOG.isLoggable(Level.FINEST)) {
+ for (String key : sref.getPropertyKeys()) {
+ LOG.finest("modifiedService: property: " + key + " => " +
sref.getProperty(key));
+ }
}
-
if("true".equals(sref.getProperty(EndpointListenerFactory.DISCOVERY_ZOOKEEPER_ID))){
+ if (Boolean.parseBoolean(String.valueOf(
+
sref.getProperty(EndpointListenerFactory.DISCOVERY_ZOOKEEPER_ID)))) {
LOG.finest("found my own endpointListener ... skipping it");
return;
}
String[] scopes = Util.getScopes(sref);
- LOG.info("trying to discover services for scopes[" + scopes.length +
"]: ");
- if(scopes!=null) for (String scope : scopes) {
- LOG.info("Scope: "+scope);
+ if (LOG.isLoggable(Level.FINE)) {
+ LOG.fine("trying to discover services for scopes[" + scopes.length
+ "]: ");
+ for (String scope : scopes) {
+ LOG.fine("Scope: "+scope);
+ }
}
if (scopes.length > 0) {
for (String scope : scopes) {
Modified:
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceDataMonitorListenerImpl.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceDataMonitorListenerImpl.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceDataMonitorListenerImpl.java
(original)
+++
cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/InterfaceDataMonitorListenerImpl.java
Fri Jun 15 12:32:04 2012
@@ -120,7 +120,8 @@ public class InterfaceDataMonitorListene
break;
}
} catch (InvalidSyntaxException e) {
- e.printStackTrace();
+ LOG.log(Level.SEVERE, "Currentscope [" +
currentScope + "] resulted in"
+ + " a bad filter!", e);
}
}
}
@@ -142,7 +143,7 @@ public class InterfaceDataMonitorListene
List<String> children;
try {
- LOG.info("Processing the children of " + znode);
+ LOG.fine("Processing the children of " + znode);
children = zookeeper.getChildren(znode, false);
boolean foundANode = false;
@@ -187,7 +188,7 @@ public class InterfaceDataMonitorListene
return null;
}
byte[] data = zookeeper.getData(node, false, null);
- LOG.info("Child: " + node);
+ LOG.fine("Child: " + node);
List<Element> elements = LocalDiscoveryUtils.getElements(new
ByteArrayInputStream(data));
EndpointDescription epd = null;
@@ -224,7 +225,7 @@ public class InterfaceDataMonitorListene
private void notifyListeners(EndpointDescription epd, boolean isRemoval) {
- System.out.println("**************** notifyListeners("+epd+" ,
"+isRemoval+")");
+ LOG.fine("**************** notifyListeners("+epd+" ,
"+isRemoval+")");
for (ServiceReference sref :
discoveredServiceTracker.relatedServiceListeners) {
if (bctx.getService(sref) instanceof EndpointListener) {
Modified:
cxf/dosgi/trunk/discovery/distributed/zookeeper-server-config/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/server/config/Activator.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/distributed/zookeeper-server-config/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/server/config/Activator.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/discovery/distributed/zookeeper-server-config/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/server/config/Activator.java
(original)
+++
cxf/dosgi/trunk/discovery/distributed/zookeeper-server-config/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/server/config/Activator.java
Fri Jun 15 12:32:04 2012
@@ -20,6 +20,8 @@ package org.apache.cxf.dosgi.discovery.z
import java.io.IOException;
import java.net.ServerSocket;
import java.util.Hashtable;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -30,19 +32,19 @@ import org.osgi.service.cm.ManagedServic
import org.osgi.util.tracker.ServiceTracker;
public class Activator implements BundleActivator {
+ private static final Logger LOG =
Logger.getLogger(Activator.class.getName());
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";
private ServiceTracker st;
public void start(BundleContext context) throws Exception {
- synchronized("hi") {
- // String literals are interned, so this makes sure that only one
thread gets to set the port number
+ synchronized(Activator.class) {
+ // Only one thread gets to set the port number
if (System.getProperty(ZOOKEEPER_PORT) == null) {
String port = getFreePort();
System.setProperty(ZOOKEEPER_PORT, port);
- System.out.println("Set global zookeeper port to: " + port);
+ LOG.info("Global zookeeper port: " + port);
}
-
}
st = new ServiceTracker(context, ConfigurationAdmin.class.getName(),
null) {
@@ -57,9 +59,9 @@ public class Activator implements Bundle
String zp = System.getProperty(ZOOKEEPER_PORT);
props.put("clientPort", zp);
cfg.update(props);
- System.out.println("Set zookeeper client port to " +
zp);
+ LOG.fine("Set zookeeper client port to " + zp);
} catch (IOException e) {
- e.printStackTrace();
+ LOG.log(Level.SEVERE, "Failed to configure zookeeper
server!", e);
}
}
return svc;
@@ -79,7 +81,7 @@ public class Activator implements Bundle
props.put("zookeeper.host", "127.0.0.1");
props.put("zookeeper.port", System.getProperty(ZOOKEEPER_PORT));
ms.updated(props);
- System.out.println("Set the zookeeper.host on the Zookeeper Client
managed service.");
+ LOG.fine("Passed the zookeeper.host property to the Zookeeper Client
managed service.");
}
private String getFreePort() {
@@ -89,7 +91,7 @@ public class Activator implements Bundle
ss.close();
return port;
} catch (IOException e) {
- e.printStackTrace();
+ LOG.log(Level.SEVERE, "Failed to find a free port!", e);
return null;
}
}
Modified:
cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/AggregatedActivator.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/AggregatedActivator.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/AggregatedActivator.java
(original)
+++
cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/AggregatedActivator.java
Fri Jun 15 12:32:04 2012
@@ -27,6 +27,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.cxf.common.logging.LogUtils;
@@ -34,8 +35,8 @@ import org.osgi.framework.BundleActivato
import org.osgi.framework.BundleContext;
public class AggregatedActivator implements BundleActivator {
- private static final Logger LOG =
LogUtils.getL7dLogger(AggregatedActivator.class);
-
+ private static final Logger LOG =
LogUtils.getL7dLogger(AggregatedActivator.class);
+
static final String HTTP_PORT_PROPERTY = "org.osgi.service.http.port";
static final String HTTPS_PORT_PROPERTY =
"org.osgi.service.http.port.secure";
static final String HTTPS_ENABLED_PROPERTY =
"org.osgi.service.http.secure.enabled";
@@ -67,7 +68,7 @@ public class AggregatedActivator impleme
if (port == null || port.length() == 0) {
port = tryPortFree(DEFAULT_HTTP_PORT);
if (port == null) {
- LOG.info("Port " + DEFAULT_HTTP_PORT + " is not available. ");
+ LOG.fine("Port " + DEFAULT_HTTP_PORT + " is not available. ");
port = tryPortFree("0");
}
LOG.info("Setting HttpService port to: " + port);
@@ -76,10 +77,10 @@ public class AggregatedActivator impleme
System.setProperty(prop, port);
} else {
if (tryPortFree(port) == null) {
- LOG.info("The system is configured to use HttpService port "
+ LOG.warning("The system is configured to use HttpService port
"
+ port + ". However this port is already in use.");
} else {
- LOG.info("HttpService using port: " + port);
+ LOG.info("HttpService using port: " + port);
}
}
}
@@ -119,7 +120,7 @@ public class AggregatedActivator impleme
ba.start(ctx);
}
} catch (Throwable th) {
- th.printStackTrace();
+ LOG.log(Level.SEVERE, "Failed to start Activator " + s,
th);
}
}
Modified:
cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/SPIActivator.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/SPIActivator.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/SPIActivator.java
(original)
+++
cxf/dosgi/trunk/distribution/single-bundle/src/main/java/org/apache/cxf/dosgi/singlebundle/SPIActivator.java
Fri Jun 15 12:32:04 2012
@@ -29,7 +29,10 @@ import java.util.Vector;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.apache.cxf.common.logging.LogUtils;
import org.apache.servicemix.specs.locator.OsgiLocator;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
@@ -40,6 +43,7 @@ import org.springframework.core.io.Resou
import org.springframework.osgi.io.OsgiBundleResourcePatternResolver;
public class SPIActivator implements BundleActivator,
SynchronousBundleListener {
+ private static final Logger LOG =
LogUtils.getL7dLogger(SPIActivator.class);
private ConcurrentMap<Long, Map<String, Callable<Class>>> factories = new
ConcurrentHashMap<Long, Map<String, Callable<Class>>>();
public synchronized void start(BundleContext bundleContext) throws
Exception {
@@ -70,7 +74,7 @@ public class SPIActivator implements Bun
v.add(r.getURL());
}
} catch (IOException e1) {
- e1.printStackTrace();
+ LOG.log(Level.SEVERE, "Failed to resolve service resources", e1);
}
Enumeration<URL> e = v.elements();
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/ClassUtils.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/ClassUtils.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/ClassUtils.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/ClassUtils.java
Fri Jun 15 12:32:04 2012
@@ -23,6 +23,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.cxf.common.logging.LogUtils;
@@ -125,7 +126,7 @@ public final class ClassUtils {
providers.add(pClass.newInstance());
}
} catch (Exception ex) {
- ex.printStackTrace();
+ LOG.log(Level.FINE, "Failed to load provider, org ex: " +
ex.getMessage(), ex);
LOG.warning("Provider " + className.trim() + " can not be
loaded or created");
}
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
Fri Jun 15 12:32:04 2012
@@ -292,9 +292,9 @@ public final class OsgiUtils {
try {
return bc.createFilter(filterValue);
} catch (InvalidSyntaxException ex) {
- System.out.println("Invalid filter expression " + filterValue);
+ LOG.warning("Invalid filter expression " + filterValue);
} catch (Exception ex) {
- System.out.println("Problem creating a Filter from " +
filterValue);
+ LOG.warning("Problem creating a Filter from " + filterValue);
}
return null;
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
Fri Jun 15 12:32:04 2012
@@ -64,7 +64,7 @@ public final class ConfigTypeHandlerFact
return new WsdlConfigurationTypeHandler(dswBC, props);
}
- LOG.info("None of the configuration types in " + configurationTypes +
" is supported.");
+ LOG.warning("None of the configuration types in " + configurationTypes
+ " is supported.");
return null;
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtils.java
Fri Jun 15 12:32:04 2012
@@ -24,6 +24,7 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.cxf.common.logging.LogUtils;
@@ -75,8 +76,8 @@ public class JaxRSUtils {
return providers;
}
- boolean cxfProvidersOnly = OsgiUtils
- .getBooleanProperty(sd,
org.apache.cxf.dosgi.dsw.Constants.RS_PROVIDER_EXPECTED_PROP_KEY);
+ boolean cxfProvidersOnly = OsgiUtils.getBooleanProperty(sd,
+
org.apache.cxf.dosgi.dsw.Constants.RS_PROVIDER_EXPECTED_PROP_KEY);
try {
ServiceReference[] refs =
callingContext.getServiceReferences((String)null, PROVIDERS_FILTER);
@@ -91,8 +92,7 @@ public class JaxRSUtils {
}
}
} catch (Exception ex) {
- ex.printStackTrace();
- LOG.fine("Problems finding JAXRS providers " + ex.getMessage());
+ LOG.log(Level.FINE, "Problems finding JAXRS providers " +
ex.getMessage(), ex);
}
return providers;
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
Fri Jun 15 12:32:04 2012
@@ -155,7 +155,6 @@ public class PojoConfigurationTypeHandle
return null;
}
-
if (address == null) {
address = OsgiUtils.getProperty(sd, Constants.WS_ADDRESS_PROPERTY);
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventAdminHelper.java
Fri Jun 15 12:32:04 2012
@@ -20,6 +20,7 @@ package org.apache.cxf.dosgi.dsw.service
import java.util.Dictionary;
import java.util.Properties;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.cxf.common.logging.LogUtils;
@@ -114,7 +115,7 @@ public class EventAdminHelper {
try {
refs = bctx.getAllServiceReferences(EventAdmin.class.getName(),
null);
} catch (InvalidSyntaxException e) {
- e.printStackTrace();
+ LOG.log(Level.SEVERE, "Failed to get EventAdmin: " +
e.getMessage(), e);
}
if (refs == null)
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/EventProducer.java
Fri Jun 15 12:32:04 2012
@@ -19,6 +19,7 @@
package org.apache.cxf.dosgi.dsw.service;
import java.util.List;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.cxf.common.logging.LogUtils;
@@ -76,7 +77,7 @@ public class EventProducer {
}
} catch (InvalidSyntaxException e) {
- e.printStackTrace();
+ LOG.log(Level.SEVERE, e.getMessage(), e);
}
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java
Fri Jun 15 12:32:04 2012
@@ -20,6 +20,7 @@ package org.apache.cxf.dosgi.dsw.service
import java.util.Map;
import java.util.Set;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.cxf.common.logging.LogUtils;
@@ -204,7 +205,7 @@ public class ExportRegistrationImpl impl
try {
f = bctx.createFilter("("+Constants.SERVICE_ID+"="+sid+")");
} catch (InvalidSyntaxException e) {
- e.printStackTrace();
+ LOG.log(Level.FINE, e.getMessage(), e);
LOG.warning("Service tracker could not be started. The service
will not be automatically unexported.");
return;
}
Modified:
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
Fri Jun 15 12:32:04 2012
@@ -191,7 +191,7 @@ public class RemoteServiceAdminCore impl
// if no interface is to be exported return null
if (interfaces.size() == 0) {
- LOG.info("no interfaces to be exported");
+ LOG.warning("no interfaces to be exported");
// TODO: publish error event ? not sure
return Collections.EMPTY_LIST;
}
@@ -344,7 +344,7 @@ public class RemoteServiceAdminCore impl
*/
public ImportRegistration importService(EndpointDescription endpoint) {
- LOG.info("importService() Endpoint: " + endpoint.getProperties());
+ LOG.fine("importService() Endpoint: " + endpoint.getProperties());
synchronized (importedServices) {
if (importedServices.containsKey(endpoint) &&
importedServices.get(endpoint).size() > 0) {
@@ -395,7 +395,7 @@ public class RemoteServiceAdminCore impl
// ?
List<String> matchingInterfaces = endpoint.getInterfaces();
- LOG.info("Interfaces: " + matchingInterfaces);
+ LOG.info("Matching Interfaces for import: " + matchingInterfaces);
if (matchingInterfaces.size() == 1) {
LOG.info("Proxifying interface : " +
matchingInterfaces.get(0));
Modified:
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/Activator.java
Fri Jun 15 12:32:04 2012
@@ -55,7 +55,7 @@ public class Activator implements Bundle
}
public void start(BundleContext bc) throws Exception {
- LOG.info("TopologyManager: start()");
+ LOG.fine("TopologyManager: start()");
remoteServiceAdminList = createRemoteServiceAdminList(bc);
topManager = createTopologyManager(bc,remoteServiceAdminList);
topManagerImport =
createTopologyManagerImport(bc,remoteServiceAdminList);
@@ -77,7 +77,7 @@ public class Activator implements Bundle
}
public void stop(BundleContext bc) throws Exception {
- LOG.info("TopologyManager: stop()");
+ LOG.fine("TopologyManager: stop()");
topManager.stop();
topManagerImport.stop();
remoteServiceAdminList.stop();
Modified:
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/EndpointListenerImpl.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/EndpointListenerImpl.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/EndpointListenerImpl.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/EndpointListenerImpl.java
Fri Jun 15 12:32:04 2012
@@ -60,7 +60,7 @@ public class EndpointListenerImpl implem
return;
- LOG.info("EndpointListener: extending scope by " + filter);
+ LOG.fine("EndpointListener: extending scope by " + filter);
synchronized (filters) {
filters.add(filter);
@@ -75,7 +75,7 @@ public class EndpointListenerImpl implem
return;
- LOG.info("EndpointListener: reducing scope by " + filter);
+ LOG.fine("EndpointListener: reducing scope by " + filter);
synchronized (filters) {
filters.remove(filter);
}
@@ -86,7 +86,7 @@ public class EndpointListenerImpl implem
Properties p = new Properties();
synchronized (filters) {
- LOG.info("EndpointListener: current filter: " + filters);
+ LOG.finer("EndpointListener: current filter: " + filters);
// TODO: make a copy of the filter list
p.put(EndpointListener.ENDPOINT_LISTENER_SCOPE, filters);
}
@@ -95,14 +95,14 @@ public class EndpointListenerImpl implem
}
private void updateRegistration() {
-
- LOG.info("EndpointListenerImpl: filters: " + filters);
+ // This tends to be verbose.
+ LOG.finer("EndpointListenerImpl: filters: " + filters);
serviceRegistration.setProperties(getRegistrationProperties());
}
public void endpointAdded(EndpointDescription epd, String filter) {
- LOG.info("EndpointListenerImpl: EndpointAdded() filter:"+filter+"
EndpointDesc:"+epd);
+ LOG.fine("EndpointListenerImpl: EndpointAdded() filter:"+filter+"
EndpointDesc:"+epd);
if(filter==null){
LOG.severe("Endpoint is not handled because no matching filter was
provided! Filter: "+filter);
@@ -115,7 +115,7 @@ public class EndpointListenerImpl implem
}
public void endpointRemoved(EndpointDescription epd, String filter) {
- LOG.info("EndpointListenerImpl: EndpointRemoved() -> "+epd);
+ LOG.fine("EndpointListenerImpl: EndpointRemoved() -> "+epd);
topManager.removeImportableService(filter, epd);
}
Modified:
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ListenerHookImpl.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ListenerHookImpl.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ListenerHookImpl.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ListenerHookImpl.java
Fri Jun 15 12:32:04 2012
@@ -21,6 +21,7 @@ package org.apache.cxf.dosgi.topologyman
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
+import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -68,25 +69,27 @@ public class ListenerHookImpl implements
}
public void added(Collection listeners) {
- LOG.fine("ListenerHookImpl: added() " + listeners);
+ if (LOG.isLoggable(Level.FINE)) {
+ LOG.fine("ListenerHookImpl: added() " + listeners);
+ }
for (Object li : listeners) {
ListenerInfo listenerInfo = (ListenerInfo)li;
- LOG.info("*** Filter: " + listenerInfo.getFilter());
+ LOG.fine("*** Filter: " + listenerInfo.getFilter());
String className =
getClassNameFromFilter(listenerInfo.getFilter());
if
(listenerInfo.getBundleContext().getBundle().equals(bctx.getBundle())) {
- LOG.info("ListenerHookImpl: skipping request from myself");
+ LOG.fine("ListenerHookImpl: skipping request from myself");
continue;
}
if (listenerInfo.getFilter() == null) {
- LOG.info("ListenerHookImpl: skipping empty filter");
+ LOG.fine("ListenerHookImpl: skipping empty filter");
continue;
}
if (isClassExcluded(className)) {
- LOG.info("ListenerHookImpl: skipping import request for
excluded classs ["
+ LOG.fine("ListenerHookImpl: skipping import request for
excluded classs ["
+ className + "]");
continue;
}
@@ -98,11 +101,13 @@ public class ListenerHookImpl implements
}
public void removed(Collection listeners) {
- LOG.info("ListenerHookImpl: removed: " + listeners);
+ if (LOG.isLoggable(Level.FINE)) {
+ LOG.fine("ListenerHookImpl: removed: " + listeners);
+ }
for (Object li : listeners) {
ListenerInfo listenerInfo = (ListenerInfo)li;
- LOG.info(listenerInfo.getFilter());
+ LOG.fine("*** Filter: " + listenerInfo.getFilter());
// TODO: determine if service was handled ?
Modified:
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ServiceListenerImpl.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ServiceListenerImpl.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ServiceListenerImpl.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ServiceListenerImpl.java
Fri Jun 15 12:32:04 2012
@@ -61,7 +61,7 @@ public class ServiceListenerImpl impleme
if (event.getType() == ServiceEvent.REGISTERED) {
LOG.fine("Registered");
if (analyzeService(sref)) {
- LOG.info("calling TopologyManager -> registered service");
+ LOG.fine("calling TopologyManager -> registered service");
topManager.exportService(sref);
}
} else if (event.getType() == ServiceEvent.UNREGISTERING) {
Modified:
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java
URL:
http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java?rev=1350599&r1=1350598&r2=1350599&view=diff
==============================================================================
---
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java
(original)
+++
cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java
Fri Jun 15 12:32:04 2012
@@ -21,7 +21,6 @@ package org.apache.cxf.dosgi.topologyman
import java.util.Collection;
import java.util.Collections;
import java.util.Dictionary;
-import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.List;
@@ -93,8 +92,7 @@ public class TopologyManager {
stEndpointListeners = new ServiceTracker(ctx,
EndpointListener.class.getName(), null) {
@Override
public Object addingService(ServiceReference reference) {
- LOG
- .info("TopologyManager: new EndpointListener that wants to
be informed about wants going on ... ");
+ LOG.fine("TopologyManager: new EndpointListener that wants to
be informed about whats going on ... ");
notify(reference);
@@ -103,15 +101,14 @@ public class TopologyManager {
@Override
public void modifiedService(ServiceReference reference, Object
service) {
- LOG.info("TopologyManager: EndpointListener changed ... ");
+ LOG.fine("TopologyManager: EndpointListener changed ... ");
notify(reference);
super.modifiedService(reference, service);
}
private void notify(ServiceReference reference) {
synchronized (exportedServices) {
- for (Map<RemoteServiceAdmin,
Collection<ExportRegistration>> exports : exportedServices
- .values()) {
+ for (Map<RemoteServiceAdmin,
Collection<ExportRegistration>> exports : exportedServices.values()) {
for (Collection<ExportRegistration> regs :
exports.values()) {
if (regs != null)
notifyListenerOfAddingIfAppropriate(reference,
regs);
@@ -136,11 +133,13 @@ public class TopologyManager {
try {
ServiceReference[] refs =
Utils.getEndpointListeners(bctx);
- for (ServiceReference sref : refs) {
- notifyListenersOfRemovalIfAppropriate(sref,
endpoints);
+ if (refs != null) {
+ for (ServiceReference sref : refs) {
+ notifyListenersOfRemovalIfAppropriate(sref,
endpoints);
+ }
}
} catch (InvalidSyntaxException e) {
- e.printStackTrace();
+ LOG.log(Level.SEVERE, e.getMessage(), e);
}
// remove all management information for the
RemoteServiceAdmin
@@ -151,19 +150,19 @@ public class TopologyManager {
}
protected void triggerExportImportForRemoteServiceAdmin(RemoteServiceAdmin
rsa) {
- LOG.info("TopologyManager: triggerExportImportForRemoteSericeAdmin()");
+ LOG.finer("TopologyManager:
triggerExportImportForRemoteSericeAdmin()");
synchronized (exportedServices) {
for (Map.Entry<ServiceReference, Map<RemoteServiceAdmin,
Collection<ExportRegistration>>> exports : exportedServices
.entrySet()) {
if (exports.getValue().containsKey(rsa)) {
// already handled....
- LOG.info("TopologyManager: service from bundle "
+ LOG.fine("TopologyManager: service from bundle "
+ exports.getKey().getBundle().getSymbolicName()
+ "is already handled by this RSA");
} else {
// trigger export of this service....
- LOG.info("TopologyManager: service from bundle "
+ LOG.fine("TopologyManager: service from bundle "
+ exports.getKey().getBundle().getSymbolicName()
+ " is to be exported by this RSA");
triggerExport(exports.getKey());
@@ -181,7 +180,7 @@ public class TopologyManager {
try {
checkExistingServices();
} catch (InvalidSyntaxException e) {
- e.printStackTrace();
+ LOG.log(Level.FINER, "Failed to check existing services.", e);
}
}
@@ -222,8 +221,7 @@ public class TopologyManager {
// add to local list of services that should/are be exported
synchronized (exportedServices) {
- LOG
- .info("TopologyManager: adding service to exportedServices
list to export it --- from bundle: "
+ LOG.info("TopologyManager: adding service to exportedServices list
to export it --- from bundle: "
+ sref.getBundle().getSymbolicName());
exportedServices.put(sref,
new LinkedHashMap<RemoteServiceAdmin,
Collection<ExportRegistration>>());
@@ -238,7 +236,7 @@ public class TopologyManager {
execService.execute(new Runnable() {
@SuppressWarnings("unchecked")
public void run() {
- LOG.info("TopologyManager: exporting service ...");
+ LOG.finer("TopologyManager: exporting service ...");
Map<RemoteServiceAdmin, Collection<ExportRegistration>>
exports = null;
@@ -260,15 +258,15 @@ public class TopologyManager {
if (exports.containsKey(remoteServiceAdmin)) {
// already handled by this remoteServiceAdmin
- LOG.info("TopologyManager: already handled by
this remoteServiceAdmin -> skipping");
+ LOG.fine("TopologyManager: already handled by
this remoteServiceAdmin -> skipping");
} else {
// TODO: additional parameter Map ?
- LOG.info("TopologyManager: exporting ...");
+ LOG.fine("TopologyManager: exporting ...");
Collection<ExportRegistration> endpoints =
remoteServiceAdmin
.exportService(sref, null);
if (endpoints == null) {
// TODO export failed -> What should be
done here?
- LOG.info("TopologyManager: export failed");
+ LOG.severe("TopologyManager: export
failed");
exports.put(remoteServiceAdmin, null);
} else {
LOG.info("TopologyManager: export
sucessful Endpoints:" + endpoints);
@@ -299,7 +297,7 @@ public class TopologyManager {
}
} catch (InvalidSyntaxException e) {
- e.printStackTrace();
+ LOG.log(Level.SEVERE, e.getMessage(), e);
}
}
@@ -321,7 +319,7 @@ public class TopologyManager {
EndpointListener epl = (EndpointListener)bctx.getService(sref);
- LOG.info("TopologyManager: notifyListenerOfAddingIfAppropriate() ");
+ LOG.finer("TopologyManager: notifyListenerOfAddingIfAppropriate() ");
try {
@@ -333,23 +331,24 @@ public class TopologyManager {
Map props =
exReg.getExportReference().getExportedEndpoint().getProperties();
Dictionary d = new Hashtable(props);
- for (Filter filter : filters) {
- LOG.info("Matching: " + filter + " against " + d);
+ if (LOG.isLoggable(Level.FINE)) {
+ for (Filter filter : filters) {
+ LOG.fine("Matching: " + filter + " against " + d);
+ }
}
for (Filter filter : filters) {
if (filter.match(d)) {
- LOG.info("Listener mached one of the Endpoints !!!!: "
+ epl);
+ LOG.fine("Listener mached one of the Endpoints !!!!: "
+ epl);
- epl
-
.endpointAdded(exReg.getExportReference().getExportedEndpoint(), filter
+
epl.endpointAdded(exReg.getExportReference().getExportedEndpoint(), filter
.toString());
}
}
}
} catch (InvalidSyntaxException e) {
- e.printStackTrace();
+ LOG.log(Level.SEVERE, e.getMessage(), e);
}
}
@@ -358,7 +357,7 @@ public class TopologyManager {
EndpointListener epl = (EndpointListener)bctx.getService(sref);
- LOG.info("TopologyManager: notifyListenerOfREMOVALIfAppropriate() ");
+ LOG.finer("TopologyManager: notifyListenerOfREMOVALIfAppropriate() ");
List<Filter> filters;
try {
@@ -372,13 +371,15 @@ public class TopologyManager {
Map props = endpoint.getProperties();
Dictionary d = new Hashtable(props);
- for (Filter filter : filters) {
- LOG.info("Matching: " + filter + " against " + d);
+ if (LOG.isLoggable(Level.FINE)) {
+ for (Filter filter : filters) {
+ LOG.fine("Matching: " + filter + " against " + d);
+ }
}
for (Filter filter : filters) {
if (filter.match(d)) {
- LOG.info("Listener matched one of the Endpoints !!!!
--> calling removed() ...");
+ LOG.fine("Listener matched one of the Endpoints !!!!
--> calling removed() ...");
epl.endpointRemoved(exReg.getExportReference().getExportedEndpoint(), filter
.toString());
@@ -386,8 +387,7 @@ public class TopologyManager {
}
}
} catch (InvalidSyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ LOG.log(Level.SEVERE, e.getMessage(), e);
}
}