BootstrapProperties bootstrapProperties = new BootstrapProperties(); bootstrapProperties.setInstallRoot("C:\\applicationserverdir"); GlassFishRuntime glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProperties); GlassFishProperties glassfishProperties = new GlassFishProperties(); glassfishProperties.setInstanceRoot("C:\\applicationserverdir\\domains\\myJavaFXAppDomain"); glassfishProperties.setPort("http-listener", 8080); glassfishProperties.setPort("https-listener", 8181); GlassFish glassfish = glassfishRuntime.newGlassFish(glassfishProperties); glassfish.start();
/** * Create a new instance of GlassFish with default {@link org.glassfish.embeddable.GlassFishProperties} * * @return New GlassFish instance. * @throws GlassFishException If at all fails to create a new GlassFish instance. */ public GlassFish newGlassFish() throws GlassFishException { return newGlassFish(new GlassFishProperties()); }
@Override public GlassFish newGlassFish(GlassFishProperties glassfishProperties) throws GlassFishException { return decoratedGfr.newGlassFish(glassfishProperties); } }
private void shutdownInternal() throws GlassFishException { if (glassFish != null) { glassFish.getDeployer().undeploy(getApplicationName()); glassFish.stop(); glassFish = null; } }
/** * Bootstrap a GlassFishRuntime with default {@link BootstrapProperties}. * * @return Bootstrapped GlassFishRuntime * @throws GlassFishException if the GlassFishRuntime is already bootstrapped. */ public static GlassFishRuntime bootstrap() throws GlassFishException { return bootstrap(new BootstrapProperties(), GlassFishRuntime.class.getClassLoader()); }
@Resource(mappedName = "org.glassfish.embeddable.CommandRunner") CommandRunner commandRunner; public void configureLoginRealm() { CommandResult commandResult = commandRunner.run("create-auth-realm", "--classname=com.blah.blah.SecureJDBCRealm", "--property=jaas-context= secureJDBCRealm", "secure-JDBC-realm"); log.debug(commandResult.getExitStatus().toString() + " " + commandResult.getOutput()); Throwable throwable = commandResult.getFailureCause(); if (throwable != null) { log.error(throwable.getMessage(), throwable); } }
@Override public void stop() throws GlassFishException { decoratedGf.stop(); }
@Override public <T> T getService(Class<T> serviceType) throws GlassFishException { return decoratedGf.getService(serviceType); }
protected synchronized static void shutdownInternal() throws GlassFishException { if (me == null) { throw new GlassFishException("Already shutdown", null); } me = null; }
public GlassfishPreStartConfigurator setHttpPort(int port) { props.setPort("http-listener", port); return this; } }
@Override public Status getStatus() throws GlassFishException { return decoratedGf.getStatus(); }
@Override public CommandRunner getCommandRunner() throws GlassFishException { return decoratedGf.getCommandRunner(); } }
/** * Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object. * Calling this method twice will throw a GlassFishException * * @param bootstrapProperties BootstrapProperties used to setup the runtime * @param cl ClassLoader used as parent loader by GlassFish modules. If null is passed, the class loader * of this class is used. * @return a bootstrapped runtime that can now be used to create new GlassFish instances * @throws GlassFishException */ public static GlassFishRuntime bootstrap(BootstrapProperties bootstrapProperties, ClassLoader cl) throws GlassFishException { return _bootstrap(bootstrapProperties, cl); }
/** * Create a new instance of GlassFish with default {@link org.glassfish.embeddable.GlassFishProperties} * * @return New GlassFish instance. * @throws GlassFishException If at all fails to create a new GlassFish instance. */ public GlassFish newGlassFish() throws GlassFishException { return newGlassFish(new GlassFishProperties()); }
/** * Bootstrap a GlassFishRuntime with default {@link BootstrapProperties}. * * @return Bootstrapped GlassFishRuntime * @throws GlassFishException if the GlassFishRuntime is already bootstrapped. */ public static GlassFishRuntime bootstrap() throws GlassFishException { return bootstrap(new BootstrapProperties(), GlassFishRuntime.class.getClassLoader()); }
@Override public GlassFish newGlassFish(GlassFishProperties glassfishProperties) throws GlassFishException { return decoratedGfr.newGlassFish(glassfishProperties); } }
protected synchronized static void shutdownInternal() throws GlassFishException { if (me == null) { throw new GlassFishException("Already shutdown", null); } me = null; }
@Override public CommandRunner getCommandRunner() throws GlassFishException { return decoratedGf.getCommandRunner(); } }