incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1060265 - in /sling/trunk/installer/factories/deploymentpck: pom.xml src/main/java/org/apache/sling/installer/factories/deploypck/impl/Activator.java
Date Tue, 18 Jan 2011 09:25:45 GMT
Author: cziegeler
Date: Tue Jan 18 09:25:44 2011
New Revision: 1060265

URL: http://svn.apache.org/viewvc?rev=1060265&view=rev
Log:
First version of deployment package support for the installer.

Modified:
    sling/trunk/installer/factories/deploymentpck/pom.xml
    sling/trunk/installer/factories/deploymentpck/src/main/java/org/apache/sling/installer/factories/deploypck/impl/Activator.java

Modified: sling/trunk/installer/factories/deploymentpck/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/installer/factories/deploymentpck/pom.xml?rev=1060265&r1=1060264&r2=1060265&view=diff
==============================================================================
--- sling/trunk/installer/factories/deploymentpck/pom.xml (original)
+++ sling/trunk/installer/factories/deploymentpck/pom.xml Tue Jan 18 09:25:44 2011
@@ -52,7 +52,7 @@
                             org.apache.sling.installer.factories.deploypck.impl.Activator
                         </Bundle-Activator>
                         <Private-Package>
-                            org.apache.sling.installer.factories.deploypck..impl.*
+                            org.apache.sling.installer.factories.deploypck.impl.*
                         </Private-Package>
                     </instructions>
                 </configuration>

Modified: sling/trunk/installer/factories/deploymentpck/src/main/java/org/apache/sling/installer/factories/deploypck/impl/Activator.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/factories/deploymentpck/src/main/java/org/apache/sling/installer/factories/deploypck/impl/Activator.java?rev=1060265&r1=1060264&r2=1060265&view=diff
==============================================================================
--- sling/trunk/installer/factories/deploymentpck/src/main/java/org/apache/sling/installer/factories/deploypck/impl/Activator.java
(original)
+++ sling/trunk/installer/factories/deploymentpck/src/main/java/org/apache/sling/installer/factories/deploypck/impl/Activator.java
Tue Jan 18 09:25:44 2011
@@ -50,6 +50,7 @@ public class Activator implements Servic
      */
     public void start(final BundleContext context) throws Exception {
         this.bundleContext = context;
+        this.getAdmin();
         this.bundleContext.addServiceListener(this, "(" + Constants.OBJECTCLASS
                 + "=" + DEPLOYMENT_ADMIN + ")");
 
@@ -63,26 +64,30 @@ public class Activator implements Servic
         this.bundleContext = null;
     }
 
+    private void getAdmin() {
+        this.deploymentAdminReference = this.bundleContext.getServiceReference(DEPLOYMENT_ADMIN);
+        if ( this.deploymentAdminReference != null ) {
+            final DeploymentAdmin deploymentAdmin = (DeploymentAdmin) this.bundleContext.getService(this.deploymentAdminReference);
+            if ( deploymentAdmin == null ) {
+                this.deploymentAdminReference = null;
+            } else {
+                final Dictionary<String, Object> props = new Hashtable<String, Object>();
+                props.put(Constants.SERVICE_DESCRIPTION, "Apache Sling Installer Support
for Deployment Packages");
+                props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
+                this.serviceReg = this.bundleContext.registerService(new String[] {ResourceTransformer.class.getName(),
+                        InstallTaskFactory.class.getName()},
+                    new DeploymentPackageInstaller(deploymentAdmin), props);
+            }
+        }
+    }
+
     /**
      * Wait for the deployment admin service.
      * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent)
      */
-    public synchronized void serviceChanged(ServiceEvent event) {
+    public synchronized void serviceChanged(final ServiceEvent event) {
         if ( event.getType() == ServiceEvent.REGISTERED && this.deploymentAdminReference
== null ) {
-            this.deploymentAdminReference = this.bundleContext.getServiceReference(DEPLOYMENT_ADMIN);
-            if ( this.deploymentAdminReference != null ) {
-                final DeploymentAdmin deploymentAdmin = (DeploymentAdmin) this.bundleContext.getService(this.deploymentAdminReference);
-                if ( deploymentAdmin == null ) {
-                    this.deploymentAdminReference = null;
-                } else {
-                    final Dictionary<String, Object> props = new Hashtable<String,
Object>();
-                    props.put(Constants.SERVICE_DESCRIPTION, "Apache Sling Installer Support
for Deployment Packages");
-                    props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
-                    this.serviceReg = this.bundleContext.registerService(new String[] {ResourceTransformer.class.getName(),
-                            InstallTaskFactory.class.getName()},
-                        new DeploymentPackageInstaller(deploymentAdmin), props);
-                }
-            }
+            this.getAdmin();
         } else if ( event.getType() == ServiceEvent.UNREGISTERING && this.deploymentAdminReference
!= null ) {
             this.unregister();
         }



Mime
View raw message