use of com.eden.orchid.api.OrchidSecurityManager in project Orchid by JavaEden.
the class Orchid method start.
public boolean start(List<Module> modules) {
OrchidContext context = null;
try {
String moduleLog = "\n--------------------";
for (Module module : modules) {
if (!module.getClass().getName().startsWith("com.eden.orchid.OrchidModule")) {
moduleLog += "\n * " + module.getClass().getName();
}
}
moduleLog += "\n";
Clog.tag("Using the following modules").log(moduleLog);
Injector injector = Guice.createInjector(modules);
String flagLog = "";
flagLog += "\n--------------------\n";
flagLog += OrchidFlags.getInstance().printFlags();
flagLog += "\n";
Clog.tag("Flag values").log(flagLog);
context = injector.getInstance(OrchidContext.class);
try {
OrchidSecurityManager manager = injector.getInstance(OrchidSecurityManager.class);
System.setSecurityManager(manager);
} catch (Exception e) {
}
Clog.i("Running Orchid version {}, site version {} in {} environment", context.getOrchidVersion(), context.getVersion(), context.getEnvironment());
context.start();
context.finish();
return true;
} catch (Exception e) {
Clog.e("Something went wrong running Orchid", e);
e.printStackTrace();
if (context != null) {
context.broadcast(Orchid.Lifecycle.Shutdown.fire(context, this));
}
return false;
}
}
Aggregations