@Test public void testSetConfigurationThrowsNullPointerException() throws Throwable { Configuration cfg = new SubConfiguration(); try { transactionManager.setConfiguration(cfg); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.core.Configuration.getBoolean(String, boolean)\" because \"this.cfg\" is null", ex.getMessage(), "ex.getMessage()"); } assertFalse(transactionManager.debug, "transactionManager.debug"); assertSame(cfg, transactionManager.getConfiguration(), "transactionManager.getConfiguration()"); assertEquals(0L, transactionManager.pauseTimeout, "transactionManager.pauseTimeout"); assertEquals(5000L, transactionManager.retryInterval, "transactionManager.retryInterval"); } }
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration (cfg); debug = cfg.getBoolean ("debug", true); debugContext = cfg.getBoolean ("debug-context", debug); profiler = cfg.getBoolean ("profiler", debug); if (profiler || debugContext) debug = true; doRecover = cfg.getBoolean ("recover", true); retryInterval = cfg.getLong ("retry-interval", retryInterval); retryTimeout = cfg.getLong ("retry-timeout", retryTimeout); pauseTimeout = cfg.getLong ("pause-timeout", pauseTimeout); abortOnPauseTimeout = cfg.getBoolean("abort-on-pause-timeout", true); maxActiveSessions = cfg.getInt ("max-active-sessions", 0); sessions = cfg.getInt ("sessions", 1); threshold = cfg.getInt ("threshold", sessions / 2); maxSessions = cfg.getInt ("max-sessions", sessions); if (maxSessions < sessions) throw new ConfigurationException("max-sessions < sessions"); if (maxActiveSessions > 0) { if (maxActiveSessions < sessions) throw new ConfigurationException("max-active-sessions < sessions"); if (maxActiveSessions < maxSessions) throw new ConfigurationException("max-active-sessions < max-sessions"); } callSelectorOnAbort = cfg.getBoolean("call-selector-on-abort", true); if (profiler) metrics = new Metrics(new AtomicHistogram(cfg.getLong("metrics-highest-trackable-value", 60000), 2)); }
TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration (cfg); debug = cfg.getBoolean ("debug", true); debugContext = cfg.getBoolean ("debug-context", debug); profiler = cfg.getBoolean ("profiler", debug); if (profiler || debugContext) debug = true; doRecover = cfg.getBoolean ("recover", true); retryInterval = cfg.getLong ("retry-interval", retryInterval); retryTimeout = cfg.getLong ("retry-timeout", retryTimeout); pauseTimeout = cfg.getLong ("pause-timeout", pauseTimeout); abortOnPauseTimeout = cfg.getBoolean("abort-on-pause-timeout", true); maxActiveSessions = cfg.getInt ("max-active-sessions", 0); sessions = cfg.getInt ("sessions", 1); threshold = cfg.getInt ("threshold", sessions / 2); maxSessions = cfg.getInt ("max-sessions", sessions); if (maxSessions < sessions) throw new ConfigurationException("max-sessions < sessions"); if (maxActiveSessions > 0) { if (maxActiveSessions < sessions) throw new ConfigurationException("max-active-sessions < sessions"); if (maxActiveSessions < maxSessions) throw new ConfigurationException("max-active-sessions < max-sessions"); } callSelectorOnAbort = cfg.getBoolean("call-selector-on-abort", true); if (profiler) metrics = new Metrics(new AtomicHistogram(cfg.getLong("metrics-highest-trackable-value", 60000), 2)); } }
TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration (cfg); debug = cfg.getBoolean ("debug", true); debugContext = cfg.getBoolean ("debug-context", debug); profiler = cfg.getBoolean ("profiler", debug); if (profiler || debugContext) debug = true; doRecover = cfg.getBoolean ("recover", true); retryInterval = cfg.getLong ("retry-interval", retryInterval); retryTimeout = cfg.getLong ("retry-timeout", retryTimeout); pauseTimeout = cfg.getLong ("pause-timeout", pauseTimeout); abortOnPauseTimeout = cfg.getBoolean("abort-on-pause-timeout", true); maxActiveSessions = cfg.getInt ("max-active-sessions", 0); sessions = cfg.getInt ("sessions", 1); threshold = cfg.getInt ("threshold", sessions / 2); maxSessions = cfg.getInt ("max-sessions", sessions); if (maxSessions < sessions) throw new ConfigurationException("max-sessions < sessions"); if (maxActiveSessions > 0) { if (maxActiveSessions < sessions) throw new ConfigurationException("max-active-sessions < sessions"); if (maxActiveSessions < maxSessions) throw new ConfigurationException("max-active-sessions < max-sessions"); } callSelectorOnAbort = cfg.getBoolean("call-selector-on-abort", true); if (profiler) metrics = new Metrics(new AtomicHistogram(cfg.getLong("metrics-highest-trackable-value", 60000), 2)); }  }
TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration (cfg); debug = cfg.getBoolean ("debug", true); debugContext = cfg.getBoolean ("debug-context", debug); profiler = cfg.getBoolean ("profiler", debug); if (profiler || debugContext) debug = true; doRecover = cfg.getBoolean ("recover", true); retryInterval = cfg.getLong ("retry-interval", retryInterval); retryTimeout = cfg.getLong ("retry-timeout", retryTimeout); pauseTimeout = cfg.getLong ("pause-timeout", pauseTimeout); abortOnPauseTimeout = cfg.getBoolean("abort-on-pause-timeout", true); maxActiveSessions = cfg.getInt ("max-active-sessions", 0); sessions = cfg.getInt ("sessions", 1); threshold = cfg.getInt ("threshold", sessions / 2); maxSessions = cfg.getInt ("max-sessions", sessions); if (maxSessions < sessions) throw new ConfigurationException("max-sessions < sessions"); if (maxActiveSessions > 0) { if (maxActiveSessions < sessions) throw new ConfigurationException("max-active-sessions < sessions"); if (maxActiveSessions < maxSessions) throw new ConfigurationException("max-active-sessions < max-sessions"); } callSelectorOnAbort = cfg.getBoolean("call-selector-on-abort", true); if (profiler) metrics = new Metrics(new AtomicHistogram(cfg.getLong("metrics-highest-trackable-value", 60000), 2)); }  @Override void initService(); @Override void startService(); @Override void stopService(); void queue(Serializable context); void push(Serializable context); @SuppressWarnings("unused") String getQueueName(); Space getSpace(); Space getInputSpace(); Space getPersistentSpace(); @Override void run(); @Override long getTail(); @Override long getHead(); long getInTransit(); @Override void setConfiguration(Configuration cfg); void addListener(TransactionStatusListener l); void removeListener(TransactionStatusListener l); TPS getTPS(); @Override String getTPSAsString(); @Override float getTPSAvg(); @Override int getTPSPeak(); @Override Date getTPSPeakWhen(); @Override long getTPSElapsed(); @Override void resetTPS(); @Override Metrics getMetrics(); @Override void dump(PrintStream ps, String indent); TransactionParticipant createParticipant(Element e); @Override int getOutstandingTransactions(); @Override void setDebug(boolean debug); @Override boolean getDebugContext(); @Override void setDebugContext(boolean debugContext); @Override boolean getDebug(); @Override int getActiveSessions(); int getPausedCounter(); int getActiveTransactions(); int getMaxSessions(); static Serializable getSerializable(); static T getContext(); static Long getId(); }
TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration (cfg); debug = cfg.getBoolean ("debug", true); debugContext = cfg.getBoolean ("debug-context", debug); profiler = cfg.getBoolean ("profiler", debug); if (profiler || debugContext) debug = true; doRecover = cfg.getBoolean ("recover", true); retryInterval = cfg.getLong ("retry-interval", retryInterval); retryTimeout = cfg.getLong ("retry-timeout", retryTimeout); pauseTimeout = cfg.getLong ("pause-timeout", pauseTimeout); abortOnPauseTimeout = cfg.getBoolean("abort-on-pause-timeout", true); maxActiveSessions = cfg.getInt ("max-active-sessions", 0); sessions = cfg.getInt ("sessions", 1); threshold = cfg.getInt ("threshold", sessions / 2); maxSessions = cfg.getInt ("max-sessions", sessions); if (maxSessions < sessions) throw new ConfigurationException("max-sessions < sessions"); if (maxActiveSessions > 0) { if (maxActiveSessions < sessions) throw new ConfigurationException("max-active-sessions < sessions"); if (maxActiveSessions < maxSessions) throw new ConfigurationException("max-active-sessions < max-sessions"); } callSelectorOnAbort = cfg.getBoolean("call-selector-on-abort", true); if (profiler) metrics = new Metrics(new AtomicHistogram(cfg.getLong("metrics-highest-trackable-value", 60000), 2)); }  @Override void initService(); @Override void startService(); @Override void stopService(); void queue(Serializable context); void push(Serializable context); @SuppressWarnings("unused") String getQueueName(); Space getSpace(); Space getInputSpace(); Space getPersistentSpace(); @Override void run(); @Override long getTail(); @Override long getHead(); long getInTransit(); @Override void setConfiguration(Configuration cfg); void addListener(TransactionStatusListener l); void removeListener(TransactionStatusListener l); TPS getTPS(); @Override String getTPSAsString(); @Override float getTPSAvg(); @Override int getTPSPeak(); @Override Date getTPSPeakWhen(); @Override long getTPSElapsed(); @Override void resetTPS(); @Override Metrics getMetrics(); @Override void dump(PrintStream ps, String indent); TransactionParticipant createParticipant(Element e); @Override int getOutstandingTransactions(); @Override void setDebug(boolean debug); @Override boolean getDebugContext(); @Override void setDebugContext(boolean debugContext); @Override boolean getDebug(); @Override int getActiveSessions(); int getPausedCounter(); int getActiveTransactions(); int getMaxSessions(); static Serializable getSerializable(); static T getContext(); static Long getId(); static final String HEAD; static final String TAIL; static final String CONTEXT; static final String STATE; static final String GROUPS; static final String TAILLOCK; static final String RETRY_QUEUE; static final Integer PREPARING; static final Integer COMMITTING; static final Integer DONE; static final String DEFAULT_GROUP; static final long MAX_PARTICIPANTS; static final long MAX_WAIT; static final long TIMER_PURGE_INTERVAL; }