Search in sources :

Example 6 with Space

use of org.jpos.space.Space in project jPOS by jpos.

the class IncomingListener method setConfiguration.

@SuppressWarnings("unchecked")
public void setConfiguration(Configuration cfg) throws ConfigurationException {
    timeout = cfg.getLong("timeout", 15000L);
    sp = (Space<String, Context>) SpaceFactory.getSpace(cfg.get("space"));
    queue = cfg.get("queue", null);
    if (queue == null)
        throw new ConfigurationException("queue property not specified");
    source = cfg.get("source", ContextConstants.SOURCE.toString());
    request = cfg.get("request", ContextConstants.REQUEST.toString());
    timestamp = cfg.get("timestamp", ContextConstants.TIMESTAMP.toString());
    remote = cfg.getBoolean("remote") || cfg.get("space").startsWith("rspace:");
    Map<String, String> m = new HashMap<>();
    cfg.keySet().stream().filter(s -> s.startsWith("ctx.")).forEach(s -> m.put(s.substring(4), cfg.get(s)));
    if (m.size() > 0)
        additionalContextEntries = m;
}
Also used : Context(org.jpos.transaction.Context) Context(org.jpos.transaction.Context) SpaceFactory(org.jpos.space.SpaceFactory) ConfigurationException(org.jpos.core.ConfigurationException) Date(java.util.Date) SpaceSource(org.jpos.space.SpaceSource) LocalSpace(org.jpos.space.LocalSpace) Log(org.jpos.util.Log) HashMap(java.util.HashMap) Configurable(org.jpos.core.Configurable) ContextConstants(org.jpos.transaction.ContextConstants) Space(org.jpos.space.Space) Configuration(org.jpos.core.Configuration) Map(java.util.Map) ConfigurationException(org.jpos.core.ConfigurationException) HashMap(java.util.HashMap)

Aggregations

Space (org.jpos.space.Space)6 ConfigurationException (org.jpos.core.ConfigurationException)2 LocalSpace (org.jpos.space.LocalSpace)2 TSpace (org.jpos.space.TSpace)2 Ignore (org.junit.Ignore)2 Test (org.junit.Test)2 Field (java.lang.reflect.Field)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Element (org.jdom2.Element)1 Configurable (org.jpos.core.Configurable)1 Configuration (org.jpos.core.Configuration)1 ISOMsg (org.jpos.iso.ISOMsg)1 SpaceFactory (org.jpos.space.SpaceFactory)1 SpaceSource (org.jpos.space.SpaceSource)1 Context (org.jpos.transaction.Context)1 ContextConstants (org.jpos.transaction.ContextConstants)1 Log (org.jpos.util.Log)1