Package org.eclipse.osgi.service.resolver

Examples of org.eclipse.osgi.service.resolver.PlatformAdmin


      result.toFile().mkdirs();
    return result;
  }

  public long getStateTimeStamp() {
    PlatformAdmin admin = getPlatformAdmin();
    return admin == null ? -1 : admin.getState(false).getTimeStamp();
  }
View Full Code Here


        if (!hasPlatformAdmin()) {
            System.err.println("This command is only supported on Equinox.");
            return null;
        }
        ServiceReference ref = bundleContext.getServiceReference(PlatformAdmin.class.getName());
        PlatformAdmin platformAdmin = (PlatformAdmin) getService(PlatformAdmin.class, ref);

        try {
            State systemState = platformAdmin.getState(false);
            Iterator<Long> iterator = ids.iterator();
            while (iterator.hasNext()) {
                Long id = iterator.next();
                BundleDescription bundle = systemState.getBundle(id);
                if (bundle == null) {
View Full Code Here

        List<String> errors = new ArrayList<String>();
       
        ServiceReference ref = bundleContext.getServiceReference(PlatformAdmin.class.getName());
        try {
            PlatformAdmin platformAdmin = (PlatformAdmin) bundleContext.getService(ref);
            State systemState = platformAdmin.getState(false);
            List<BundleDescription> bundleDescriptions = new ArrayList<BundleDescription>(bundles.size());
            for (Bundle bundle : bundles) {
                BundleDescription bundleDescription = systemState.getBundle(bundle.getBundleId());
                if (bundleDescription != null) {
                    bundleDescriptions.add(bundleDescription);
View Full Code Here

        List<ErrorDetail> errors = new ArrayList<ErrorDetail>();
       
        ServiceReference ref = bundleContext.getServiceReference(PlatformAdmin.class.getName());
        try {
            PlatformAdmin platformAdmin = (PlatformAdmin) bundleContext.getService(ref);
            State systemState = platformAdmin.getState(false);
            List<BundleDescription> bundleDescriptions = new ArrayList<BundleDescription>(bundles.size());
            for (Bundle bundle : bundles) {
                BundleDescription bundleDescription = systemState.getBundle(bundle.getBundleId());
                if (bundleDescription != null) {
                    bundleDescriptions.add(bundleDescription);
View Full Code Here

    public MBeanServer getMBeanServer() {
        return ManagementFactory.getPlatformMBeanServer();
    }

    public PlatformAdmin getPlatformAdmin() {
        final PlatformAdmin platAdmin = (PlatformAdmin) bundleContext.getService(platformAdminRef);
        if (platAdmin == null) {
            throw new AssertionError("PlatformAdmin service not available");
        }

        return platAdmin;
View Full Code Here

   */
  public static long getContainerTimestamp(BundleContext context, ServiceReference ref) {
    if (ref == null)
      return -1;
    try {
      PlatformAdmin admin = (PlatformAdmin) context.getService(ref);
      return admin == null ? -1 : admin.getState(false).getTimeStamp();
    } finally {
      context.ungetService(ref);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.service.resolver.PlatformAdmin

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.