[Fix] Fixed type in StrolchBootstrapper
This commit is contained in:
parent
2269ffdd81
commit
ed9506555d
|
@ -192,7 +192,7 @@ public class StrolchBootstrapper extends DefaultHandler {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up Strolch by evaluating the environment from {@link StrolchEnvironment#getEnvironmentFromResourceEnv(Class)}
|
* Set up Strolch by evaluating the environment from {@link StrolchEnvironment#getEnvironmentFromResourceEnv(Class)}
|
||||||
* and then delegating to {@link #setupByBoostrapFile(String, File)}
|
* and then delegating to {@link #setupByBootstrapFile(String, File)}
|
||||||
*
|
*
|
||||||
* @param clazz
|
* @param clazz
|
||||||
* the class from which to load the resource as stream
|
* the class from which to load the resource as stream
|
||||||
|
@ -201,7 +201,7 @@ public class StrolchBootstrapper extends DefaultHandler {
|
||||||
*
|
*
|
||||||
* @return the Agent which is setup
|
* @return the Agent which is setup
|
||||||
*/
|
*/
|
||||||
public StrolchAgent setupByBoostrapFile(Class<?> clazz, File bootstrapFile) {
|
public StrolchAgent setupByBootstrapFile(Class<?> clazz, File bootstrapFile) {
|
||||||
DBC.PRE.assertNotNull("clazz must be set!", clazz);
|
DBC.PRE.assertNotNull("clazz must be set!", clazz);
|
||||||
DBC.PRE.assertNotNull("bootstrapFile must be set!", bootstrapFile);
|
DBC.PRE.assertNotNull("bootstrapFile must be set!", bootstrapFile);
|
||||||
this.environment = StrolchEnvironment.getEnvironmentFromResourceEnv(clazz);
|
this.environment = StrolchEnvironment.getEnvironmentFromResourceEnv(clazz);
|
||||||
|
@ -211,7 +211,7 @@ public class StrolchBootstrapper extends DefaultHandler {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up Strolch by evaluating the environment from {@link StrolchEnvironment#getEnvironmentFromResourceEnv(Class)}
|
* Set up Strolch by evaluating the environment from {@link StrolchEnvironment#getEnvironmentFromResourceEnv(Class)}
|
||||||
* and then delegating to {@link #setupByBoostrapFile(String, File)}
|
* and then delegating to {@link #setupByBootstrapFile(String, File)}
|
||||||
*
|
*
|
||||||
* @param clazz
|
* @param clazz
|
||||||
* the class from which to load the resource as stream
|
* the class from which to load the resource as stream
|
||||||
|
@ -220,7 +220,7 @@ public class StrolchBootstrapper extends DefaultHandler {
|
||||||
*
|
*
|
||||||
* @return the Agent which is setup
|
* @return the Agent which is setup
|
||||||
*/
|
*/
|
||||||
public StrolchAgent setupByBoostrapFile(Class<?> clazz, InputStream bootstrapFile) {
|
public StrolchAgent setupByBootstrapFile(Class<?> clazz, InputStream bootstrapFile) {
|
||||||
DBC.PRE.assertNotNull("clazz must be set!", clazz);
|
DBC.PRE.assertNotNull("clazz must be set!", clazz);
|
||||||
DBC.PRE.assertNotNull("bootstrapFile must be set!", bootstrapFile);
|
DBC.PRE.assertNotNull("bootstrapFile must be set!", bootstrapFile);
|
||||||
this.environment = StrolchEnvironment.getEnvironmentFromResourceEnv(clazz);
|
this.environment = StrolchEnvironment.getEnvironmentFromResourceEnv(clazz);
|
||||||
|
@ -238,7 +238,7 @@ public class StrolchBootstrapper extends DefaultHandler {
|
||||||
*
|
*
|
||||||
* @return the Agent which is setup
|
* @return the Agent which is setup
|
||||||
*/
|
*/
|
||||||
public StrolchAgent setupByBoostrapFile(String environment, File bootstrapFile) {
|
public StrolchAgent setupByBootstrapFile(String environment, File bootstrapFile) {
|
||||||
DBC.PRE.assertNotEmpty("Environment must be set!", environment);
|
DBC.PRE.assertNotEmpty("Environment must be set!", environment);
|
||||||
DBC.PRE.assertNotNull("bootstrapFile must be set!", bootstrapFile);
|
DBC.PRE.assertNotNull("bootstrapFile must be set!", bootstrapFile);
|
||||||
this.environment = environment;
|
this.environment = environment;
|
||||||
|
@ -256,7 +256,7 @@ public class StrolchBootstrapper extends DefaultHandler {
|
||||||
*
|
*
|
||||||
* @return the Agent which is setup
|
* @return the Agent which is setup
|
||||||
*/
|
*/
|
||||||
public StrolchAgent setupByBoostrapFile(String environment, InputStream bootstrapFile) {
|
public StrolchAgent setupByBootstrapFile(String environment, InputStream bootstrapFile) {
|
||||||
DBC.PRE.assertNotEmpty("Environment must be set!", environment);
|
DBC.PRE.assertNotEmpty("Environment must be set!", environment);
|
||||||
DBC.PRE.assertNotNull("bootstrapFile must be set!", bootstrapFile);
|
DBC.PRE.assertNotNull("bootstrapFile must be set!", bootstrapFile);
|
||||||
this.environment = environment;
|
this.environment = environment;
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class BootstrapperTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
File bootstrapFile = new File("src/test/resources/bootstraptest/StrolchBootstrap.xml");
|
File bootstrapFile = new File("src/test/resources/bootstraptest/StrolchBootstrap.xml");
|
||||||
StrolchAgent agent = new StrolchBootstrapper(RuntimeMock.getAppVersion()).setupByBoostrapFile("dev",
|
StrolchAgent agent = new StrolchBootstrapper(RuntimeMock.getAppVersion()).setupByBootstrapFile("dev",
|
||||||
bootstrapFile);
|
bootstrapFile);
|
||||||
assertEquals("dev", agent.getStrolchConfiguration().getRuntimeConfiguration().getEnvironment());
|
assertEquals("dev", agent.getStrolchConfiguration().getRuntimeConfiguration().getEnvironment());
|
||||||
agent.destroy();
|
agent.destroy();
|
||||||
|
@ -120,7 +120,7 @@ public class BootstrapperTest {
|
||||||
|
|
||||||
File bootstrapFile = new File("src/test/resources/bootstraptest/StrolchBootstrap.xml");
|
File bootstrapFile = new File("src/test/resources/bootstraptest/StrolchBootstrap.xml");
|
||||||
|
|
||||||
StrolchAgent agent = new StrolchBootstrapper(RuntimeMock.getAppVersion()).setupByBoostrapFile("test.next",
|
StrolchAgent agent = new StrolchBootstrapper(RuntimeMock.getAppVersion()).setupByBootstrapFile("test.next",
|
||||||
bootstrapFile);
|
bootstrapFile);
|
||||||
assertEquals("test", agent.getStrolchConfiguration().getRuntimeConfiguration().getEnvironment());
|
assertEquals("test", agent.getStrolchConfiguration().getRuntimeConfiguration().getEnvironment());
|
||||||
agent.destroy();
|
agent.destroy();
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class StartupListener implements ServletContextListener {
|
||||||
String boostrapFileName = "/WEB-INF/" + StrolchBootstrapper.FILE_BOOTSTRAP;
|
String boostrapFileName = "/WEB-INF/" + StrolchBootstrapper.FILE_BOOTSTRAP;
|
||||||
InputStream bootstrapFile = sce.getServletContext().getResourceAsStream(boostrapFileName);
|
InputStream bootstrapFile = sce.getServletContext().getResourceAsStream(boostrapFileName);
|
||||||
StrolchBootstrapper bootstrapper = new StrolchBootstrapper(StartupListener.class);
|
StrolchBootstrapper bootstrapper = new StrolchBootstrapper(StartupListener.class);
|
||||||
this.agent = bootstrapper.setupByBoostrapFile(StartupListener.class, bootstrapFile);
|
this.agent = bootstrapper.setupByBootstrapFile(StartupListener.class, bootstrapFile);
|
||||||
this.agent.initialize();
|
this.agent.initialize();
|
||||||
this.agent.start();
|
this.agent.start();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
Loading…
Reference in New Issue