public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; keyStore = cfg.get("keystore"); clientAuthNeeded = cfg.getBoolean("clientauth"); serverAuthNeeded = cfg.getBoolean("serverauth"); serverName = cfg.get("servername"); password = cfg.get("storepassword", null); keyPassword = cfg.get("keypassword", null); enabledCipherSuites = cfg.getAll("addEnabledCipherSuite"); enabledProtocols = cfg.getAll("addEnabledProtocol"); } public Configuration getConfiguration() {
public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; timeout = cfg.getLong ("timeout", DEFAULT_TIMEOUT); waitTimeout = cfg.getLong ("wait-timeout", DEFAULT_WAIT_TIMEOUT); requestName = cfg.get ("request", ContextConstants.REQUEST.toString()); responseName = cfg.get ("response", ContextConstants.RESPONSE.toString()); destination = cfg.get ("destination", ContextConstants.DESTINATION.toString()); continuations = cfg.getBoolean("continuations", true); ignoreUnreachable = cfg.getBoolean("ignore-host-unreachable", false); }
public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; try { mux = (SpaceMUX) NameRegistrar.get (cfg.get ("mux")); } catch (NotFoundException e) { throw new ConfigurationException (e); } timeout = cfg.getLong ("timeout", 120000); pool = new ThreadPool (1, cfg.getInt ("pool", 100)); }
public void setConfiguration (Configuration cfg) { this.cfg = cfg; request = cfg.get ("request", ContextConstants.REQUEST.toString()); ignoreCardValidation = cfg.getBoolean("ignore-card-validation", false); }
public void setConfiguration(Configuration cfg) throws ConfigurationException { maxSize = cfg.getInt ("size", DEFAULT_SIZE); if (name != null) NameRegistrar.unregister (name); name = cfg.get ("name", null); if (name != null) NameRegistrar.register (name, this); } public void addListener (final LogListener listener) {
private String get (String prop) throws ConfigurationException { String value = cfg.get (prop); if (value == null) throw new ConfigurationException ("null property "+prop); return value; } }
public int prepare (long id, Serializable o) { if (o instanceof Context) ((Context)o).checkPoint (cfg.get ("message", "checkpoint")); return PREPARED | NO_JOIN | READONLY; } public void commit (long id, Serializable o) { }
public void setConfiguration (Configuration cfg) { this.cfg = cfg; txnNameEntry = cfg.get("txnname", TXNNAME.toString()); } }
public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; try { InitialContext ctx = new InitialContext (); ctx.rebind (cfg.get ("name"), stub); } catch (NamingException e) { throw new ConfigurationException (e); } } public Set getKeySet () {
protected boolean isLevelEnabled(int logLevel) { Logger logger = log.getLogger(); Configuration cfg = logger.getConfiguration(); if (cfg == null) cfg = new SimpleConfiguration(); String levelString = cfg.get("slf4j.level", System.getProperty("slf4j.level")); int currentLogLevel = levelString != null ? stringToLevel(levelString) : DEFAULT_LOG_LEVEL; return (logLevel >= currentLogLevel); }
@Override public RC convert(IRC irc) { String s = cfg != null ? cfg.get(Long.toString(irc.irc()), null) : null; if (s != null) { return buildRC(s); } else if (rcs.containsKey(irc.irc())) return rcs.get(irc.irc()); s = irc.irc() > 9999 ? Long.toString(irc.irc()) : ISOUtil.zeropad(irc.irc(),4); return new SimpleRC(s, (irc instanceof CMF ? ((CMF)irc).name().replace("_", " ") : null)); }
@Before public void setUp() throws Exception { trace = new Trace(); given(configuration.get("trace", "org.jpos.transaction.participant.Trace")).willReturn("XXXtestXXX"); trace.setConfiguration(configuration); }
@Before public void setUp() throws Exception { hasEntry = new HasEntry(); given(configuration.get("name")).willReturn("XYZtest"); hasEntry.setConfiguration(configuration); }
@Test public void testSelect() { // given given(context.get("XYZtest")).willReturn("someStuffs"); given(configuration.get("yes", "UNKNOWN")).willReturn("someStuffs"); // when String result = hasEntry.select(2L, context); // then assertThat(result, is("someStuffs")); }
@Test public void testSelectNo() { // given given(context.get("XYZtest")).willReturn(null); given(configuration.get("no", "UNKNOWN")).willReturn("differentStuffs"); // when String result = hasEntry.select(3L, context); // then assertThat(result, is("differentStuffs")); } }