|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.osgi.framework.internal.core.BundleNativeCode
public class BundleNativeCode
This class represents a description of native code. Native Code dependencies The Bundle-NativeCode header allows a bundle to carry the native code it needs, and make use of it when it is installed. The bundle must have RuntimePermission in order to run native code in the Framework. The value of the header must conform to the following syntax: Bundle-NativeCode: nativecode-clause ( , nativecode-clause)* nativecode-clause: nativepaths ( ; env-parameter )* nativepaths: nativepath ( ; nativepath )* env-parameter: ( processordef | osnamedef | osversiondef | languagedef ) processordef: processor= token osnamedef: osname= token osversiondef: osversion= token languagedef: language= token For example: Bundle-NativeCode: http.dll ; osname=Win95; processor=x86; language=en, libhttp.so; osname=Solaris; processor=sparc The Bundle-NativeCode header allows a bundle programmer to specify an environment, and to declare what native code libraries it carries for that specific environment. The environment is characterized by the following properties:
processor
The processor on which the hosting the
Framework is running. It is compared against
org.osgi.framework.processor
.
osname
The operating system name. It is compared against
org.osgi.framework.os.name
.
selection-filter
An optional filter that can be used to
match against system properties. If the filter does not match then the
native code clause will not be selected.
osversion
The version of the operating system. It is
compared against org.osgi.framework.os.version
.
language
The language. It is compared against
org.osgi.framework.language
.
Constructor Summary | |
---|---|
protected |
BundleNativeCode(org.eclipse.osgi.util.ManifestElement element,
AbstractBundle bundle)
Constructor for BundleNativeCode. |
Method Summary | |
---|---|
protected void |
addAttribute(java.lang.String key,
java.lang.String value)
addAttribute is used to add the specification-version string to the package description. |
protected void |
addPath(java.lang.String nativepath)
addPath is used to add a new element to the list of native files. |
java.lang.String[] |
getPaths()
Returns the native code paths. |
boolean |
matchFilter()
|
int |
matchLanguage(java.lang.String language)
Return the match value for the given language. |
Version |
matchOSVersion(Version version)
Return the higest matching value for the given os version that is less than or equal to the given os version. |
int |
matchProcessorOSNameFilter(java.lang.String processor,
java.lang.String osname)
Return the match value for the given processor and os name. |
java.lang.String |
toString()
Override toString. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected BundleNativeCode(org.eclipse.osgi.util.ManifestElement element, AbstractBundle bundle)
Method Detail |
---|
public java.lang.String[] getPaths()
protected void addPath(java.lang.String nativepath)
nativepath
- new native fileprotected void addAttribute(java.lang.String key, java.lang.String value)
key
- attribute key namevalue
- attribute value namepublic java.lang.String toString()
toString
in class java.lang.Object
public int matchProcessorOSNameFilter(java.lang.String processor, java.lang.String osname)
processor
- processor name to match against.osname
- os name to match against.
public Version matchOSVersion(Version version)
version
- os version to match against.
public int matchLanguage(java.lang.String language)
language
- language name to match against.
public boolean matchFilter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |