Examples of adapt()


Examples of org.osgi.framework.Bundle.adapt()

    }

    protected boolean resolveBundles(Bundle... bundles) throws Exception {
        Bundle systemBundle = m_context.getBundle(0L);

        FrameworkWiring frameworkWiring = systemBundle.adapt(FrameworkWiring.class);
        frameworkWiring.resolveBundles(Arrays.asList(bundles));
       
        for (Bundle bundle : bundles) {
            if ((bundle.getState() & Bundle.RESOLVED) == 0) {
                return false;
View Full Code Here

Examples of org.osgi.framework.Bundle.adapt()

        bundle.start();
    } catch (BundleException e) {
      // TODO use log in future
      e.printStackTrace();
    }
    bundle.adapt(BundleStartLevel.class).setStartLevel(1);
  }

}
View Full Code Here

Examples of org.osgi.framework.Bundle.adapt()

        // Install the bundle as module if it has not already happened
        // A bundle that could not get resolved will not have an associated module
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        Module module = runtime.getModule(resid);
        BundleWiring wiring = bundle.adapt(BundleWiring.class);
        if (module == null && wiring != null) {
            try {
                ClassLoader classLoader = wiring.getClassLoader();
                module = runtime.installModule(classLoader, resource, null);
            } catch (ModuleException ex) {
View Full Code Here

Examples of org.osgi.framework.Bundle.adapt()

        // Install the bundle as module if it has not already happened
        // A bundle that could not get resolved will not have an associated module
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        Module module = runtime.getModule(resid);
        BundleWiring wiring = bundle.adapt(BundleWiring.class);
        if (module == null && wiring != null) {
            try {
                ClassLoader classLoader = wiring.getClassLoader();
                module = runtime.installModule(classLoader, resource, null);
            } catch (ModuleException ex) {
View Full Code Here

Examples of org.osgi.framework.launch.Framework.adapt()

       
        bundle.start();      
       
        Thread.sleep(2000);
       
        FrameworkStartLevel sl = framework.adapt(FrameworkStartLevel.class);
       
        MockLock lock = (MockLock) main.getLock();

        Assert.assertEquals(100, sl.getStartLevel());      
View Full Code Here

Examples of org.python.core.adapter.ClassicPyObjectAdapter.adapt()

     * @param value the value of the variable, must be adaptable by Jython
     */
    public void setGlobal(String name, Object value) {
        if (value != null) {
            ClassicPyObjectAdapter adapter = new ClassicPyObjectAdapter();
            sosreport.invoke(SET_GLOBAL, new PyString(name), adapter.adapt(value));
        }
    }

    /**
     * Sets the method of compressing the report archive.
View Full Code Here

Examples of org.sonatype.nexus.client.core.spi.subsystem.repository.RepositoryFactory.adapt()

      throw new IllegalStateException(
          format("No repository factory found for repository with id %s", id)
      );
    }

    return (R) factory.adapt(getNexusClient(), rbs);
  }

}
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.