Examples of GlassFish


Examples of org.apache.syncope.installer.containers.Glassfish

                break;
            case GLASSFISH:
                final String createJavaOptCommand = "sh " + glassfishDir + Glassfish.CREATE_JAVA_OPT_COMMAND;
                fileSystemUtils.exec(createJavaOptCommand, null);

                final Glassfish glassfish = new Glassfish(installPath, artifactId);

                fileSystemUtils.exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployCore(), null);
                fileSystemUtils.exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployConsole(), null);
                break;
        }
    }
View Full Code Here

Examples of org.glassfish.embeddable.GlassFish

            final Main main = (Main) hk2Tracker.waitForService(0);
            hk2Tracker.close();
            final ModulesRegistry mr = ModulesRegistry.class.cast(getBundleContext().getService(getBundleContext().getServiceReference(ModulesRegistry.class.getName())));
            ServiceLocator serviceLocator = main.createServiceLocator(mr, startupContext, null, null);
            final ModuleStartup gfKernel = main.findStartupService(mr, serviceLocator, null, startupContext);
            GlassFish glassFish = createGlassFish(gfKernel, serviceLocator, gfProps.getProperties());
            gfs.add(glassFish);
            return glassFish;
        } catch (BootException ex) {
            throw new GlassFishException(ex);
        } catch (InterruptedException ex) {
View Full Code Here

Examples of org.glassfish.embeddable.GlassFish

            System.setProperty(com.sun.enterprise.glassfish.bootstrap.Constants.INSTANCE_ROOT_URI_PROP_NAME, instanceRoot.toURI().toString());
        }
    }

    protected GlassFish createGlassFish(ModuleStartup gfKernel, ServiceLocator habitat, Properties gfProps) throws GlassFishException {
        GlassFish gf = new GlassFishImpl(gfKernel, habitat, gfProps);
        return new EmbeddedOSGiGlassFishImpl(gf, getBundleContext());
    }
View Full Code Here

Examples of org.glassfish.embeddable.GlassFish

        }
    }

    @Override
    public GlassFish newGlassFish(GlassFishProperties glassfishProperties) throws GlassFishException {
        GlassFish embeddedGf = super.newGlassFish(glassfishProperties);
        int finalStartLevel = Integer.valueOf(glassfishProperties.getProperties().getProperty(
                Constants.FINAL_START_LEVEL_PROP, "2"));
        return new OSGiGlassFishImpl(embeddedGf, framework.getBundleContext(), finalStartLevel);
    }
View Full Code Here

Examples of org.glassfish.embeddable.GlassFish

            final Main main = (Main) hk2Tracker.waitForService(0);
            hk2Tracker.close();
            final ModulesRegistry mr = ModulesRegistry.class.cast(getBundleContext().getService(getBundleContext().getServiceReference(ModulesRegistry.class.getName())));
            final Habitat habitat = main.createHabitat(mr, startupContext);
            final ModuleStartup gfKernel = main.findStartupService(mr, habitat, null, startupContext);
            GlassFish glassFish = createGlassFish(gfKernel, habitat, gfProps.getProperties());
            gfs.add(glassFish);
            getBundleContext().registerService(GlassFish.class.getName(), glassFish, gfProps.getProperties());
            return glassFish;
        } catch (BootException ex) {
            throw new GlassFishException(ex);
View Full Code Here

Examples of org.glassfish.embeddable.GlassFish

        framework = null; // guard against repeated calls.
    }

    @Override
    protected GlassFish createGlassFish(ModuleStartup gfKernel, Habitat habitat, Properties gfProps) throws GlassFishException {
        GlassFish gf = super.createGlassFish(gfKernel, habitat, gfProps);
        int finalStartLevel = Integer.valueOf(gfProps.getProperty(
                Constants.FINAL_START_LEVEL_PROP, "2"));
        return new OSGiGlassFishImpl(gf, framework.getBundleContext(), finalStartLevel);
    }
View Full Code Here

