Package org.osgi.service.http

Examples of org.osgi.service.http.NamespaceException


    }

    Filter registeredFilter = _filtersByFilterNames.get(filterName);

    if ((registeredFilter != null) && (registeredFilter != filter)) {
      throw new NamespaceException(
        "A filter is already registered with the name " + filterName);
    }

    for (String urlPattern : urlPatterns) {
      validateURLPattern(urlPattern);
View Full Code Here


    }

    Servlet registeredServlet = _servletsByServletNames.get(servletName);

    if ((registeredServlet != null) && (registeredServlet != servlet)) {
      throw new NamespaceException(
        "A servlet is already registered with the name " + servletName);
    }

    for (String urlPattern : urlPatterns) {
      validateURLPattern(urlPattern);

      if (_servletsByURLPatterns.containsKey(urlPattern)) {
        throw new NamespaceException(
          "A servlet is already registered with the URL pattern " +
            urlPattern);
      }
    }
  }
View Full Code Here

        private GlobalRegistry() {
        }

        synchronized Registration register(String alias, Bundle bundle, StandardContext context, Servlet servlet, Registration.Type type) throws NamespaceException {
            if (exists(alias))
                throw new NamespaceException(OSGiMessages.MESSAGES.aliasMappingAlreadyExists(alias));

            LOGGER.infoRegisterHttpServiceAlias(alias);

            Registration result = new Registration(alias, bundle, context, servlet, type);
            registrations.put(alias, result);
View Full Code Here

        WEB_LOGGER.registerWebapp(ctx.getName());
        try {
            ctx.create();
        } catch (Exception ex) {
            throw new NamespaceException(WebMessages.MESSAGES.createContextFailed(), ex);
        }
        try {
            ctx.start();
        } catch (LifecycleException ex) {
            throw new NamespaceException(WebMessages.MESSAGES.startContextFailed(), ex);
        }

        String wrapperName = alias.substring(1);
        Wrapper wrapper = ctx.createWrapper();
        wrapper.setName(wrapperName);
View Full Code Here

            throw new IllegalArgumentException(OSGiMessages.MESSAGES.invalidServletAlias(alias));

        if (exists && !registry.exists(alias))
            throw new IllegalArgumentException(OSGiMessages.MESSAGES.aliasMappingDoesNotExist(alias));
        if (!exists && registry.exists(alias))
            throw new NamespaceException(OSGiMessages.MESSAGES.aliasMappingAlreadyExists(alias));
    }
View Full Code Here

    private void validateName(String name) throws NamespaceException {
        // The name parameter must also not end with slash ('/') with the exception
        // that a name of the form "/" is used to denote the root of the bundle.
        if (name == null || (name.length() > 1 && name.endsWith("/")))
            throw new NamespaceException(OSGiMessages.MESSAGES.invalidResourceName(name));
    }
View Full Code Here

TOP

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

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.