svn commit r40290 - in branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2: identity identity/styles identity/styles/internal solutions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svn commit r40290 - in branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2: identity identity/styles identity/styles/internal solutions

Prabath Siriwardena
Author: prabath
Date: Mon Jun 29 03:22:51 2009
New Revision: 40290
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=40290

Log:
changing styles package name

Added:
   branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2/identity/
   branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2/identity/styles/
   branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2/identity/styles/internal/
   branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2/identity/styles/internal/Activator.java
Removed:
   branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2/solutions/

Added: branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2/identity/styles/internal/Activator.java
URL: http://wso2.org/svn/browse/wso2/branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2/identity/styles/internal/Activator.java?pathrev=40290
==============================================================================
--- (empty file)
+++ branches/solutions/identity/2.0/product/modules/styles/src/main/java/org/wso2/identity/styles/internal/Activator.java Mon Jun 29 03:22:51 2009
@@ -0,0 +1,46 @@
+package org.wso2.solutions.identity.styles.internal;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.http.HttpService;
+import org.osgi.service.http.HttpContext;
+import org.wso2.carbon.ui.DefaultComponentEntryHttpContext;
+import org.eclipse.equinox.http.helper.ContextPathServletAdaptor;
+import org.eclipse.equinox.jsp.jasper.JspServlet;
+
+import javax.servlet.Servlet;
+
+public class Activator implements BundleActivator {
+
+    private static String CONTEXT = "/styles";
+
+    private static String INTERNAL_CONTEXT = "/web";
+
+    public void start(BundleContext bundleContext) throws Exception {
+
+        ServiceReference reference = bundleContext.getServiceReference(HttpService.class.getName());
+        if (reference != null) {
+            final HttpService httpService = (HttpService) bundleContext.getService(reference);
+            try {
+                HttpContext commonContext =
+                        new DefaultComponentEntryHttpContext(bundleContext.getBundle(), INTERNAL_CONTEXT);
+
+                //register our .jsp files at the httpService
+                Servlet servlet = new ContextPathServletAdaptor(
+                        new JspServlet(bundleContext.getBundle(), "/web"), CONTEXT);
+                httpService.registerResources(CONTEXT, "/", commonContext);
+            } catch (Exception e) {
+                //TODO what should we do here ???
+                throw e;
+            }
+        } else {
+            throw new Exception("HttpService is not found.");
+        }
+    }
+
+    public void stop(BundleContext context) throws Exception {
+
+    }
+
+}

_______________________________________________
Identity-dev mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/identity-dev
Loading...