Examples of org.glassfish.embeddable.GlassFish

                "DomainCreation");
        glassFishProperties.setProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY,
                domDir.getAbsolutePath());
        glassFishProperties.setProperty("-domain", domainConfig.getDomainName());

        GlassFish glassfish = runtime.newGlassFish(glassFishProperties);
        glassfish.start();

        // Will always need DAS's name & config. No harm using the name 'server'
        // to fetch <server-config>
        com.sun.enterprise.config.serverbeans.Server serverConfig =
                glassfish.getService(com.sun.enterprise.config.serverbeans.Server.class,
                "server");
        Config config = glassfish.getService(
                Config.class, serverConfig.getConfigRef());

        // Create a context object for this domain creation to enable the new
        // modules to make decisions
        DomainContext ctx = new DomainContext();
        ctx.setDomainType("dev"); //TODO : Whenever clustering/HA is supported
        // this setting needs to be fixed. Domain type can be dev/ha/cluster and
        // this type needs to be extracted possibly using an api from installer


        // bnevins 12/20/12 -- I'm not touching this ancient getLogger call.
        // because it looks risky.
        ctx.setLogger(LogDomains.getLogger(
                DomainInitializer.class, LogDomains.SERVER_LOGGER));

        // now for every such Inhabitant, fetch the actual initial config and
        // insert it into the module that initial config was targeted for.
        ServiceLocator habitat = glassfish.getService(ServiceLocator.class);
        Collection<DomainInitializer> inits =
                habitat.getAllServices(DomainInitializer.class);
        if (inits.isEmpty()) {
            logger.info(strings.get("NoCustomization"));
        }
        for (DomainInitializer inhabitant : habitat.<DomainInitializer>getAllServices(
                DomainInitializer.class)) {
            logger.info(strings.get("InvokeInitializer",
                    inhabitant.getClass()));
            Container newContainerConfig = inhabitant.getInitialConfig(ctx);
            try {
                ConfigSupport.apply((new ConfigCode() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public Object run(ConfigBeanProxy... objects) throws PropertyVetoException, TransactionFailure {
                        ((Config) objects[0]).getContainers().add((Container) objects[1]);
                        return Boolean.TRUE;
                    }
                }), new ConfigBeanProxy[]{config, newContainerConfig});
            }
            catch (TransactionFailure e) {
                logger.severe(strings.get("InitializerTransactionFailure",
                        inhabitant.getClass()));
            }
        }
        glassfish.dispose();
    }
View Full Code Here

Examples of org.glassfish.embeddable.GlassFish

            // we are supposed to stop. Leave any cleanup to some other code.

            // get the GlassFish object - we have to wait in case startup is still in progress
            // This is a temporary work-around until HK2 supports waiting for the service to
            // show up in the ServiceLocator.
            GlassFish gfKernel = habitat.getService(GlassFish.class);
            while (gfKernel == null) {
                Thread.sleep(1000);
                gfKernel = habitat.getService(GlassFish.class);
            }
            // gfKernel is absolutely positively for-sure not null.
            gfKernel.stop();
        }
        catch (Throwable t) {
            // ignore
        }
View Full Code Here

Examples of org.glassfish.embeddable.GlassFish

  public void setBundleContext(BundleContext context){
    ctx = context;
  }
 
   private GlassFish getGlassFish() {
         GlassFish gf = (GlassFish) ctx.getService(ctx.getServiceReference(GlassFish.class.getName()));
         try {
             assert(gf.getStatus() == GlassFish.Status.STARTED);
         } catch (GlassFishException e) {
             throw new RuntimeException(e);
         }
         return gf;
     }
View Full Code Here

Examples of org.glassfish.embeddable.GlassFish

        GlassFishProperties gfp = new GlassFishProperties();
        gfp.setProperty(StartupContext.TIME_ZERO_NAME, (new Long(System.currentTimeMillis())).toString());
        final String VERIFIER_MODULE = "org.glassfish.verifier";
        gfp.setProperty(StartupContext.STARTUP_MODULE_NAME, VERIFIER_MODULE);
//        gfp.setConfigFileURI("file:/tmp/domain.xml");
        GlassFish gf = gfr.newGlassFish(gfp);
        gf.start();
        int failedCount = -1;
        Verifier verifier = gf.getService(Verifier.class);
        if (verifierFrameworkContext.isUsingGui()) {
            MainFrame mf = new MainFrame(
                    verifierFrameworkContext.getJarFileName(), true, verifier);
            mf.setSize(800, 600);
            mf.setVisible(true);
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.