• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Analyzer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中aQute.bnd.osgi.Analyzer的典型用法代码示例。如果您正苦于以下问题:Java Analyzer类的具体用法?Java Analyzer怎么用?Java Analyzer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Analyzer类属于aQute.bnd.osgi包,在下文中一共展示了Analyzer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getEffectiveManifest

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
@Override
public DefaultManifest getEffectiveManifest() {
    ContainedVersionAnalyzer analyzer = analyzerFactory.create();
    DefaultManifest effectiveManifest = new DefaultManifest(null);
    try {
        setAnalyzerProperties(analyzer);
        Manifest osgiManifest = analyzer.calcManifest();
        java.util.jar.Attributes attributes = osgiManifest.getMainAttributes();
        for (Map.Entry<Object, Object> entry : attributes.entrySet()) {
            effectiveManifest.attributes(WrapUtil.toMap(entry.getKey().toString(), (String) entry.getValue()));
        }
        effectiveManifest.attributes(this.getAttributes());
        for (Map.Entry<String, Attributes> ent : getSections().entrySet()) {
            effectiveManifest.attributes(ent.getValue(), ent.getKey());
        }
        if (classesDir != null) {
            long mod = classesDir.lastModified();
            if (mod > 0) {
                effectiveManifest.getAttributes().put(Analyzer.BND_LASTMODIFIED, mod);
            }
        }
    } catch (Exception e) {
        throw UncheckedException.throwAsUncheckedException(e);
    }
    return getEffectiveManifestInternal(effectiveManifest);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:27,代码来源:DefaultOsgiManifest.java


示例2: instructionValue

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
public List<String> instructionValue(String instructionName) {
    if (instructionName.equals(Analyzer.BUNDLE_SYMBOLICNAME)) {
        return createListFromPropertyString(getSymbolicName());
    } else if (instructionName.equals(Analyzer.BUNDLE_NAME)) {
        return createListFromPropertyString(getName());
    } else if (instructionName.equals(Analyzer.BUNDLE_VERSION)) {
        return createListFromPropertyString(getVersion());
    } else if (instructionName.equals(Analyzer.BUNDLE_DESCRIPTION)) {
        return createListFromPropertyString(getDescription());
    } else if (instructionName.equals(Analyzer.BUNDLE_LICENSE)) {
        return createListFromPropertyString(getLicense());
    } else if (instructionName.equals(Analyzer.BUNDLE_VENDOR)) {
        return createListFromPropertyString(getVendor());
    } else if (instructionName.equals(Analyzer.BUNDLE_DOCURL)) {
        return createListFromPropertyString(getDocURL());
    } else {
        return unmodelledInstructions.get(instructionName);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:20,代码来源:DefaultOsgiManifest.java


示例3: maybeAppendModelledInstruction

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private boolean maybeAppendModelledInstruction(String name, String... values) {
    if (name.equals(Analyzer.BUNDLE_SYMBOLICNAME)) {
        setSymbolicName(appendValues(getSymbolicName(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_NAME)) {
        setName(appendValues(getName(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_VERSION)) {
        setVersion(appendValues(getVersion(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_DESCRIPTION)) {
        setDescription(appendValues(getDescription(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_LICENSE)) {
        setLicense(appendValues(getLicense(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_VENDOR)) {
        setVendor(appendValues(getVendor(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_DOCURL)) {
        setDocURL(appendValues(getDocURL(), values));
        return true;
    } else {
        return false;
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:27,代码来源:DefaultOsgiManifest.java


示例4: maybePrependModelledInstruction

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private boolean maybePrependModelledInstruction(String name, String... values) {
    if (name.equals(Analyzer.BUNDLE_SYMBOLICNAME)) {
        setSymbolicName(prependValues(getSymbolicName(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_NAME)) {
        setName(prependValues(getName(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_VERSION)) {
        setVersion(prependValues(getVersion(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_DESCRIPTION)) {
        setDescription(prependValues(getDescription(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_LICENSE)) {
        setLicense(prependValues(getLicense(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_VENDOR)) {
        setVendor(prependValues(getVendor(), values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_DOCURL)) {
        setDocURL(prependValues(getDocURL(), values));
        return true;
    } else {
        return false;
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:27,代码来源:DefaultOsgiManifest.java


示例5: maybeSetModelledInstruction

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private boolean maybeSetModelledInstruction(String name, String... values) {
    if (name.equals(Analyzer.BUNDLE_SYMBOLICNAME)) {
        setSymbolicName(createPropertyStringFromArray(values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_NAME)) {
        setName(createPropertyStringFromArray(values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_VERSION)) {
        setVersion(createPropertyStringFromArray(values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_DESCRIPTION)) {
        setDescription(createPropertyStringFromArray(values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_LICENSE)) {
        setLicense(createPropertyStringFromArray(values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_VENDOR)) {
        setVendor(createPropertyStringFromArray(values));
        return true;
    } else if (name.equals(Analyzer.BUNDLE_DOCURL)) {
        setDocURL(createPropertyStringFromArray(values));
        return true;
    } else {
        return false;
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:27,代码来源:DefaultOsgiManifest.java


示例6: getModelledInstructions

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private Map<String, List<String>> getModelledInstructions() {
    Map<String, List<String>> modelledInstructions = new HashMap<String, List<String>>();
    modelledInstructions.put(Analyzer.BUNDLE_SYMBOLICNAME, createListFromPropertyString(symbolicName));
    modelledInstructions.put(Analyzer.BUNDLE_NAME, createListFromPropertyString(name));
    modelledInstructions.put(Analyzer.BUNDLE_VERSION, createListFromPropertyString(version));
    modelledInstructions.put(Analyzer.BUNDLE_DESCRIPTION, createListFromPropertyString(description));
    modelledInstructions.put(Analyzer.BUNDLE_LICENSE, createListFromPropertyString(description));
    modelledInstructions.put(Analyzer.BUNDLE_VENDOR, createListFromPropertyString(vendor));
    modelledInstructions.put(Analyzer.BUNDLE_DOCURL, createListFromPropertyString(docURL));

    return CollectionUtils.filter(modelledInstructions, new Spec<Map.Entry<String, List<String>>>() {
        public boolean isSatisfiedBy(Map.Entry<String, List<String>> element) {
            return element.getValue() != null;
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:DefaultOsgiManifest.java


示例7: doWabStaging

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private void doWabStaging(Analyzer analyzer) throws Exception {
    if (!isWab()) {
        return;
    }
    String wab = analyzer.getProperty(analyzer.WAB);
    Jar dot = analyzer.getJar();

    log("wab %s", wab);
    analyzer.setBundleClasspath("WEB-INF/classes," +
                                analyzer.getProperty(analyzer.BUNDLE_CLASSPATH));

    Set<String> paths = new HashSet<String>(dot.getResources().keySet());

    for (String path : paths) {
        if (path.indexOf('/') > 0 && !Character.isUpperCase(path.charAt(0))) {
            log("wab: moving: %s", path);
            dot.rename(path, "WEB-INF/classes/" + path);
        }
    }

    Path wabRoot = Paths.get(wab);
    includeFiles(dot, null, wabRoot.toString());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:OSGiWrapper.java


示例8: doIncludeResources

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
/**
 * Parse the Bundle-Includes header. Files in the bundles Include header are
 * included in the jar. The source can be a directory or a file.
 *
 * @throws Exception
 */
private void doIncludeResources(Analyzer analyzer) throws Exception {
    String includes = analyzer.getProperty(Analyzer.INCLUDE_RESOURCE);
    if (includes == null) {
        return;
    }
    Parameters clauses = analyzer.parseHeader(includes);
    Jar jar = analyzer.getJar();

    for (Map.Entry<String, Attrs> entry : clauses.entrySet()) {
        String name = entry.getKey();
        Map<String, String> extra = entry.getValue();
        // TODO consider doing something with extras

        String[] parts = name.split("\\s*=\\s*");
        String source = parts[0];
        String destination = parts[0];
        if (parts.length == 2) {
            source = parts[1];
        }

        includeFiles(jar, destination, source);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:30,代码来源:OSGiWrapper.java


示例9: doWabStaging

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private void doWabStaging(Analyzer analyzer) throws Exception {
    if (!isWab()) {
        return;
    }
    String wab = analyzer.getProperty(analyzer.WAB);
    Jar dot = analyzer.getJar();

    log("wab %s", wab);
    analyzer.setBundleClasspath("WEB-INF/classes," +
                                analyzer.getProperty(analyzer.BUNDLE_CLASSPATH));

    Set<String> paths = new HashSet<>(dot.getResources().keySet());

    for (String path : paths) {
        if (path.indexOf('/') > 0 && !Character.isUpperCase(path.charAt(0))) {
            log("wab: moving: %s", path);
            dot.rename(path, "WEB-INF/classes/" + path);
        }
    }

    Path wabRoot = Paths.get(wab);
    includeFiles(dot, null, wabRoot.toString());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:24,代码来源:OSGiWrapper.java


示例10: doWabStaging

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private void doWabStaging(Analyzer analyzer) throws Exception {
    if (!isWab()) {
        return;
    }
    String wab = analyzer.getProperty(analyzer.WAB);
    Jar dot = analyzer.getJar();

    log("wab %s", wab);
    analyzer.setBundleClasspath("WEB-INF/classes," +
                                        analyzer.getProperty(analyzer.BUNDLE_CLASSPATH));

    Set<String> paths = new HashSet<>(dot.getResources().keySet());

    for (String path : paths) {
        if (path.indexOf('/') > 0 && !Character.isUpperCase(path.charAt(0))) {
            log("wab: moving: %s", path);
            dot.rename(path, "WEB-INF/classes/" + path);
        }
    }

    Path wabRoot = Paths.get(wab);
    includeFiles(dot, null, wabRoot.toString());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:24,代码来源:OSGiWrapper.java


示例11: analyzeJar

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
/**
 * Analyzes the jar and update the version range.
 *
 * @param analyzer the analyzer
 * @return {@code false}
 * @throws Exception if the analaysis fails.
 */
@Override
public boolean analyzeJar(Analyzer analyzer) throws Exception {
    loadInternalRangeFix();
    loadExternalRangeFix();

    if (analyzer.getReferred() == null) {
        return false;
    }

    // Data loaded, start analysis
    for (Map.Entry<Descriptors.PackageRef, Attrs> entry : analyzer.getReferred().entrySet()) {
        for (Range range : ranges) {
            if (range.matches(entry.getKey().getFQN())) {
                String value = range.getRange(analyzer);
                if (value != null) {
                    reporter.warning("Updating import version of " + range.name + " to " + value);
                    entry.getValue().put("version", value);
                }
            }
        }
    }
    return false;
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:31,代码来源:ImportedPackageRangeFixer.java


示例12: getRange

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private String getRange(Analyzer analyzer) throws Exception {
    if (foundRange != null) {
        return foundRange;
    }
    if (Strings.isNullOrEmpty(value)) {
        for (Jar jar : analyzer.getClasspath()) {
            if (isProvidedByJar(jar) && jar.getVersion() != null) {
                foundRange = jar.getVersion();
                return jar.getVersion();
            }
        }
        // Cannot find a provider.
        reporter.error("Cannot find a dependency providing " + name + " in the classpath");
        return null;
    } else {
        return value;
    }
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:19,代码来源:ImportedPackageRangeFixer.java


示例13: testWithReferredWithoutClasspath

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
@Test
public void testWithReferredWithoutClasspath() throws Exception {
    ImportedPackageRangeFixer fixer = new ImportedPackageRangeFixer();
    Reporter reporter = mock(Reporter.class);
    fixer.setReporter(reporter);
    fixer.setProperties(Collections.<String, String>emptyMap());

    Analyzer analyzer = mock(Analyzer.class);
    final Packages packages = new Packages();
    Descriptors descriptors = new Descriptors();
    packages.put(descriptors.getPackageRef("com.acme"));
    when(analyzer.getReferred()).thenReturn(packages);
    fixer.analyzeJar(analyzer);
    final Map.Entry<Descriptors.PackageRef, Attrs> actual = foundByPackageName(analyzer, "com.acme");
    assertThat(actual).isNotNull();
    assertThat(actual.getValue()).isEmpty();
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:18,代码来源:ImportedPackageRangeFixerTest.java


示例14: testWithReferredMatchingButNotInClasspath

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
@Test
public void testWithReferredMatchingButNotInClasspath() throws Exception {
    ImportedPackageRangeFixer fixer = new ImportedPackageRangeFixer();
    Reporter reporter = mock(Reporter.class);
    fixer.setReporter(reporter);
    fixer.setProperties(Collections.<String, String>emptyMap());

    Analyzer analyzer = mock(Analyzer.class);
    final Packages packages = new Packages();
    Descriptors descriptors = new Descriptors();
    packages.put(descriptors.getPackageRef("com.acme"));
    packages.put(descriptors.getPackageRef("com.google.common.collections"));
    when(analyzer.getReferred()).thenReturn(packages);

    fixer.analyzeJar(analyzer);

    Map.Entry<Descriptors.PackageRef, Attrs> actual = foundByPackageName(analyzer, "com.acme");
    assertThat(actual).isNotNull();
    assertThat(actual.getValue()).isEmpty();
    actual = foundByPackageName(analyzer, "com.google.common.collections");
    assertThat(actual).isNotNull();
    assertThat(actual.getValue()).isEmpty();
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:24,代码来源:ImportedPackageRangeFixerTest.java


示例15: setAnalyzerProperties

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private void setAnalyzerProperties(Analyzer analyzer) throws IOException {
    for (Map.Entry<String, Object> attribute : getAttributes().entrySet()) {
        String key = attribute.getKey();
        if (!"Manifest-Version".equals(key)) {
            analyzer.setProperty(key, attribute.getValue().toString());
        }
    }


    Map<String, List<String>> instructions = getInstructions();
    Set<String> instructionNames = instructions.keySet();
    if (!instructionNames.contains(Analyzer.IMPORT_PACKAGE)) {
        analyzer.setProperty(Analyzer.IMPORT_PACKAGE,
                "*, !org.apache.ant.*, !org.junit.*, !org.jmock.*, !org.easymock.*, !org.mockito.*");
    }
    if(!instructionNames.contains(Analyzer.BUNDLE_VERSION)){
        analyzer.setProperty(Analyzer.BUNDLE_VERSION, getVersion());
    }
    if(!instructionNames.contains(Analyzer.BUNDLE_NAME)){
        analyzer.setProperty(Analyzer.BUNDLE_NAME, getName());
    }
    if(!instructionNames.contains(Analyzer.BUNDLE_SYMBOLICNAME)){
        analyzer.setProperty(Analyzer.BUNDLE_SYMBOLICNAME, getSymbolicName());
    }
    if (!instructionNames.contains(Analyzer.EXPORT_PACKAGE)) {
        analyzer.setProperty(Analyzer.EXPORT_PACKAGE, "*;-noimport:=false;version=" + getVersion());
    }
    for (String instructionName : instructionNames) {
        String list = createPropertyStringFromList(instructionValue(instructionName));
        if (list != null && list.length() > 0) {
            analyzer.setProperty(instructionName, list);
        }
    }

    analyzer.setJar(getClassesDir());

    analyzer.setClasspath(getClasspath().getFiles().toArray(new File[0]));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:39,代码来源:DefaultOsgiManifest.java


示例16: setProperties

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private void setProperties(Analyzer analyzer) {
    analyzer.setProperty(Analyzer.BUNDLE_NAME, bundleName);
    analyzer.setProperty(Analyzer.BUNDLE_SYMBOLICNAME, bundleSymbolicName);
    analyzer.setProperty(Analyzer.BUNDLE_VERSION, bundleVersion.replace('-', '.'));

    analyzer.setProperty(Analyzer.BUNDLE_DESCRIPTION, bundleDescription);
    analyzer.setProperty(Analyzer.BUNDLE_LICENSE, bundleLicense);

    //TODO consider using stricter version policy
    //analyzer.setProperty("-provider-policy", "${range;[===,==+)}");
    //analyzer.setProperty("-consumer-policy", "${range;[===,==+)}");

    // There are no good defaults so make sure you set the Import-Package
    analyzer.setProperty(Analyzer.IMPORT_PACKAGE, importPackages);

    // TODO include version in export, but not in import
    analyzer.setProperty(Analyzer.EXPORT_PACKAGE, exportPackages);

    // TODO we may need INCLUDE_RESOURCE, or that might be done by Buck
    if (includeResources != null) {
        analyzer.setProperty(Analyzer.INCLUDE_RESOURCE, includeResources);
    }

    if (isWab()) {
        analyzer.setProperty(Analyzer.WAB, "src/main/webapp/");
        analyzer.setProperty("Web-ContextPath", webContext);
        analyzer.setProperty(Analyzer.IMPORT_PACKAGE, "*,org.glassfish.jersey.servlet,org.jvnet.mimepull\n");
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:30,代码来源:OSGiWrapper.java


示例17: wrap

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
/**
 * Wrap the file associated with this instance of {@code JarWrapper} if it is not a bundle already.
 * <p>
 * If the source file is already a bundle, nothing is done and this method returns the original file.
 * Notice that this means the returned file is not necessarily the same as the destination file.
 *
 * @param version version to give the bundle. If this is not a valid OSGi version, it will be converted to
 *                a {@link MavenVersion} and translated to a valid OSGi version.
 * @return the bundle file
 * @throws Exception if any error occurs while reading the source file or writing the destination bundle.
 */
public File wrap( String version ) throws Exception {
    if ( !jarFile.isFile() ) {
        throw new IllegalArgumentException( "Not a file: " + jarFile );
    }
    if ( version.trim().isEmpty() ) {
        throw new IllegalArgumentException( "Version must not be empty" );
    }

    try ( ZipFile input = new ZipFile( jarFile, ZipFile.OPEN_READ ) ) {
        if ( isBundle( input ) ) {
            return jarFile;
        }
    }

    final String name = ( artifactName == null ?
            subtract( jarFile.getName(), ".jar" ) : artifactName );

    try ( Jar newJar = new Jar( jarFile ) ) {
        Analyzer analyzer = new Analyzer();
        analyzer.setJar( newJar );
        analyzer.setBundleVersion( Version.isVersion( version ) ?
                Version.parseVersion( version ) :
                MavenVersion.parseString( version ).getOSGiVersion() );
        analyzer.setBundleSymbolicName( name );
        analyzer.setImportPackage( importInstructions );
        analyzer.setExportPackage( exportInstructions );

        File bundle = destination == null ?
                new File( jarFile.getParentFile(), name + "-osgi.jar" ) :
                destination;

        Manifest manifest = analyzer.calcManifest();

        return updateManifest( newJar, bundle, manifest );
    }
}
 
开发者ID:renatoathaydes,项目名称:osgiaas,代码行数:48,代码来源:JarWrapper.java


示例18: setAnalyzerProperties

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
private void setAnalyzerProperties(Analyzer analyzer) throws IOException {
    for (Map.Entry<String, Object> attribute : getAttributes().entrySet()) {
        String key = attribute.getKey();
        if (!"Manifest-Version".equals(key)) {
            analyzer.setProperty(key, attribute.getValue().toString());
        }
    }


    Map<String, List<String>> instructions = getInstructions();
    Set<String> instructionNames = instructions.keySet();
    if (!instructionNames.contains(Analyzer.IMPORT_PACKAGE)) {
        analyzer.setProperty(Analyzer.IMPORT_PACKAGE,
                "*, !org.apache.ant.*, !org.junit.*, !org.jmock.*, !org.easymock.*, !org.mockito.*");
    }
    if(!instructionNames.contains(Analyzer.BUNDLE_VERSION)){
        analyzer.setProperty(Analyzer.BUNDLE_VERSION, getVersion());
    }
    if(!instructionNames.contains(Analyzer.BUNDLE_NAME)){
        analyzer.setProperty(Analyzer.BUNDLE_NAME, getName());
    }
    if(!instructionNames.contains(Analyzer.BUNDLE_SYMBOLICNAME)){
        analyzer.setProperty(Analyzer.BUNDLE_SYMBOLICNAME, getSymbolicName());
    }
    if (!instructionNames.contains(Analyzer.EXPORT_PACKAGE)) {
        analyzer.setProperty(Analyzer.EXPORT_PACKAGE, "*;-noimport:=false;version=" + getVersion());
    }
    for (String instructionName : instructionNames) {
        String list = createPropertyStringFromList(instructionValue(instructionName));
        if (list != null && list.length() > 0) {
            analyzer.setProperty(instructionName, list);
        }
    }

    analyzer.setJar(getClassesDir());

    analyzer.setClasspath(getClasspath().getFiles().toArray(new File[getClasspath().getFiles().size()]));
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:39,代码来源:DefaultOsgiManifest.java


示例19: createAnalyzer

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
@Override
protected Analyzer createAnalyzer(ExportFileResource libResource, ProcessItem processItem) throws IOException {
    Analyzer analyzer = super.createAnalyzer(libResource, processItem);
    if (bundleName != null && bundleName.length() > 0) {
        analyzer.setProperty(Analyzer.BUNDLE_NAME, bundleName);
    }
    if (bundleSymbolicName != null && bundleSymbolicName.length() > 0) {
        analyzer.setProperty(Analyzer.BUNDLE_SYMBOLICNAME, bundleSymbolicName);
    }
    return analyzer;
}
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:12,代码来源:RouteDedicatedJobManager.java


示例20: addOsgiDependencies

import aQute.bnd.osgi.Analyzer; //导入依赖的package包/类
@Override
protected void addOsgiDependencies(Analyzer analyzer, ExportFileResource libResource, ProcessItem processItem)
        throws IOException {
    final DependenciesResolver resolver = new DependenciesResolver(processItem);
    //exportPackage.append(getPackageName(processItem));
    // Add Route Resource Export packages
    // http://jira.talendforge.org/browse/TESB-6227

    // add manifest items
    analyzer.setProperty(Analyzer.REQUIRE_BUNDLE, resolver.getManifestRequireBundle(MANIFEST_ITEM_SEPARATOR));
    analyzer.setProperty(Analyzer.IMPORT_PACKAGE,
        resolver.getManifestImportPackage(MANIFEST_ITEM_SEPARATOR) + ",*;resolution:=optional"); //$NON-NLS-1$
    analyzer.setProperty(Analyzer.EXPORT_PACKAGE, resolver.getManifestExportPackage(MANIFEST_ITEM_SEPARATOR));

    if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
        IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
                IRunProcessService.class);
        ITalendProcessJavaProject talendProcessJavaProject = processService.getTalendProcessJavaProject();
        if (talendProcessJavaProject != null) {
            final IPath libPath = talendProcessJavaProject.getLibFolder().getLocation();
            // process external libs
            final List<URL> list = new ArrayList<URL>();
            for (String s : resolver.getManifestBundleClasspath(MANIFEST_ITEM_SEPARATOR)
                    .split(Character.toString(MANIFEST_ITEM_SEPARATOR))) {
                if (!s.isEmpty()) {
                    list.add(libPath.append(s).toFile().toURI().toURL());
                }
            }
            libResource.addResources(list);
        }
    }
}
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:33,代码来源:RouteJavaScriptOSGIForESBManager.java



注:本文中的aQute.bnd.osgi.Analyzer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VuforiaTrackables类代码示例发布时间:2022-05-22
下一篇:
Java WXRenderErrorCode类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap