-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
/* | ||
* Copyright © 2017 camunda services GmbH ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.zeebe.dmn; | ||
|
||
import java.util.Properties; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
/* | ||
* Copyright © 2017 camunda services GmbH ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.zeebe.dmn; | ||
|
||
import java.io.IOException; | ||
|
@@ -15,7 +30,7 @@ | |
|
||
public class DmnRepository | ||
{ | ||
private final static Logger LOG = LoggerFactory.getLogger(DmnRepository.class); | ||
private static final Logger LOG = LoggerFactory.getLogger(DmnRepository.class); | ||
|
||
private final String directory; | ||
private final DmnEngine dmnEngine; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
/* | ||
* Copyright © 2017 camunda services GmbH ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.zeebe.dmn; | ||
|
||
import java.io.IOException; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,78 @@ | ||
/* | ||
* Copyright © 2017 camunda services GmbH ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.zeebe.dmn; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Properties; | ||
import java.util.Scanner; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class StandaloneDmnApplication | ||
{ | ||
private static final Logger LOG = LoggerFactory.getLogger(StandaloneDmnApplication.class); | ||
|
||
public static final String PROP_FILE = "application.properties"; | ||
|
||
public static final String REPO_DIR_PROP = "zeebe.dmn.repo"; | ||
public static final String TOPIC_PROP = "zeebe.dmn.topic"; | ||
|
||
private static final String DEFAULT_REPO_DIR = "repo"; | ||
private static final String DEFAULT_TOPIC = "default-topic"; | ||
|
||
public static void main(String[] args) | ||
{ | ||
// TODO map args to client properties | ||
final Properties properties = loadProperties(); | ||
|
||
final String repoDir = properties.getProperty(REPO_DIR_PROP, DEFAULT_REPO_DIR); | ||
final String topic = properties.getProperty(TOPIC_PROP, DEFAULT_TOPIC); | ||
|
||
final DmnApplication application = new DmnApplication(DEFAULT_REPO_DIR, DEFAULT_TOPIC); | ||
final DmnApplication application = new DmnApplication(repoDir, topic); | ||
application.start(); | ||
|
||
waitUntilClose(); | ||
|
||
application.close(); | ||
} | ||
|
||
private static Properties loadProperties() | ||
{ | ||
final Properties properties = new Properties(); | ||
|
||
try | ||
{ | ||
final InputStream propertyStream = StandaloneDmnApplication.class.getResourceAsStream(PROP_FILE); | ||
if (propertyStream != null) | ||
{ | ||
properties.load(propertyStream); | ||
} | ||
else | ||
{ | ||
LOG.debug("No configuration found '{}'. Use default values.", PROP_FILE); | ||
} | ||
} | ||
catch (IOException e) | ||
{ | ||
LOG.warn("Failed to read properties '{}'.", PROP_FILE, e); | ||
} | ||
return properties; | ||
} | ||
|
||
private static void waitUntilClose() | ||
{ | ||
try (Scanner scanner = new Scanner(System.in)) | ||
|