Package org.eclipse.osgi.framework.log

Examples of org.eclipse.osgi.framework.log.FrameworkLogEntry


      try {
        storageManager.open(!LocationManager.getConfigurationLocation().isReadOnly());
        storageManagerClosed = false;
      } catch (IOException e) {
        String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FILEMANAGER_OPEN_ERROR, e.getMessage());
        FrameworkLogEntry logEntry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, message, 0, e, null);
        adaptor.getFrameworkLog().log(logEntry);
      }
    saveBundleDatas();
    saveStateData(shutdown);
    savePermissionStorage();
View Full Code Here


  }

  private void cleanOSGiCache() {
    File osgiConfig = LocationManager.getOSGiConfigurationDir();
    if (!AdaptorUtil.rm(osgiConfig))
      adaptor.getFrameworkLog().log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, "The -clean (osgi.clean) option was not successful. Unable to clean the storage area: " + osgiConfig.getAbsolutePath(), 0, null, null)); //$NON-NLS-1$

  }
View Full Code Here

        if (cause != null && cause instanceof StatusException) {
          StatusException status = (StatusException) cause;
          if ((status.getStatusCode() & StatusException.CODE_ERROR) == 0) {
            if (status.getStatus() instanceof Thread) {
              String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP, new Object[] {Thread.currentThread(), name, status.getStatus(), bundle, new Long(System.currentTimeMillis() - startTime)});
              adaptor.getFrameworkLog().log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.WARNING, 0, message, 0, e, null));
            }
            continue;
          }
        }
        String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CLASSLOADER_ACTIVATION, bundle.getSymbolicName(), Long.toString(bundle.getBundleId()));
        TerminatingClassNotFoundException error = new TerminatingClassNotFoundException(message, e);
        errors.put(managers[i], error);
        if (throwErrorOnFailedStart) {
          adaptor.getFrameworkLog().log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, message, 0, e, null));
          throw error;
        }
        adaptor.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, bundle, new BundleException(message, e));
      }
    }
View Full Code Here

        }
        cycleText.insert(cycleText.length() - 1, ']');
      }
      cycleText.setCharAt(cycleText.length() - 1, ']');
      String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_BUNDLESTOPPER_CYCLES_FOUND, cycleText);
      FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.WARNING, 0, message, 0, null, null);
      adaptor.getFrameworkLog().log(entry);
    }
  }
View Full Code Here

    // get all hook configurators files in your classloader delegation
    Enumeration<URL> hookConfigurators;
    try {
      hookConfigurators = cl != null ? cl.getResources(HookRegistry.HOOK_CONFIGURATORS_FILE) : ClassLoader.getSystemResources(HookRegistry.HOOK_CONFIGURATORS_FILE);
    } catch (IOException e) {
      errors.add(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, "getResources error on " + HookRegistry.HOOK_CONFIGURATORS_FILE, 0, e, null)); //$NON-NLS-1$
      return;
    }
    int curBuiltin = 0;
    while (hookConfigurators.hasMoreElements()) {
      URL url = hookConfigurators.nextElement();
      InputStream input = null;
      try {
        // check each file for a hook.configurators property
        Properties configuratorProps = new Properties();
        input = url.openStream();
        configuratorProps.load(input);
        String hooksValue = configuratorProps.getProperty(HOOK_CONFIGURATORS);
        if (hooksValue == null)
          continue;
        boolean builtin = Boolean.valueOf(configuratorProps.getProperty(BUILTIN_HOOKS)).booleanValue();
        String[] configurators = ManifestElement.getArrayFromList(hooksValue, ","); //$NON-NLS-1$
        for (int i = 0; i < configurators.length; i++)
          if (!configuratorList.contains(configurators[i])) {
            if (builtin) // make sure the built-in configurators are listed first (bug 170881)
              configuratorList.add(curBuiltin++, configurators[i]);
            else
              configuratorList.add(configurators[i]);
          }
      } catch (IOException e) {
        errors.add(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, "error loading: " + url.toExternalForm(), 0, e, null)); //$NON-NLS-1$
        // ignore and continue to next URL
      } finally {
        if (input != null)
          try {
            input.close();
View Full Code Here

        // We expect the follow exeptions may happen; but we need to catch all here
        // ClassNotFoundException
        // IllegalAccessException
        // InstantiationException
        // ClassCastException
        errors.add(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, "error loading hook: " + hookName, 0, t, null)); //$NON-NLS-1$
      }
    }
  }
View Full Code Here

      if (log != null)
        return log;
    }
    log = new FrameworkLog() {
      public void log(FrameworkEvent frameworkEvent) {
        log(new FrameworkLogEntry(frameworkEvent.getBundle().getSymbolicName() == null ? frameworkEvent.getBundle().getLocation() : frameworkEvent.getBundle().getSymbolicName(), FrameworkLogEntry.ERROR, 0, "FrameworkEvent.ERROR", 0, frameworkEvent.getThrowable(), null)); //$NON-NLS-1$
      }

      public void log(FrameworkLogEntry logEntry) {
        System.err.print(logEntry.getEntry() + " "); //$NON-NLS-1$
        System.err.println(logEntry.getMessage());
View Full Code Here

    if (context instanceof FrameworkLogEntry) {
      log((FrameworkLogEntry) context);
      return;
    }
    // OK we are now in a case where someone logged a normal entry to the real LogService
    log(new FrameworkLogEntry(getFwkEntryTag(entry), convertSeverity(entry.getLevel()), 0, entry.getMessage(), 0, entry.getException(), null));
  }
View Full Code Here

  private String copyToTempLibrary(String result) {
    try {
      return adaptor.getStorage().copyToTempLibrary(this, result);
    } catch (IOException e) {
      adaptor.getFrameworkLog().log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, e.getMessage(), 0, e, null));
    }
    return null;
  }
View Full Code Here

    ZipFile file = null;
    try {
      file = new ZipFile(jarFile);
    } catch (IOException e) {
      String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_PLUGIN_LIBRARY_IGNORED, jarFile, pluginInfo.getUniqueId());
      adaptor.getFrameworkLog().log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, message, 0, e, null));
      return names;
    }
    //Run through the entries
    for (Enumeration<? extends ZipEntry> entriesEnum = file.entries(); entriesEnum.hasMoreElements();) {
      ZipEntry entry = entriesEnum.nextElement();
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.framework.log.FrameworkLogEntry

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.