You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2008/02/22 17:20:58 UTC
svn commit: r630241 - in
/webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi:
Activator.java ServiceRegistry.java
Author: dims
Date: Fri Feb 22 08:20:57 2008
New Revision: 630241
URL: http://svn.apache.org/viewvc?rev=630241&view=rev
Log:
some printlns to show what's happening in the system
Modified:
webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/Activator.java
webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java
Modified: webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/Activator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/Activator.java?rev=630241&r1=630240&r2=630241&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/Activator.java (original)
+++ webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/Activator.java Fri Feb 22 08:20:57 2008
@@ -24,6 +24,7 @@
import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleListener;
import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Bundle;
import org.osgi.service.http.HttpService;
import org.osgi.service.log.LogService;
@@ -37,7 +38,7 @@
public void start(BundleContext context) throws Exception {
this.context = context;
- context.addBundleListener(this);
+ System.out.println("[Axis2/OSGi] Registering Axis2 Servlet");
ServiceReference sr = context.getServiceReference(HttpService.class.getName());
if (sr != null) {
@@ -46,7 +47,7 @@
httpServ.registerServlet("/axis2",
servlet, null, null);
} catch (Exception e) {
- System.err.println("Exception registering Axis Servlet:"
+ System.err.println("[Axis2/OSGi] Exception registering Axis Servlet:"
+ e);
}
}
@@ -55,10 +56,13 @@
if (sr2 != null) {
log = (LogService) context.getService(sr);
if (log == null) {
- System.err.println("Unable to find Log Service");
+ System.err.println("[Axis2/OSGi] Unable to find Log Service");
}
}
+ System.out.println("[Axis2/OSGi] Starting Bundle Listener");
+ context.addBundleListener(this);
+
registry = new ServiceRegistry(servlet, log);
// TODO: We should poke at all the bundles already in the system
@@ -74,15 +78,18 @@
}
public void bundleChanged(BundleEvent event) {
+ Bundle bundle = event.getBundle();
switch (event.getType()) {
case BundleEvent.STARTED:
- if(context.getBundle() != event.getBundle()){
+ if(context.getBundle() != bundle){
+ System.out.println("[Axis2/OSGi] Starting any services in Bundle - " + bundle.getSymbolicName());
registry.register(event.getBundle());
}
break;
case BundleEvent.STOPPED:
- if(context.getBundle() != event.getBundle()){
+ if(context.getBundle() != bundle){
+ System.out.println("[Axis2/OSGi] Stopping any services in Bundle - " + bundle.getSymbolicName());
registry.unregister(event.getBundle());
}
break;
@@ -90,6 +97,7 @@
}
public void stop(BundleContext context) throws Exception {
+ System.out.println("[Axis2/OSGi] Stopping all services and the Bundle Listener");
this.context.removeBundleListener(this);
registry.close();
}
Modified: webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java?rev=630241&r1=630240&r2=630241&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java (original)
+++ webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi/ServiceRegistry.java Fri Feb 22 08:20:57 2008
@@ -59,11 +59,11 @@
try {
AxisServiceGroup serviceGroup = deployClasses(bundle.getSymbolicName(), null, loader, classes);
if (serviceGroup != null) {
- System.out.println("Deployed ServiceGroup - " + serviceGroup.getServiceGroupName());
+ System.out.println("[Axis2/OSGi] Deployed ServiceGroup - " + serviceGroup.getServiceGroupName());
for (Iterator iterator = serviceGroup.getServices(); iterator.hasNext();) {
AxisService service = (AxisService) iterator.next();
- System.out.println(" Service - " + service.getName());
+ System.out.println("[Axis2/OSGi] Service - " + service.getName());
}
services.put(bundle, serviceGroup);
}
@@ -77,11 +77,11 @@
AxisServiceGroup serviceGroup = (AxisServiceGroup) iterator.next();
try {
axisConfig.removeServiceGroup(serviceGroup.getServiceGroupName());
- System.out.println("Undeployed ServiceGroup - " + serviceGroup.getServiceGroupName());
+ System.out.println("[Axis2/OSGi] Undeployed ServiceGroup - " + serviceGroup.getServiceGroupName());
for (Iterator iterator2 = serviceGroup.getServices(); iterator2.hasNext();) {
AxisService service = (AxisService) iterator2.next();
- System.out.println(" Service - " + service.getName());
+ System.out.println("[Axis2/OSGi] Service - " + service.getName());
}
} catch (AxisFault axisFault) {
log.log(LogService.LOG_INFO, axisFault.getMessage(), axisFault);
@@ -94,11 +94,11 @@
if (serviceGroup != null) {
try {
axisConfig.removeServiceGroup(serviceGroup.getServiceGroupName());
- System.out.println("Undeployed ServiceGroup - " + serviceGroup.getServiceGroupName());
+ System.out.println("[Axis2/OSGi] Undeployed ServiceGroup - " + serviceGroup.getServiceGroupName());
for (Iterator iterator2 = serviceGroup.getServices(); iterator2.hasNext();) {
AxisService service = (AxisService) iterator2.next();
- System.out.println(" Service - " + service.getName());
+ System.out.println("[Axis2/OSGi] Service - " + service.getName());
}
} catch (AxisFault axisFault) {
log.log(LogService.LOG_INFO, axisFault.getMessage(), axisFault);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org