use of com.sun.enterprise.admin.report.HTMLActionReporter in project Payara by payara.
the class ApplicationLoaderService method stopApplication.
private void stopApplication(Application app, ApplicationInfo appInfo) {
final ActionReport dummy = new HTMLActionReporter();
if (appInfo != null) {
UndeployCommandParameters parameters = new UndeployCommandParameters(appInfo.getName());
parameters.origin = UndeployCommandParameters.Origin.unload;
parameters.command = UndeployCommandParameters.Command.shutdown_server;
try {
deployment.disable(parameters, app, appInfo, dummy, logger);
} catch (Exception e) {
logger.log(Level.SEVERE, KernelLoggerInfo.loadingApplicationErrorDisable, e);
}
unloadApplicationForTenants(app, dummy);
appRegistry.remove(appInfo.getName());
}
}
use of com.sun.enterprise.admin.report.HTMLActionReporter in project Payara by payara.
the class ConfigAttributeSetTest method simpleAttributeSetTest.
@Test
public void simpleAttributeSetTest() {
CommandRunnerImpl runner = habitat.getService(CommandRunnerImpl.class);
assertNotNull(runner);
// let's find our target
NetworkListener listener = null;
NetworkListeners service = habitat.getService(NetworkListeners.class);
for (NetworkListener l : service.getNetworkListener()) {
if ("http-listener-1".equals(l.getName())) {
listener = l;
break;
}
}
assertNotNull(listener);
// Let's register a listener
ObservableBean bean = (ObservableBean) ConfigSupport.getImpl(listener);
bean.addListener(this);
// parameters to the command
ParameterMap parameters = new ParameterMap();
parameters.set("value", "8090");
parameters.set("DEFAULT", "configs.config.server-config.http-service.http-listener.http-listener-1.port");
// execute the set command.
runner.getCommandInvocation("set", new HTMLActionReporter(), adminSubject()).parameters(parameters).execute();
// check the result.
String port = listener.getPort();
assertEquals(port, "8090");
// ensure events are delivered.
habitat.<Transactions>getService(Transactions.class).waitForDrain();
// finally
bean.removeListener(this);
// check we recevied the event
assertNotNull(event);
assertEquals("8080", event.getOldValue());
assertEquals("8090", event.getNewValue());
assertEquals("port", event.getPropertyName());
}
Aggregations