public abstract class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateInitialDynamicThreadPoolSize(org.openksavi.sponge.engine.Engine engine,
int maxPoolSize) |
static void |
close(InputStream stream) |
static void |
close(OutputStream stream) |
static boolean |
containsException(Throwable exception,
Class<?> type) |
static String |
createControlEventName(Class<? extends org.openksavi.sponge.event.ControlEvent> controlEventClass) |
static String |
createGlobalLoggerName(org.openksavi.sponge.kb.KnowledgeBaseEngineOperations knowledgeBaseEngineOperations) |
static String |
createLoggerName(org.openksavi.sponge.kb.KnowledgeBase knowledgeBase,
String targetName) |
static String |
createPluginLoggerName() |
static <T extends Serializable> |
deepClone(T source) |
static String |
dumpConfiguration(org.apache.commons.configuration2.Configuration configuration)
Dumps configuration to string.
|
static void |
executeConcurrentlyOnce(org.openksavi.sponge.engine.Engine engine,
Runnable runnable) |
static String |
getAbbreviatedEventSequenceString(BaseRule rule) |
static org.openksavi.sponge.kb.KnowledgeBaseEngineOperations |
getEps(org.openksavi.sponge.kb.KnowledgeBaseInterpreter interpreter) |
static <T> T |
getException(Throwable exception,
Class<T> type) |
static String |
getLastSubdirectory(String dir) |
static String |
getPackagePath(Class<?> cls) |
static Reader |
getReader(String fileName) |
static Reader |
getReader(String fileName,
Charset charset) |
static String |
getRequiredConfigurationString(org.openksavi.sponge.config.Configuration configuration,
String key) |
static org.openksavi.sponge.kb.ScriptKnowledgeBaseInterpreter |
getScriptInterpreter(org.openksavi.sponge.engine.Engine engine,
String kbName) |
static String |
getSourceName(Throwable exception) |
static URL |
getUrlFromClasspath(String resourceName) |
static <K,V> Map<K,V> |
immutableMapOf(K k1,
V v1) |
static <K,V> Map<K,V> |
immutableMapOf(K k1,
V v1,
K k2,
V v2) |
static <K,V> Map<K,V> |
immutableMapOf(K k1,
V v1,
K k2,
V v2,
K k3,
V v3) |
static <K,V> Map<K,V> |
immutableMapOf(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4) |
static <K,V> Map<K,V> |
immutableMapOf(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5) |
static Object |
searchConfigurationValueByAttributeValue(org.openksavi.sponge.config.Configuration root,
String parentKey,
String attrName,
String attrValue) |
static void |
shutdownExecutorService(org.openksavi.sponge.engine.Engine engine,
Object named,
ExecutorService executorService) |
static List<String> |
split(String text,
char separator) |
static <T> Stream<T> |
stream(Iterator<T> iterator) |
static String |
toStringArrayEventSequence(Collection<org.openksavi.sponge.event.Event> events,
String attributeName) |
static String |
toStringEventSequence(Collection<org.openksavi.sponge.event.Event> events) |
static String |
toStringEventSequence(Collection<org.openksavi.sponge.event.Event> events,
String attributeName) |
static void |
trialRunEngine(org.openksavi.sponge.engine.Engine engine,
int timeout)
Trial run of the engine.
|
static org.openksavi.sponge.SpongeException |
wrapException(String sourceName,
Throwable throwable)
Wraps or creates a new Sponge exception.
|
public static void trialRunEngine(org.openksavi.sponge.engine.Engine engine,
int timeout)
timeout seconds after startup.engine - the engine.timeout - timeout in seconds.public static <T extends Serializable> T deepClone(T source)
public static Reader getReader(String fileName) throws IOException
IOExceptionpublic static Reader getReader(String fileName, Charset charset) throws IOException
IOExceptionpublic static String dumpConfiguration(org.apache.commons.configuration2.Configuration configuration)
configuration - a configuration.public static Object searchConfigurationValueByAttributeValue(org.openksavi.sponge.config.Configuration root, String parentKey, String attrName, String attrValue)
public static void executeConcurrentlyOnce(org.openksavi.sponge.engine.Engine engine,
Runnable runnable)
public static String createGlobalLoggerName(org.openksavi.sponge.kb.KnowledgeBaseEngineOperations knowledgeBaseEngineOperations)
public static String createPluginLoggerName()
public static String createLoggerName(org.openksavi.sponge.kb.KnowledgeBase knowledgeBase, String targetName)
public static void shutdownExecutorService(org.openksavi.sponge.engine.Engine engine,
Object named,
ExecutorService executorService)
public static org.openksavi.sponge.kb.ScriptKnowledgeBaseInterpreter getScriptInterpreter(org.openksavi.sponge.engine.Engine engine,
String kbName)
public static org.openksavi.sponge.kb.KnowledgeBaseEngineOperations getEps(org.openksavi.sponge.kb.KnowledgeBaseInterpreter interpreter)
public static String getAbbreviatedEventSequenceString(BaseRule rule)
public static org.openksavi.sponge.SpongeException wrapException(String sourceName, Throwable throwable)
sourceName - source name of the exception.throwable - source throwable.public static String toStringEventSequence(Collection<org.openksavi.sponge.event.Event> events)
public static String toStringEventSequence(Collection<org.openksavi.sponge.event.Event> events, String attributeName)
public static String toStringArrayEventSequence(Collection<org.openksavi.sponge.event.Event> events, String attributeName)
public static String createControlEventName(Class<? extends org.openksavi.sponge.event.ControlEvent> controlEventClass)
public static int calculateInitialDynamicThreadPoolSize(org.openksavi.sponge.engine.Engine engine,
int maxPoolSize)
public static <K,V> Map<K,V> immutableMapOf(K k1, V v1)
public static <K,V> Map<K,V> immutableMapOf(K k1, V v1, K k2, V v2)
public static <K,V> Map<K,V> immutableMapOf(K k1, V v1, K k2, V v2, K k3, V v3)
public static <K,V> Map<K,V> immutableMapOf(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
public static <K,V> Map<K,V> immutableMapOf(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
public static void close(InputStream stream)
public static void close(OutputStream stream)
Copyright © 2016–2017 Softelnet. All rights reserved.