summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Liebig2008-02-27 10:04:49 (EST)
committerStefan Liebig2008-02-27 10:04:49 (EST)
commitb8f7cd86c86b2866fb0dd25d65e0405e82ffe933 (patch)
treeaa9c0f9231242add62f5029e5391aebf8f40bbbc
parent0b815a680d6f5a62029232113318e7a5a219f9c4 (diff)
downloadorg.eclipse.riena.old-b8f7cd86c86b2866fb0dd25d65e0405e82ffe933.zip
org.eclipse.riena.old-b8f7cd86c86b2866fb0dd25d65e0405e82ffe933.tar.gz
org.eclipse.riena.old-b8f7cd86c86b2866fb0dd25d65e0405e82ffe933.tar.bz2
real logging
-rw-r--r--org.eclipse.riena.communication.discovery/src/org/eclipse/riena/internal/communication/discovery/RemoteServiceDiscovery.java20
-rw-r--r--org.eclipse.riena.communication.registry/src/org/eclipse/riena/internal/communication/registry/RemoteServiceRegistry.java4
2 files changed, 12 insertions, 12 deletions
diff --git a/org.eclipse.riena.communication.discovery/src/org/eclipse/riena/internal/communication/discovery/RemoteServiceDiscovery.java b/org.eclipse.riena.communication.discovery/src/org/eclipse/riena/internal/communication/discovery/RemoteServiceDiscovery.java
index a0cff86..075f1ce 100644
--- a/org.eclipse.riena.communication.discovery/src/org/eclipse/riena/internal/communication/discovery/RemoteServiceDiscovery.java
+++ b/org.eclipse.riena.communication.discovery/src/org/eclipse/riena/internal/communication/discovery/RemoteServiceDiscovery.java
@@ -17,6 +17,7 @@ import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
+import org.eclipse.equinox.log.Logger;
import org.eclipse.riena.communication.core.IRemoteServiceReference;
import org.eclipse.riena.communication.core.IRemoteServiceRegistration;
import org.eclipse.riena.communication.core.IRemoteServiceRegistry;
@@ -25,6 +26,7 @@ import org.eclipse.riena.communication.core.factory.RemoteServiceFactory;
import org.eclipse.riena.communication.core.publisher.IServicePublishEventDispatcher;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
import com.caucho.hessian.client.HessianRuntimeException;
@@ -40,6 +42,8 @@ public class RemoteServiceDiscovery {
private Map<String, RemoteServiceDescription> unpublishedServices = new HashMap<String, RemoteServiceDescription>();
private BundleContext context;
+ private final static Logger LOGGER = Activator.getDefault().getLogger(RemoteServiceDiscovery.class.getName());
+
RemoteServiceDiscovery(BundleContext context) {
super();
this.context = context;
@@ -53,9 +57,8 @@ public class RemoteServiceDiscovery {
private synchronized RemoteServiceDescription[] getAllServices() {
ServiceReference refPublisher = context.getServiceReference(IServicePublishEventDispatcher.ID);
if (refPublisher == null) {
- System.out
- .println("Riena::RemoteServiceDiscovery:: WARN no IServicePublishEventDispatcher service available ["
- + IServicePublishEventDispatcher.ID + "]");
+ LOGGER.log(LogService.LOG_WARNING, "no IServicePublishEventDispatcher service available ["
+ + IServicePublishEventDispatcher.ID + "]");
return EMPTY_SERVICE_ENTRY_ARRAY;
}
IServicePublishEventDispatcher servicePublisher = (IServicePublishEventDispatcher) context
@@ -108,12 +111,12 @@ public class RemoteServiceDiscovery {
Class<?> interfaceClass = loadClass(rsDesc);
rsDesc.setServiceInterfaceClass(interfaceClass);
- System.out.println("creating service with uri=" + rsDesc.getURL());
+ LOGGER.log(LogService.LOG_DEBUG, "creating service with uri=" + rsDesc.getURL());
IRemoteServiceReference rsRef = createReference(rsDesc);
if (rsRef != null) {
rsReferences.add(rsRef);
} else {
- System.out.println("*****************");
+ LOGGER.log(LogService.LOG_DEBUG, "*****************");
addAsUnpublished(rsDesc);
}
@@ -163,9 +166,7 @@ public class RemoteServiceDiscovery {
return new RemoteServiceFactory().loadClass(interfaceClassName);
} catch (Exception e) {
e.printStackTrace();
- throw new RuntimeException(
- "Riena:Communication::RemoteServiceDiscovery:: ERROR could not create web service interface for ["
- + interfaceClassName + "]", e);
+ throw new RuntimeException("Could not create web service interface for [" + interfaceClassName + "]", e);
}
}
@@ -189,8 +190,7 @@ public class RemoteServiceDiscovery {
updateInRegistry(serviceDescriptions);
}
} catch (HessianRuntimeException ex) {
- System.out.println("System::Riena:Communication::update of services from server failed. "
- + ex.getLocalizedMessage());
+ LOGGER.log(LogService.LOG_ERROR, "update of services from server failed. " + ex.getLocalizedMessage());
}
}
}
diff --git a/org.eclipse.riena.communication.registry/src/org/eclipse/riena/internal/communication/registry/RemoteServiceRegistry.java b/org.eclipse.riena.communication.registry/src/org/eclipse/riena/internal/communication/registry/RemoteServiceRegistry.java
index 354a4af..ec5a5ab 100644
--- a/org.eclipse.riena.communication.registry/src/org/eclipse/riena/internal/communication/registry/RemoteServiceRegistry.java
+++ b/org.eclipse.riena.communication.registry/src/org/eclipse/riena/internal/communication/registry/RemoteServiceRegistry.java
@@ -104,7 +104,7 @@ public class RemoteServiceRegistry implements IRemoteServiceRegistry {
RemoteServiceRegistration remoteServiceReg = new RemoteServiceRegistration(reference, this);
registeredServices.put(url, remoteServiceReg);
- System.out.println("Riena::RemoteServiceRegistry:: DEBUG: OSGi NEW service registered id: "
+ LOGGER.log(LogService.LOG_DEBUG, "OSGi NEW service registered id: "
+ reference.getServiceInterfaceClassName());
return remoteServiceReg;
} else {
@@ -133,7 +133,7 @@ public class RemoteServiceRegistry implements IRemoteServiceRegistry {
String id = reference.getServiceInterfaceClassName();
registeredServices.remove(reference.getURL());
reference.dispose();
- System.out.println("Riena::RemoteServiceRegistry:: DEBUG: OSGi service removed id: " + id);
+ LOGGER.log(LogService.LOG_DEBUG, "OSGi service removed id: " + id);
}
}