コード例 #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 addApplication(
     ServiceReference reference, PaxWicketApplicationFactory internalFactory) {
   if (!internalFactory.isValidFactory()) {
     LOGGER.warn(
         "Trying to register ApplicationFactory without application name or mount point is not possible");
     return;
   }
   LOGGER.debug(
       "Service Added [{}], Factory hash [{}]", reference, identityHashCode(internalFactory));
   Servlet servlet = ServletProxy.newServletProxy(internalFactory);
   addServlet(
       internalFactory.getMountPoint(), servlet, internalFactory.getContextParams(), reference);
   synchronized (factories) {
     factories.put(reference, internalFactory);
   }
 }
コード例 #3
0
 @Override
 public final void modifiedService(ServiceReference reference, Object service) {
   removeApplication(reference);
   PaxWicketApplicationFactory internalFactory =
       PaxWicketApplicationFactory.createPaxWicketApplicationFactory(
           context, (IWebApplicationFactory) service, reference);
   addApplication(reference, internalFactory);
 }
コード例 #4
0
 @Override
 public final Object addingService(ServiceReference reference) {
   final IWebApplicationFactory factory = (IWebApplicationFactory) super.addingService(reference);
   PaxWicketApplicationFactory internalFactory =
       PaxWicketApplicationFactory.createPaxWicketApplicationFactory(context, factory, reference);
   addApplication(reference, internalFactory);
   return factory;
 }