Examples of Require


Examples of org.apache.geronimo.obr.model.Require

        if (fragment != null) {
            /*
             * In RFC 112 the Fragment-Host is represented as a "<extend/>" element
             * not a "<require extend="true"/>" element.
             */
            Require require = new Require();
            require.setExtend(true);
            require.setMultiple(false);
            require.setOptional(false);
            require.setName(CAPABILITY_BUNDLE);
            require.setContent("Required Host: " + fragment.getName());
           
            VersionRange range = fragment.getVersionRange();
            String versionExpression = getVersionFilter(range);
            require.setFilter("(&(symbolicname=" + fragment.getName() + ")" + versionExpression + ")")
           
            resource.getRequire().add(require);
           
            // Add "fragment" capability
            Capability cap = new Capability();
View Full Code Here

Examples of org.apache.geronimo.obr.model.Require

    }
      
    private void convertImportPackageToRequirement(Resource resource) {
        List<BundleDescription.ImportPackage> imports = bundleDescription.getImportPackage();
        for (BundleDescription.ImportPackage importPackage : imports) {
            Require require = new Require();
            require.setMultiple(false);
            require.setOptional(importPackage.isOptional());
            require.setName("package");
            require.setContent("Import-Package: " + importPackage.getName());

            VersionRange range = importPackage.getVersionRange();
            String versionFilter = getVersionFilter(range);
            require.setFilter("(&(package=" + importPackage.getName() + ")" + versionFilter + ")");           

            resource.getRequire().add(require);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.obr.model.Require

    }
   
    private void convertRequireBundleToRequirement(Resource resource) {
        List<BundleDescription.RequireBundle> requireBundles = bundleDescription.getRequireBundle();
        for (BundleDescription.RequireBundle requireBundle : requireBundles) {
            Require require = new Require();
            require.setMultiple(false);
            require.setOptional(requireBundle.isOptional());
            require.setName("bundle");
            require.setContent("Require-Bundle: " + requireBundle.getName());
           
            VersionRange range = requireBundle.getVersionRange();
            String versionExpression = getVersionFilter(range);
            require.setFilter("(&(symbolicname=" + requireBundle.getName() + ")" + versionExpression + ")")
           
            resource.getRequire().add(require);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.obr.model.Require

        if (fragment != null) {
            /*
             * In RFC 112 the Fragment-Host is represented as a "<extend/>" element
             * not a "<require extend="true"/>" element.
             */
            Require require = new Require();
            require.setExtend(true);
            require.setMultiple(false);
            require.setOptional(false);
            require.setName("bundle");
            require.setContent("Fragment-Host: " + fragment.getName());
           
            VersionRange range = fragment.getVersionRange();
            String versionExpression = getVersionFilter(range);
            require.setFilter("(&(symbolicname=" + fragment.getName() + ")" + versionExpression + ")")
           
            resource.getRequire().add(require);
        }
    }
View Full Code Here

Examples of org.apache.ivy.osgi.updatesite.xml.Require

            b.addRequirement(r);
        }

        Iterator itRequires = feature.getRequires().iterator();
        while (itRequires.hasNext()) {
            Require require = (Require) itRequires.next();
            String id;
            if (require.getPlugin() != null) {
                id = require.getPlugin();
            } else {
                id = require.getFeature();
            }
            VersionRange range;
            if (require.getMatch().equals("greaterOrEqual")) {
                range = new VersionRange(require.getVersion());
            } else {
                throw new IllegalStateException("unsupported match " + require.getMatch());
            }
            BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, id, range, null);
            b.addRequirement(r);
        }
View Full Code Here

Examples of org.dynjs.runtime.builtins.Require

            JSObject globalObject = runtime.getGlobalContext().getObject();
            globalObject.defineOwnProperty(null, "__vertx", PropertyDescriptor.newDataPropertyDescriptor(getVertx(), true, true, false), false);
            globalObject.defineOwnProperty(null, "__dirname", PropertyDescriptor.newDataPropertyDescriptor(System.getProperty("user.dir"), true, true, true), false);
            globalObject.defineOwnProperty(null, "__filename", PropertyDescriptor.newDataPropertyDescriptor(Nodyn.NODE_JS, true, true, true), false);
            globalObject.defineOwnProperty(null, "__nodyn", PropertyDescriptor.newDataPropertyDescriptor(this, true, true, false), false);
            globalObject.defineOwnProperty(null, "__native_require", PropertyDescriptor.newDataPropertyDescriptor(new Require(runtime.getGlobalContext()), true, true, true), false);

            NodeProcess javaProcess = new NodeProcess(this);

            getEventLoop().setProcess(javaProcess);
View Full Code Here

Examples of org.mozilla.javascript.commonjs.module.Require

        this.version = version;

        try {
            Context context = createContext();
            globalScope = context.initStandardObjects();
            final Require require = getSandboxedRequire(context, globalScope, true);
            coffeeScript = require.requireMain(context, "coffee-script");
        } catch (Exception e1) {
            throw new CoffeeScriptException("Unable to load the coffeeScript compiler into Rhino", e1);
        } finally {
            Context.exit();
        }
View Full Code Here

Examples of org.mozilla.javascript.commonjs.module.Require

        context.setOptimizationLevel(9); // Enable optimization
        return context;
    }

    private Require getSandboxedRequire(Context cx, Scriptable scope, boolean sandboxed) throws URISyntaxException {
        return new Require(cx, cx.initStandardObjects(),
                           new StrongCachingModuleScriptProvider(
                                   new UrlModuleSourceProvider(Collections.singleton(
                                           getDirectory()), null)), null, null, sandboxed);
    }
View Full Code Here

Examples of org.mozilla.javascript.commonjs.module.Require

  private void init(final Class<?> clazz) {
    final Context context = Context.enter();
    context.setOptimizationLevel(this.optimizationLevel);
    context.setLanguageVersion(Context.VERSION_1_7);
    final ScriptableObject scope = context.initStandardObjects();
    final Require require = new Require(Context.getCurrentContext(), scope,
        getModuleScriptProvider(clazz), null, null, false);
    require.install(scope);
    try {
      this.moduleScope = new ModuleScope(scope, new URI("./" + this.name), null);
    } catch (final URISyntaxException e) {
      throw new SmallerException("Failed to create moduleScope", e);
    }
View Full Code Here

Examples of org.mozilla.javascript.commonjs.module.Require

        this.version = version;

        try {
            Context context = createContext();
            globalScope = context.initStandardObjects();
            final Require require = getSandboxedRequire(context, globalScope, true);
            coffeeScript = require.requireMain(context, "coffee-script");
        } catch (Exception e1) {
            throw new CoffeeScriptException("Unable to load the coffeeScript compiler into Rhino", e1);
        } finally {
            Context.exit();
        }
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.