public boolean handles(BootstrapProperties bsProps) { return EmbeddedOSGiGlassFishRuntimeBuilder.class.getName(). equals(bsProps.getProperties().getProperty(Constants.BUILDER_NAME_PROPERTY)); }
public boolean handles(BootstrapProperties bsProps) { return EmbeddedOSGiGlassFishRuntimeBuilder.class.getName(). equals(bsProps.getProperties().getProperty(Constants.BUILDER_NAME_PROPERTY)); }
private static RuntimeBuilder getRuntimeBuilder(BootstrapProperties bootstrapProperties, ClassLoader cl) throws GlassFishException { // StringBuilder sb = new StringBuilder("Launcher Class Loader = " + cl); // if (cl instanceof URLClassLoader) { // sb.append("has following Class Path: "); // for (URL url : URLClassLoader.class.cast(cl).getURLs()) { // sb.append(url).append(", "); // } // } // System.out.println(sb); Iterator<RuntimeBuilder> runtimeBuilders = ServiceLoader.load(RuntimeBuilder.class, cl).iterator(); while (runtimeBuilders.hasNext()) { try { RuntimeBuilder builder = runtimeBuilders.next(); logger.logp(Level.FINE, "GlassFishRuntime", "getRuntimeBuilder", "builder = {0}", new Object[]{builder}); if (builder.handles(bootstrapProperties)) { return builder; } } catch (ServiceConfigurationError sce) { // Ignore the exception and move ahead to the next builder. logger.logp(Level.FINE, "GlassFishRuntime", "getRuntimeBuilder", "Ignoring", sce); } catch (NoClassDefFoundError ncdfe) { // On IBM JDK, we seem to be getting NoClassDefFoundError instead of ServiceConfigurationError // when OSgiRuntimeBuilder is not able to be loaded in non-OSGi mode because of absence of // OSGi classes in classpath. So, we need to catch it and ignore. logger.logp(Level.FINE, "GlassFishRuntime", "getRuntimeBuilder", "Ignoring", ncdfe); } } throw new GlassFishException("No runtime builder available for this configuration: " + bootstrapProperties.getProperties(), null); }
private static RuntimeBuilder getRuntimeBuilder(BootstrapProperties bootstrapProperties, ClassLoader cl) throws GlassFishException { // StringBuilder sb = new StringBuilder("Launcher Class Loader = " + cl); // if (cl instanceof URLClassLoader) { // sb.append("has following Class Path: "); // for (URL url : URLClassLoader.class.cast(cl).getURLs()) { // sb.append(url).append(", "); // } // } // System.out.println(sb); Iterator<RuntimeBuilder> runtimeBuilders = ServiceLoader.load(RuntimeBuilder.class, cl).iterator(); while (runtimeBuilders.hasNext()) { try { RuntimeBuilder builder = runtimeBuilders.next(); logger.logp(Level.FINE, "GlassFishRuntime", "getRuntimeBuilder", "builder = {0}", new Object[]{builder}); if (builder.handles(bootstrapProperties)) { return builder; } } catch (ServiceConfigurationError sce) { // Ignore the exception and move ahead to the next builder. logger.logp(Level.FINE, "GlassFishRuntime", "getRuntimeBuilder", "Ignoring", sce); } catch (NoClassDefFoundError ncdfe) { // On IBM JDK, we seem to be getting NoClassDefFoundError instead of ServiceConfigurationError // when OSgiRuntimeBuilder is not able to be loaded in non-OSGi mode because of absence of // OSGi classes in classpath. So, we need to catch it and ignore. logger.logp(Level.FINE, "GlassFishRuntime", "getRuntimeBuilder", "Ignoring", ncdfe); } } throw new GlassFishException("No runtime builder available for this configuration: " + bootstrapProperties.getProperties(), null); }
public GlassFishRuntime build(BootstrapProperties bsProps) throws GlassFishException { configureBundles(bsProps); provisionBundles(bsProps); GlassFishRuntime gfr = new EmbeddedOSGiGlassFishRuntime(getBundleContext()); Properties props = bsProps.getProperties(); Dictionary properties = new Properties(); for (final String name: props.stringPropertyNames()) properties.put(name, props.getProperty(name)); getBundleContext().registerService(GlassFishRuntime.class.getName(), gfr, properties); return gfr; }
public GlassFishRuntime build(BootstrapProperties bsProps) throws GlassFishException { configureBundles(bsProps); provisionBundles(bsProps); GlassFishRuntime gfr = new EmbeddedOSGiGlassFishRuntime(getBundleContext()); Properties props = bsProps.getProperties(); Dictionary properties = new Properties(); for (final String name: props.stringPropertyNames()) properties.put(name, props.getProperty(name)); getBundleContext().registerService(GlassFishRuntime.class.getName(), gfr, properties); return gfr; }
private void provisionBundles(BootstrapProperties bsProps) { BundleProvisioner bundleProvisioner = new BundleProvisioner(getBundleContext(), bsProps.getProperties()); bundleProvisioner.installBundles(); bundleProvisioner.startBundles(); }
private void provisionBundles(BootstrapProperties bsProps) { BundleProvisioner bundleProvisioner = new BundleProvisioner(getBundleContext(), bsProps.getProperties()); bundleProvisioner.installBundles(); bundleProvisioner.startBundles(); }
public GlassFishRuntime build(BootstrapProperties bsProps) throws GlassFishException { try { MainHelper.buildStartupContext(bsProps.getProperties()); Properties properties = bsProps.getProperties();
public GlassFishRuntime build(BootstrapProperties bsProps) throws GlassFishException { try { MainHelper.buildStartupContext(bsProps.getProperties()); Properties properties = bsProps.getProperties();