コード例 #1
0
 private void removeApplication(ServiceReference reference) {
   PaxWicketApplicationFactory factory;
   synchronized (factories) {
     if (!factories.containsKey(reference)) {
       LOGGER.warn(
           "Trying to unregister ApplicationFactory without application name or mount point is not possible");
       return;
     }
     factory = factories.remove(reference);
   }
   LOGGER.debug("Service Removed [{}], Factory hash [{}]", reference, identityHashCode(factory));
   httpTracker.removeServlet(factory.getMountPoint());
 }
コード例 #2
0
 private void addServlet(
     String mountPoint,
     Servlet servlet,
     Map<?, ?> contextParam,
     ServiceReference appFactoryReference) {
   Bundle bundle = appFactoryReference.getBundle();
   try {
     httpTracker.addServlet(mountPoint, servlet, contextParam, bundle);
   } catch (NamespaceException e) {
     throw new IllegalArgumentException(
         "Unable to mount [" + appFactoryReference + "] on mount point '" + mountPoint + "'.");
   } catch (ServletException e) {
     String message =
         "Wicket Servlet for ["
             + appFactoryReference
             + "] is unable to initialize. "
             + "This servlet was tried to be mounted on '"
             + mountPoint
             + "'.";
     throw new IllegalArgumentException(message, e);
   }
 }