congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
BundleRevision.getTypes
Code IndexAdd Tabnine to your IDE (free)

How to use
getTypes
method
in
org.osgi.framework.wiring.BundleRevision

Best Java code snippets using org.osgi.framework.wiring.BundleRevision.getTypes (Showing top 20 results out of 315)

origin: apache/felix

/**
 * Checks if the provided module definition declares a fragment host.
 *
 * @param revision the module to check
 * @return <code>true</code> if the module declares a fragment host, <code>false</code>
 *      otherwise.
 */
public static boolean isFragment(BundleRevision revision)
{
  return ((revision.getTypes() & BundleRevision.TYPE_FRAGMENT) > 0);
}
origin: apache/felix

@Override
public int getBundleType(Bundle bundle)
{
  return bundle.adapt(BundleRevision.class).getTypes();
}
origin: com.yahoo.vespa/container-core

private boolean isFragment(Bundle bundle) {
  BundleRevision bundleRevision = bundle.adapt(BundleRevision.class);
  if (bundleRevision == null)
    throw new NullPointerException("Null bundle revision means that bundle has probably been uninstalled: " +
                        bundle.getSymbolicName() + ":" + bundle.getVersion());
  return (bundleRevision.getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
origin: org.apache.felix/org.apache.felix.connect

@Override
public int getBundleType(Bundle bundle)
{
  return bundle.adapt(BundleRevision.class).getTypes();
}
origin: org.kill-bill.billing/killbill-osgi

  /**
   * Check if a bundle is a fragment.
   *
   * @param bundle bundle to check
   * @return true iff the bundle is a fragment
   */
  private boolean isFragment(final Bundle bundle) {
    // Necessary cast on jdk7
    final BundleRevision bundleRevision = (BundleRevision) bundle.adapt(BundleRevision.class);
    return bundleRevision != null && (bundleRevision.getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
  }
}
origin: org.apache.felix/org.apache.felix.fileinstall

/**
 * Check if a bundle is a fragment.
 */
boolean isFragment(Bundle bundle)
{
  BundleRevision rev = bundle.adapt(BundleRevision.class);
  return (rev.getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.ui.workbench

static public String constructPlatformURI(Bundle bundle) {
  BundleRevision bundleRevision = bundle.adapt(BundleRevision.class);
  if (bundleRevision == null)
    return null;
  StringBuffer tmp = new StringBuffer();
  tmp.append(PLATFORM_SCHEMA);
  if ((bundleRevision.getTypes() & BundleRevision.TYPE_FRAGMENT) == BundleRevision.TYPE_FRAGMENT)
    tmp.append(FRAGMENT_SEGMENT);
  else
    tmp.append(PLUGIN_SEGMENT);
  tmp.append(bundle.getSymbolicName());
  return tmp.toString();
}
origin: org.eclipse.platform/org.eclipse.equinox.metatype

public static boolean isFragment(Bundle bundle) {
  return (bundle.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
origin: protegeproject/protege

private static boolean isFragmentBundle(Bundle b) {
  return (b.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
origin: edu.stanford.protege/protege-launcher

private static boolean isFragmentBundle(Bundle b) {
  return (b.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
origin: com.github.veithen.cosmos/cosmos-equinox

public int getBundleType(Bundle bundle) {
  Module module = StartLevelImpl.getModule(bundle);
  if (module == null) {
    return 0;
  }
  List<BundleRevision> revisions = module.getRevisions().getRevisions();
  if (revisions.isEmpty()) {
    return 0;
  }
  return (revisions.get(0).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0 ? PackageAdmin.BUNDLE_TYPE_FRAGMENT : 0;
}
origin: org.eclipse.tycho/org.eclipse.osgi

public int getBundleType(Bundle bundle) {
  Module module = StartLevelImpl.getModule(bundle);
  if (module == null) {
    return 0;
  }
  List<BundleRevision> revisions = module.getRevisions().getRevisions();
  if (revisions.isEmpty()) {
    return 0;
  }
  return (revisions.get(0).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0 ? PackageAdmin.BUNDLE_TYPE_FRAGMENT : 0;
}
origin: org.eclipse.platform/org.eclipse.osgi

public int getBundleType(Bundle bundle) {
  Module module = StartLevelImpl.getModule(bundle);
  if (module == null) {
    return 0;
  }
  List<BundleRevision> revisions = module.getRevisions().getRevisions();
  if (revisions.isEmpty()) {
    return 0;
  }
  return (revisions.get(0).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0 ? PackageAdmin.BUNDLE_TYPE_FRAGMENT : 0;
}
origin: org.eclipse/osgi

public int getBundleType(Bundle bundle) {
  Module module = StartLevelImpl.getModule(bundle);
  if (module == null) {
    return 0;
  }
  List<BundleRevision> revisions = module.getRevisions().getRevisions();
  if (revisions.isEmpty()) {
    return 0;
  }
  return (revisions.get(0).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0 ? PackageAdmin.BUNDLE_TYPE_FRAGMENT : 0;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi

public int getBundleType(Bundle bundle) {
  Module module = StartLevelImpl.getModule(bundle);
  if (module == null) {
    return 0;
  }
  List<BundleRevision> revisions = module.getRevisions().getRevisions();
  if (revisions.isEmpty()) {
    return 0;
  }
  return (revisions.get(0).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0 ? PackageAdmin.BUNDLE_TYPE_FRAGMENT : 0;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

public int getBundleType(Bundle bundle) {
  Module module = StartLevelImpl.getModule(bundle);
  if (module == null) {
    return 0;
  }
  List<BundleRevision> revisions = module.getRevisions().getRevisions();
  if (revisions.isEmpty()) {
    return 0;
  }
  return (revisions.get(0).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0 ? PackageAdmin.BUNDLE_TYPE_FRAGMENT : 0;
}
origin: org.eclipse.platform/org.eclipse.ui.ide.application

  private boolean checkClassResource(String classPackageName, String classFileName, BundleWiring wiring) {
    if (wiring == null) {
      return false;
    }
    if ((wiring.getRevision().getTypes() & BundleRevision.TYPE_FRAGMENT) != 0) {
      // fragment case; need to get the host wiring
      wiring = wiring.getRequiredWires(HostNamespace.HOST_NAMESPACE).get(0).getProviderWiring();
    }
    Collection<String> classResourcePaths = wiring.listResources(classPackageName, classFileName, 0);
    return classResourcePaths != null && !classResourcePaths.isEmpty();
  }
}
origin: hibernate/hibernate-search

private boolean isFragmentBundle(Bundle bundle) {
  return ( bundle.adapt( BundleRevision.class ).getTypes() & BundleRevision.TYPE_FRAGMENT ) != 0;
}
origin: org.eclipse.platform/org.eclipse.osgi

private BundleRevisionDTO getBundleRevisionDTO(BundleRevision revision) {
  if (revision == null) {
    return null;
  }
  BundleRevisionDTO dto = resources.get(revision);
  if (dto != null) {
    return dto;
  }
  dto = new BundleRevisionDTO();
  dto.id = identifier(revision);
  resources.put(revision, dto);
  dto.bundle = revision.getBundle().getBundleId();
  dto.symbolicName = revision.getSymbolicName();
  dto.type = revision.getTypes();
  dto.version = revision.getVersion().toString();
  dto.capabilities = getListCapabilityDTO(revision.getDeclaredCapabilities(null));
  dto.requirements = getListRequirementDTO(revision.getDeclaredRequirements(null));
  return dto;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

private BundleRevisionDTO getBundleRevisionDTO(BundleRevision revision) {
  if (revision == null) {
    return null;
  }
  BundleRevisionDTO dto = resources.get(revision);
  if (dto != null) {
    return dto;
  }
  dto = new BundleRevisionDTO();
  dto.id = identifier(revision);
  resources.put(revision, dto);
  dto.bundle = revision.getBundle().getBundleId();
  dto.symbolicName = revision.getSymbolicName();
  dto.type = revision.getTypes();
  dto.version = revision.getVersion().toString();
  dto.capabilities = getListCapabilityDTO(revision.getDeclaredCapabilities(null));
  dto.requirements = getListRequirementDTO(revision.getDeclaredRequirements(null));
  return dto;
}
org.osgi.framework.wiringBundleRevisiongetTypes

Javadoc

Returns the special types of this bundle revision. The bundle revision type values are:
  • #TYPE_FRAGMENT
A bundle revision may be more than one type at a time. A type code is used to identify the bundle revision type for future extendability.

If this bundle revision is not one or more of the defined types then 0 is returned.

Popular methods of BundleRevision

  • getBundle
  • getWiring
    Returns the bundle wiring which is using this bundle revision.
  • getDeclaredCapabilities
    Returns the capabilities declared by this bundle revision.
  • getDeclaredRequirements
    Returns the requirements declared by this bundle revision.
  • getSymbolicName
    Returns the symbolic name for this bundle revision.
  • getVersion
    Returns the version for this bundle revision.
  • equals
  • getCapabilities
    This method returns the same value as #getDeclaredCapabilities(String).
  • getRequirements
    This method returns the same value as #getDeclaredRequirements(String).

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
  • getContentResolver (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Option (scala)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now