map.put("-type", type.toString());
public String getRuntimeTypePrefix(StartupContext startupContext) { Properties args = startupContext.getArguments(); RuntimeType serverType = RuntimeType.getDefault(); String typeString = args.getProperty("-type"); if (typeString != null) serverType = RuntimeType.valueOf(typeString); if (LOG.isLoggable(Level.FINE)) { LOG.fine("server type is: " + serverType.name()); } if (serverType.isEmbedded()) return "embedded"; if (serverType.isSingleInstance() || serverType.isDas()) return "admin"; if (serverType.isInstance()) return "instance"; return ""; }
serverType = RuntimeType.getDefault(); serverType = RuntimeType.valueOf(typeString);
/** * This method checks if this command has @ExecuteOn annotation with * RuntimeType.SINGle_INSTANCE * @param commandName the command which is executed * @return true only if @ExecuteOn has RuntimeType.SINGLE_INSTANCE false for * other cases */ public boolean isSingleInstanceCommand(String commandName) { CommandModel model = commandRunner.getModel(getScope(commandName),getCommandAfterScope(commandName),aalogger) ; if (model != null ) { ExecuteOn executeOn = model.getClusteringAttributes(); if ((executeOn != null) && (executeOn.value().length ==1) && executeOn.value()[0].equals(RuntimeType.SINGLE_INSTANCE)) { return true; } } return false; }
serverType = RuntimeType.getDefault(); serverType = RuntimeType.valueOf(typeString);
public void execute(AdminCommandContext context) { if (!env.isInstance()) { String msg = Strings.get("stop.instance.notInstance", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } doExecute(habitat, env, force); } }
serverType = RuntimeType.getDefault(); serverType = RuntimeType.valueOf(typeString);
public void execute(AdminCommandContext context) { if (!env.isInstance()) { String msg = Strings.get("stop.instance.notInstance", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } doExecute(habitat, env, context.getLogger(), force); } }
/** * Shutdown of the application server : * * All running services are stopped. * LookupManager is flushed. */ public void execute(AdminCommandContext context) { if (!env.isDas()) { // This command is asynchronous. We can't return anything so we just // log the error and return String msg = localStrings.getLocalString("stop.domain.notDas", "stop-domain only works with domains, this is a {0}", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } doExecute(habitat, env, force); } }
@Override public void execute(AdminCommandContext context) { if (!env.isInstance()) { String msg = Strings.get("restart.instance.notInstance", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } setRegistry(registry); setServerName(env.getInstanceName()); if (debug != null) setDebug(debug); doExecute(context); } }
@Override public void execute(AdminCommandContext context) { if (!env.isInstance()) { String msg = Strings.get("restart.instance.notInstance", env.getRuntimeType().toString()); context.getLogger().warning(msg); return; } setRegistry(registry); setServerName(env.getInstanceName()); if (debug != null) setDebug(debug); doExecute(context); } }
setError(Strings.get("restart.instance.notDas", env.getRuntimeType().toString()));
setError(Strings.get("restart.instance.notDas", env.getRuntimeType().toString()));
} else { msg = Strings.get("start.instance.notAnInstanceOrDas", env.getRuntimeType().toString()); logger.severe(msg); report.setMessage(msg);
} else { msg = Strings.get("start.instance.notAnInstanceOrDas", env.getRuntimeType().toString()); logger.severe(msg); report.setMessage(msg);
env.getRuntimeType().toString());
env.getRuntimeType().toString());