Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 57858 invoked from network); 22 Feb 2008 16:21:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2008 16:21:20 -0000 Received: (qmail 29019 invoked by uid 500); 22 Feb 2008 16:21:14 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 28891 invoked by uid 500); 22 Feb 2008 16:21:14 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 28880 invoked by uid 500); 22 Feb 2008 16:21:14 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 28877 invoked by uid 99); 22 Feb 2008 16:21:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 08:21:14 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 16:20:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BEE541A9832; Fri, 22 Feb 2008 08:20:58 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r630241 - in /webservices/axis2/trunk/java/modules/osgi/src/org/apache/axis2/extensions/osgi: Activator.java ServiceRegistry.java Date: Fri, 22 Feb 2008 16:20:58 -0000 To: axis2-cvs@ws.apache.org From: dims@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080222162058.BEE541A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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