Exemplo n.º 1
0
    @Override
    public void removedService(
        ServiceReference<WebDAVStorage> serviceReference, WebDAVStorage webDAVStorage) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      _storageMap.remove(webDAVStorage.getToken());
    }
    @Override
    public void removedService(
        ServiceReference<XStreamAlias> serviceReference, XStreamAlias xStreamAlias) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      _xstreamAliases.remove(xStreamAlias.getClazz());
    }
    @Override
    public void removedService(
        ServiceReference<AtomCollectionAdapter<?>> serviceReference,
        AtomCollectionAdapter<?> atomCollectionAdapter) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      _atomCollectionAdapters.remove(atomCollectionAdapter.getCollectionName());
    }
    @Override
    public void removedService(
        ServiceReference<ResourceBundle> serviceReference, ResourceBundle resourceBundle) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      String languageId = (String) serviceReference.getProperty("language.id");

      _resourceBundles.remove(languageId);
    }
    @Override
    public void removedService(ServiceReference<Object> serviceReference, Object object) {

      List<String> authTokenIgnoreActions =
          StringPlus.asList(serviceReference.getProperty(PropsKeys.AUTH_TOKEN_IGNORE_ACTIONS));

      _portletCSRFWhitelistActions.removeAll(authTokenIgnoreActions);

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);
    }
    @Override
    public void removedService(ServiceReference<Indexer<?>> serviceReference, Indexer<?> indexer) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      Class<?> clazz = indexer.getClass();

      _indexers.remove(clazz.getName());

      _indexers.remove(indexer.getClassName());
    }
            @Override
            public void map(
                ServiceReference<DLProcessor> serviceReference, Emitter<String> emitter) {

              Registry registry = RegistryUtil.getRegistry();

              DLProcessor dlProcessor = registry.getService(serviceReference);

              try {
                emitter.emit(dlProcessor.getType());
              } finally {
                registry.ungetService(serviceReference);
              }
            }
    @Override
    public void removedService(
        ServiceReference<CustomJspBag> serviceReference, CustomJspBag customJspBag) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      String contextId = GetterUtil.getString(serviceReference.getProperty("context.id"));

      for (String customJsp : customJspBag.getCustomJsps()) {
        String customJspDir = customJspBag.getCustomJspDir();

        int pos = customJsp.indexOf(customJspDir);

        String portalJsp = customJsp.substring(pos + customJspDir.length());

        if (customJspBag.isCustomJspGlobal()) {
          File portalJspFile = new File(PortalUtil.getPortalWebDir() + portalJsp);
          File portalJspBackupFile = getPortalJspBackupFile(portalJspFile);

          if (portalJspBackupFile.exists()) {
            try {
              FileUtil.copyFile(portalJspBackupFile, portalJspFile);
            } catch (IOException e) {
              return;
            }

            portalJspBackupFile.delete();
          } else if (portalJspFile.exists()) {
            portalJspFile.delete();
          }
        } else {
          portalJsp = CustomJspRegistryUtil.getCustomJspFileName(contextId, portalJsp);

          File portalJspFile = new File(PortalUtil.getPortalWebDir() + portalJsp);

          if (portalJspFile.exists()) {
            portalJspFile.delete();
          }
        }
      }

      if (!customJspBag.isCustomJspGlobal()) {
        CustomJspRegistryUtil.unregisterServletContextName(contextId);
      }

      _customJspBagsMap.remove(serviceReference);
    }
    @Override
    public synchronized void removedService(
        ServiceReference<InvokerPortletFactory> serviceReference,
        InvokerPortletFactory invokerPortletFactory) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      serviceReference = registry.getServiceReference(InvokerPortletFactory.class);

      if (serviceReference != null) {
        _invokerPortletFactory = registry.getService(serviceReference);

        _serviceRanking = GetterUtil.getLong(serviceReference.getProperty("service.ranking"));
      }
    }
    @Override
    public void removedService(
        ServiceReference<SchedulerEntry> serviceReference, SchedulerEntry schedulerEntry) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      StorageType storageType = StorageType.MEMORY_CLUSTERED;

      if (schedulerEntry instanceof StorageTypeAware) {
        StorageTypeAware storageTypeAware = (StorageTypeAware) schedulerEntry;

        storageType = storageTypeAware.getStorageType();
      }

      try {
        SchedulerEngineHelperUtil.unschedule(schedulerEntry, storageType);
      } catch (SchedulerException e) {
        _log.error(e, e);
      }
    }
Exemplo n.º 11
0
    @Override
    public void removedService(
        ServiceReference<ResourceBundle> serviceReference, ResourceBundle resourceBundle) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      String languageId =
          GetterUtil.getString(serviceReference.getProperty("language.id"), StringPool.BLANK);
      Locale locale = null;

      if (Validator.isNotNull(languageId)) {
        locale = LocaleUtil.fromLanguageId(languageId, true);
      } else {
        locale = new Locale(StringPool.BLANK);
      }

      Map<String, String> languageMap = _oldLanguageMaps.get(serviceReference);

      _putLanguageMap(locale, languageMap);
    }
    @Override
    public void removedService(
        ServiceReference<IndexerPostProcessor> serviceReference,
        IndexerPostProcessor indexerPostProcessor) {

      Registry registry = RegistryUtil.getRegistry();

      registry.ungetService(serviceReference);

      List<String> indexerClassNames =
          StringPlus.asList(serviceReference.getProperty("indexer.class.name"));

      for (String indexerClassName : indexerClassNames) {
        Indexer indexer = IndexerRegistryUtil.getIndexer(indexerClassName);

        if (indexer == null) {
          _log.error("No indexer for " + indexerClassName + " was found");

          continue;
        }

        indexer.unregisterIndexerPostProcessor(indexerPostProcessor);
      }
    }