Examples of FrameworkLogEntry


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

            startBundles.add(osgiBundle);
          // include basic bundles in case they were not resolved before
          if ((osgiBundle.getState() & Bundle.INSTALLED) != 0)
            toRefresh.add(osgiBundle);
        } catch (BundleException e) {
          FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_INSTALL, initialBundles[i].location), 0, e, null);
          log.log(entry);
        } catch (IOException e) {
          FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_INSTALL, initialBundles[i].location), 0, e, null);
          log.log(entry);
        }
      }
    } finally {
      if (reference != null)
View Full Code Here

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

    try {
      bundle.start(options);
    } catch (BundleException e) {
      if ((bundle.getState() & Bundle.RESOLVED) != 0) {
        // only log errors if the bundle is resolved
        FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null);
        log.log(entry);
      }
    }
  }
View Full Code Here

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

    if (SignedBundleHook.ADAPTOR == null) {
      System.err.println(msg);
      t.printStackTrace();
      return;
    }
    FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, severity, 0, msg, 0, t, null);
    SignedBundleHook.ADAPTOR.getFrameworkLog().log(entry);
  }
View Full Code Here

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

    // get all hook configurators files in your classloader delegation
    Enumeration 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 = (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

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

        // 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

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

        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 Integer(5000)});
              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

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

        }
        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

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

      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

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

   */
  static void log(int severity, String message, Exception e) {
    if (severity == SEVERITY_WARNING && ignoreWarnings)
      return; // ignoring warnings; bug 292980
    if (frameworkLog != null) {
      frameworkLog.log(new FrameworkLogEntry("org.eclipse.osgi", severity, 1, message, 0, e, null)); //$NON-NLS-1$
      return;
    }
    String statusMsg;
    switch (severity) {
      case SEVERITY_ERROR :
View Full Code Here

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

  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
TOP
Copyright © 2018 www.massapi.com. 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.