@Test public void testInitServiceThrowsNullPointerException() throws Throwable { try { transactionManager.initService(); 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.get(String, String)\" because \"this.cfg\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(transactionManager.queue, "transactionManager.queue"); assertNull(transactionManager.getConfiguration(), "transactionManager.getConfiguration()"); assertEquals(0L, transactionManager.tail, "transactionManager.tail"); assertTrue(transactionManager.isModified(), "transactionManager.isModified()"); assertNull(transactionManager.sp, "transactionManager.sp"); assertNull(transactionManager.psp, "transactionManager.psp"); assertEquals(0L, transactionManager.head, "transactionManager.head"); assertNull(transactionManager.groups, "transactionManager.groups"); assertNull(transactionManager.tailLock, "transactionManager.tailLock"); } }
@Override public void initService () throws ConfigurationException { queue = cfg.get ("queue", null); if (queue == null) throw new ConfigurationException ("queue property not specified"); sp = SpaceFactory.getSpace (cfg.get ("space")); isp = SpaceFactory.getSpace (cfg.get ("input-space", cfg.get ("space"))); if (isp == sp) iisp = isp; else { iisp = sp; } psp = SpaceFactory.getSpace (cfg.get ("persistent-space", this.toString())); tail = initCounter (TAIL, cfg.getLong ("initial-tail", 1)); head = Math.max (initCounter (HEAD, tail), tail); initTailLock (); groups = new HashMap<>(); initParticipants (getPersist()); initStatusListeners (getPersist()); }
TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { @Override public void initService () throws ConfigurationException { queue = cfg.get ("queue", null); if (queue == null) throw new ConfigurationException ("queue property not specified"); sp = SpaceFactory.getSpace (cfg.get ("space")); isp = SpaceFactory.getSpace (cfg.get ("input-space", cfg.get ("space"))); if (isp == sp) iisp = isp; else { iisp = sp; } psp = SpaceFactory.getSpace (cfg.get ("persistent-space", this.toString())); tail = initCounter (TAIL, cfg.getLong ("initial-tail", 1)); head = Math.max (initCounter (HEAD, tail), tail); initTailLock (); groups = new HashMap<>(); initParticipants (getPersist()); initStatusListeners (getPersist()); } }
TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { @Override public void initService () throws ConfigurationException { queue = cfg.get ("queue", null); if (queue == null) throw new ConfigurationException ("queue property not specified"); sp = SpaceFactory.getSpace (cfg.get ("space")); isp = SpaceFactory.getSpace (cfg.get ("input-space", cfg.get ("space"))); if (isp == sp) iisp = isp; else { iisp = sp; } psp = SpaceFactory.getSpace (cfg.get ("persistent-space", this.toString())); tail = initCounter (TAIL, cfg.getLong ("initial-tail", 1)); head = Math.max (initCounter (HEAD, tail), tail); initTailLock (); groups = new HashMap<>(); initParticipants (getPersist()); initStatusListeners (getPersist()); }  }
TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { @Override public void initService () throws ConfigurationException { queue = cfg.get ("queue", null); if (queue == null) throw new ConfigurationException ("queue property not specified"); sp = SpaceFactory.getSpace (cfg.get ("space")); isp = SpaceFactory.getSpace (cfg.get ("input-space", cfg.get ("space"))); if (isp == sp) iisp = isp; else { iisp = sp; } psp = SpaceFactory.getSpace (cfg.get ("persistent-space", this.toString())); tail = initCounter (TAIL, cfg.getLong ("initial-tail", 1)); head = Math.max (initCounter (HEAD, tail), tail); initTailLock (); groups = new HashMap<>(); initParticipants (getPersist()); initStatusListeners (getPersist()); }  @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 initService () throws ConfigurationException { queue = cfg.get ("queue", null); if (queue == null) throw new ConfigurationException ("queue property not specified"); sp = SpaceFactory.getSpace (cfg.get ("space")); isp = SpaceFactory.getSpace (cfg.get ("input-space", cfg.get ("space"))); if (isp == sp) iisp = isp; else { iisp = sp; } psp = SpaceFactory.getSpace (cfg.get ("persistent-space", this.toString())); tail = initCounter (TAIL, cfg.getLong ("initial-tail", 1)); head = Math.max (initCounter (HEAD, tail), tail); initTailLock (); groups = new HashMap<>(); initParticipants (getPersist()); initStatusListeners (getPersist()); }  @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; }