Package org.osgi.service.http

Examples of org.osgi.service.http.HttpContext


        String password = ConfigurationUtil.getProperty(config, PROP_PASSWORD, DEFAULT_PASSWORD);

        // register the servlet and resources
        try
        {
            HttpContext httpContext = new OsgiManagerHttpContext(httpService,
                securityProviderTracker, userId, password, realm);

            Dictionary servletConfig = toStringConfig(config);

            // register this servlet and take note of this
View Full Code Here


    }

    public Object addingService(ServiceReference reference) {
        final HttpService httpService = (HttpService) context.getService(reference);
        try {
            HttpContext commonContext =
                    new BundleEntryHttpContext(context.getBundle(), "/web");
            httpService.registerResources("/jsp-examples", "/",
                                          commonContext);

            Servlet adaptedJspServlet = new ContextPathServletAdaptor(
View Full Code Here

        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);
View Full Code Here

    }

    public Object addingService(ServiceReference reference) {
      final HttpService httpService = (HttpService) context.getService(reference);
      try {     
        HttpContext commonContext = new BundleEntryHttpContext(context.getBundle(), "/web");
        httpService.registerResources("/struts-examples", "/", commonContext); //$NON-NLS-1$ //$NON-NLS-2$
       
        Servlet adaptedJspServlet = new ContextPathServletAdaptor(new JspServlet(context.getBundle(), "/web"), "/struts-examples"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        httpService.registerServlet("/struts-examples/*.jsp", adaptedJspServlet, null, commonContext); //$NON-NLS-1$
       
View Full Code Here

            String msg = "Unable to Register Servlet. Registry Service Not Found.";
            log.error(msg);
            throw new Exception(msg);
        }

        HttpContext defaultHttpContext = httpService.createDefaultHttpContext();

        if (!CarbonUtils.isRemoteRegistry()) {

            Dictionary servletParam = new Hashtable(2);
            servletParam.put("org.apache.abdera.protocol.server.Provider", "org.wso2.carbon.registry.app.RegistryProvider");
View Full Code Here

        } catch (Throwable e) {
            log.error("******* Failed to activate DB Console bundle ******* ", e);
        }
    }
    public void registerServlet(BundleContext bundleContext) throws Exception {
        HttpContext defaultHttpContext = httpService.createDefaultHttpContext();
        Dictionary<String,String> servletParam = new Hashtable<String,String>(2);
        servletParam.put("-webAllowOthers", "");
        httpService.registerServlet("/dbconsole", new WebServlet(), servletParam, defaultHttpContext);
     }
View Full Code Here

            Axis2ServiceRegistry serviceRegistry = new Axis2ServiceRegistry(serverConfigContext);
            serviceRegistry.register(bundleContext.getBundles());
            new OSGiAxis2ServiceDeployer(serverConfigContext, bundleContext).registerBundleListener(); // This will register the OSGi bundle listener

            HttpService httpService = dataHolder.getHttpService();
            HttpContext defaultHttpContext = httpService.createDefaultHttpContext();

            registerCarbonServlet(httpService, defaultHttpContext);

            RealmService realmService = dataHolder.getRealmService();
            UserRealm teannt0Realm = realmService.getBootstrapRealm();
View Full Code Here

        uiResourceRegistry.initialize(bundleContext);
        uiResourceRegistry.setDefaultUIResourceProvider(
                uiBundleDeployer.getBundleBasedUIResourcePrvider());
//        BundleResourcePathRegistry resourcePathRegistry = uiBundleDeployer.getBundleResourcePathRegistry();

        HttpContext commonContext =
                new CarbonSecuredHttpContext(context.getBundle(), "/web", uiResourceRegistry, registry);

        //Registering filedownload servlet
        Servlet fileDownloadServlet = new ContextPathServletAdaptor(new FileDownloadServlet(
                context, getConfigurationContextService()), "/filedownload");
View Full Code Here

        }

        public Object addingService(ServiceReference reference) {
            final HttpService httpService = (HttpService) context.getService(reference);
            try {
                HttpContext commonContext =
                        new BundleEntryHttpContext(context.getBundle(), "/web"); //$NON-NLS-1$
                httpService.registerResources("/jstl-examples", "/",
                                              commonContext); //$NON-NLS-1$ //$NON-NLS-2$

                Servlet adaptedJspServlet = new ContextPathServletAdaptor(
View Full Code Here

        if (httpServiceRef != null && !registerService) {
            LOG.info("Regist the servlet service");
            final HttpService httpService = (HttpService)bundleContext.getService(httpServiceRef);
            if (httpService != null) {
                // create a default context to share between registrations
                final HttpContext httpContext = httpService.createDefaultHttpContext();
                // register the hello world servlet
                final Dictionary<String, String> initParams = new Hashtable<String, String>();
                initParams.put("matchOnUriPrefix", "false");
                initParams.put("servlet-name", "camelServlet");
                httpService.registerServlet("/camel/services", // alias
View Full Code Here

TOP

Related Classes of org.osgi.service.http.HttpContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.