method2testcases
stringlengths
118
6.63k
### Question: TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { protected void initTailLock () { tailLock = TAILLOCK + "." + Integer.toString (this.hashCode()); sp.put (tailLock, TAILLOCK); } @Override void initService(); @Override ...
### Question: TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { protected long nextId () { long h; synchronized (psp) { commitOff (psp); psp.in (HEAD); h = head; psp.out (HEAD, ++head); commitOn (psp); } return h; } @Override void i...
### Question: TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { protected int prepareForAbort (TransactionParticipant p, long id, Serializable context) { Chronometer c = new Chronometer(); try { if (p instanceof AbortParticipant) { s...
### Question: SystemMonitor extends QBeanSupport implements Runnable, SystemMonitorMBean, Loggeable { public synchronized void setDetailRequired(boolean detail) { this.detailRequired = detail; setModified(true); if (me != null) me.interrupt(); } void startService(); void stopService(); synchronized void setSleepTime(l...
### Question: TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { protected void purge (long id, boolean full) { String stateKey = getKey (STATE, id); String contextKey = getKey (CONTEXT, id); String groupsKey = getKey (GROUPS, id); sy...
### Question: TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { protected void recover () { if (doRecover) { if (tail < head) { getLog().info ("recover - tail=" +tail+", head="+head); } while (tail < head) { recover (0, tail++); } } ...
### Question: SystemMonitor extends QBeanSupport implements Runnable, SystemMonitorMBean, Loggeable { public synchronized void setSleepTime(long sleepTime) { this.sleepTime = sleepTime; setModified(true); if (me != null) me.interrupt(); } void startService(); void stopService(); synchronized void setSleepTime(long sle...
### Question: TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { protected void setState (long id, Integer state) { String stateKey = getKey (STATE, id); synchronized (psp) { commitOff (psp); SpaceUtil.wipe(psp, stateKey); if (state!=...
### Question: TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { protected void snapshot (long id, Serializable context) { snapshot (id, context, null); } @Override void initService(); @Override void startService(); @Override void st...
### Question: TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { @Override public void startService () throws Exception { NameRegistrar.register(getName(), this); recover(); threads = Collections.synchronizedList(new ArrayList(maxSess...
### Question: TransactionManager extends QBeanSupport implements Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider { protected boolean tailDone () { String stateKey = getKey(STATE, tail); if (DONE.equals (psp.rdp (stateKey))) { purge (tail, true); return true; } return false; } @Overr...
### Question: TransactionStatusEvent { public String toString() { return String.format("%02d %08d %s %s", session, id, state.toString(), info); } TransactionStatusEvent(int session, State state, long id, String info, Serializable context); String toString(); int getSession(); long getId(); String getInfo(); State getSt...
### Question: TransactionStatusEvent { public int getSession() { return session; } TransactionStatusEvent(int session, State state, long id, String info, Serializable context); String toString(); int getSession(); long getId(); String getInfo(); State getState(); String getStateAsString(); Serializable getContext(); }...
### Question: TransactionStatusEvent { public long getId() { return id; } TransactionStatusEvent(int session, State state, long id, String info, Serializable context); String toString(); int getSession(); long getId(); String getInfo(); State getState(); String getStateAsString(); Serializable getContext(); }### Answe...
### Question: TransactionStatusEvent { public String getInfo() { return info; } TransactionStatusEvent(int session, State state, long id, String info, Serializable context); String toString(); int getSession(); long getId(); String getInfo(); State getState(); String getStateAsString(); Serializable getContext(); }###...
### Question: TransactionStatusEvent { public State getState() { return state; } TransactionStatusEvent(int session, State state, long id, String info, Serializable context); String toString(); int getSession(); long getId(); String getInfo(); State getState(); String getStateAsString(); Serializable getContext(); }##...
### Question: SystemMonitor extends QBeanSupport implements Runnable, SystemMonitorMBean, Loggeable { void showThreadGroup(ThreadGroup g, PrintStream p, String indent) { if (g.getParent() != null) showThreadGroup(g.getParent(), p, indent + " "); else dumpThreads(g, p, indent + " "); } void startService(); void stopSer...
### Question: TransactionStatusEvent { public String getStateAsString () { return state.toString(); } TransactionStatusEvent(int session, State state, long id, String info, Serializable context); String toString(); int getSession(); long getId(); String getInfo(); State getState(); String getStateAsString(); Serializab...
### Question: TransactionStatusEvent { public Serializable getContext(){ return context; } TransactionStatusEvent(int session, State state, long id, String info, Serializable context); String toString(); int getSession(); long getId(); String getInfo(); State getState(); String getStateAsString(); Serializable getConte...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public void checkPoint (String detail) { getProfiler().checkPoint (detail); } Context(); void put(Object key, Object value); void put(Object key, Object value, boolean persist); void persist(Object key); void evict(Object key); T get(Obje...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public void dump (PrintStream p, String indent) { String inner = indent + " "; p.println (indent + "<context>"); dumpMap (p, inner); p.println (indent + "</context>"); } Context(); void put(Object key, Object value); void put(Object key, ...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public <T> T get(Object key) { @SuppressWarnings("unchecked") T obj = (T) getMap().get(key); return obj; } Context(); void put(Object key, Object value); void put(Object key, Object value, boolean persist); void persist(Object key); void ...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { synchronized public LogEvent getLogEvent () { LogEvent evt = get (LOGEVT.toString()); if (evt == null) { evt = new LogEvent (); evt.setNoArmor(true); put (LOGEVT.toString(), evt); } return evt; } Context(); void put(Object key, Object val...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public PausedTransaction getPausedTransaction() { return get (PAUSED_TRANSACTION.toString()); } Context(); void put(Object key, Object value); void put(Object key, Object value, boolean persist); void persist(Object key); void evict(Objec...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { synchronized public Profiler getProfiler () { Profiler prof = get (PROFILER.toString()); if (prof == null) { prof = new Profiler(); put (PROFILER.toString(), prof); } return prof; } Context(); void put(Object key, Object value); void put(...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public String getString (Object key) { Object obj = getMap().get (key); if (obj instanceof String) return (String) obj; else if (obj != null) return obj.toString(); return null; } Context(); void put(Object key, Object value); void put(Ob...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public void log (Object msg) { if (msg != getMap()) getLogEvent().addMessage (msg); } Context(); void put(Object key, Object value); void put(Object key, Object value, boolean persist); void persist(Object key); void evict(Object key); T ...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public void put (Object key, Object value) { if (trace) { getProfiler().checkPoint( String.format("%s='%s' [%s]", getKeyName(key), value, Caller.info(1)) ); } getMap().put (key, value); synchronized (this) { notifyAll(); } } Context(); vo...
### Question: QExec extends QBeanSupport implements QExecMBean { public String getShutdownScript () { return shutdownScript; } void setStartScript(String scriptPath); String getStartScript(); void setShutdownScript(String scriptPath); String getShutdownScript(); }### Answer: @Test public void testGetShutdownScript() ...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public void readExternal (ObjectInput in) throws IOException, ClassNotFoundException { in.readByte(); getMap(); getPMap(); int size = in.readInt(); for (int i=0; i<size; i++) { String k = (String) in.readObject(); Object v = in.readObject...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public synchronized <T> T remove(Object key) { getPMap().remove(key); @SuppressWarnings("unchecked") T obj = (T) getMap().remove(key); return obj; } Context(); void put(Object key, Object value); void put(Object key, Object value, boolean...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public void writeExternal (ObjectOutput out) throws IOException { out.writeByte (0); Set s = getPMap().entrySet(); out.writeInt (s.size()); Iterator iter = s.iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); ...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { public void persist (Object key) { Object value = get(key); if (value instanceof Serializable) getPMap().put (key, value); } Context(); void put(Object key, Object value); void put(Object key, Object value, boolean persist); void persist(...
### Question: Context implements Externalizable, Loggeable, Pausable, Cloneable { @Override public Context clone() { try { Context context = (Context) super.clone(); if (map != null) { context.map = Collections.synchronizedMap (new LinkedHashMap<>()); context.map.putAll(map); } if (pmap != null) { context.pmap = Collec...
### Question: QExec extends QBeanSupport implements QExecMBean { public String getStartScript () { return startScript; } void setStartScript(String scriptPath); String getStartScript(); void setShutdownScript(String scriptPath); String getShutdownScript(); }### Answer: @Test public void testGetStartScript() throws Th...
### Question: HasEntry implements GroupSelector, Configurable { public int prepare (long id, Serializable o) { return PREPARED | NO_JOIN | READONLY; } int prepare(long id, Serializable o); String select(long id, Serializable ser); void commit(long id, Serializable o); void abort(long id, Serializable o); void setConfi...
### Question: HasEntry implements GroupSelector, Configurable { public String select (long id, Serializable ser) { Context ctx = (Context) ser; String name = cfg.get ("name"); String action = ctx.get (name) != null ? YES : NO; return cfg.get (action, UNKNOWN); } int prepare(long id, Serializable o); String select(long...
### Question: Delay implements TransactionParticipant, Configurable { public void setConfiguration(Configuration cfg) throws ConfigurationException { prepareDelay = cfg.getLong ("prepare-delay"); commitDelay = cfg.getLong ("commit-delay"); abortDelay = cfg.getLong ("abort-delay"); random = cfg.getBoolean ("random") ? n...
### Question: Delay implements TransactionParticipant, Configurable { public int prepare(long id, Serializable context) { sleep (prepareDelay); return PREPARED; } int prepare(long id, Serializable context); void commit(long id, Serializable context); void abort(long id, Serializable context); void setConfiguration(Con...
### Question: Delay implements TransactionParticipant, Configurable { void sleep (long delay) { if (delay > 0L) { try { Thread.sleep (random != null ? (long)random.nextDouble()*delay : delay); } catch (InterruptedException ignored) { } } } int prepare(long id, Serializable context); void commit(long id, Serializable c...
### Question: QExec extends QBeanSupport implements QExecMBean { public void setShutdownScript (String scriptPath) { shutdownScript = scriptPath; } void setStartScript(String scriptPath); String getStartScript(); void setShutdownScript(String scriptPath); String getShutdownScript(); }### Answer: @Test public void tes...
### Question: QExec extends QBeanSupport implements QExecMBean { public void setStartScript (String scriptPath) { startScript = scriptPath; } void setStartScript(String scriptPath); String getStartScript(); void setShutdownScript(String scriptPath); String getShutdownScript(); }### Answer: @Test public void testSetSt...
### Question: BSHMethod { public static BSHMethod createBshMethod(Element e) throws IOException { if (e == null) { return null; } String file = QFactory.getAttributeValue(e, "file"); String bsh; if (file != null) { boolean cache = false; String cacheAtt = QFactory.getAttributeValue(e, "cache"); if (cacheAtt != null) { ...
### Question: BSHMethod { protected Interpreter initInterpreter(Map arguments) throws EvalError, IOException { Interpreter i = new Interpreter(); Map.Entry entry; for (Object o : arguments.entrySet()) { entry = (Map.Entry) o; i.set((String) entry.getKey(), entry.getValue()); } if (source) { i.source(bshData); } else { ...
### Question: BSHTransactionParticipant extends SimpleLogSource implements TransactionParticipant, AbortParticipant, XmlConfigurable { public void abort(long id, java.io.Serializable context) { LogEvent ev = new LogEvent(this, "abort"); if (abortMethod != null) { try { executeMethod(abortMethod, id, context, ev, ""); }...
### Question: BSHTransactionParticipant extends SimpleLogSource implements TransactionParticipant, AbortParticipant, XmlConfigurable { public void commit(long id, java.io.Serializable context) { LogEvent ev = new LogEvent(this, "commit"); if (commitMethod != null) { try { executeMethod(commitMethod, id, context, ev, ""...
### Question: BSHTransactionParticipant extends SimpleLogSource implements TransactionParticipant, AbortParticipant, XmlConfigurable { protected void defaultAbort(long id, Serializable context, LogEvent ev) {} BSHTransactionParticipant(); void abort(long id, java.io.Serializable context); void commit(long id, java.io.S...
### Question: BSHTransactionParticipant extends SimpleLogSource implements TransactionParticipant, AbortParticipant, XmlConfigurable { protected void defaultCommit(long id, Serializable context, LogEvent ev) {} BSHTransactionParticipant(); void abort(long id, java.io.Serializable context); void commit(long id, java.io....
### Question: BSHTransactionParticipant extends SimpleLogSource implements TransactionParticipant, AbortParticipant, XmlConfigurable { protected int defaultPrepare(long id, Serializable context, LogEvent ev) { return PREPARED | READONLY; } BSHTransactionParticipant(); void abort(long id, java.io.Serializable context); ...
### Question: BSHTransactionParticipant extends SimpleLogSource implements TransactionParticipant, AbortParticipant, XmlConfigurable { public int prepare(long id, java.io.Serializable context) { LogEvent ev = new LogEvent(this, "prepare"); int result = ABORTED | READONLY; if (prepareMethod != null) { try { result = (In...
### Question: BSHTransactionParticipant extends SimpleLogSource implements TransactionParticipant, AbortParticipant, XmlConfigurable { public int prepareForAbort(long id, java.io.Serializable context) { LogEvent ev = new LogEvent(this, "prepare-for-abort"); int result = ABORTED | READONLY; if (prepareForAbortMethod != ...
### Question: BSHTransactionParticipant extends SimpleLogSource implements TransactionParticipant, AbortParticipant, XmlConfigurable { public void setConfiguration(Element e) throws ConfigurationException { try { prepareMethod = BSHMethod.createBshMethod(e.getChild("prepare")); prepareForAbortMethod = BSHMethod.createB...
### Question: BSHGroupSelector extends BSHTransactionParticipant implements GroupSelector { public String defaultSelect(long id, Serializable context) { return ""; } void setConfiguration(Element e); String select(long id, java.io.Serializable context); String defaultSelect(long id, Serializable context); }### Answer...
### Question: BSHGroupSelector extends BSHTransactionParticipant implements GroupSelector { public String select(long id, java.io.Serializable context) { LogEvent ev = new LogEvent(this, "select"); String result = null; if (selectMethod != null) { try { result = (String) executeMethod(selectMethod, id, context, ev, "re...
### Question: BSHGroupSelector extends BSHTransactionParticipant implements GroupSelector { public void setConfiguration(Element e) throws ConfigurationException { super.setConfiguration(e); try { selectMethod = BSHMethod.createBshMethod(e.getChild("select")); } catch (Exception ex) { throw new ConfigurationException(e...
### Question: Trace implements AbortParticipant, Configurable { public int prepare (long id, Serializable o) { Context ctx = (Context) o; ctx.checkPoint ("prepare:" + trace); return PREPARED | READONLY; } int prepare(long id, Serializable o); void commit(long id, Serializable o); void abort(long id, Serializable o); i...
### Question: LoggerAdaptor extends QBeanSupport { protected void destroyService() { } }### Answer: @Test public void testDestroyService() throws Throwable { LoggerAdaptor loggerAdaptor = new LoggerAdaptor(); loggerAdaptor.destroyService(); assertTrue(true, "Test completed without Exception"); }
### Question: Trace implements AbortParticipant, Configurable { public void commit (long id, Serializable o) { Context ctx = (Context) o; ctx.checkPoint ("commit:" + trace); } int prepare(long id, Serializable o); void commit(long id, Serializable o); void abort(long id, Serializable o); int prepareForAbort(long id, S...
### Question: Trace implements AbortParticipant, Configurable { public void abort (long id, Serializable o) { Context ctx = (Context) o; ctx.checkPoint ("abort:" + trace); } int prepare(long id, Serializable o); void commit(long id, Serializable o); void abort(long id, Serializable o); int prepareForAbort(long id, Ser...
### Question: Trace implements AbortParticipant, Configurable { public int prepareForAbort (long id, Serializable o) { Context ctx = (Context) o; ctx.checkPoint ("prepareForAbort:" + trace); return PREPARED | READONLY; } int prepare(long id, Serializable o); void commit(long id, Serializable o); void abort(long id, Se...
### Question: JTabbedPaneFactory implements UIFactory, ChangeListener { public void stateChanged (ChangeEvent e) { try { String action[] = new String[2]; action = (String[]) actions.get(p.getSelectedIndex()); Object al = ui.get (action[1]); if (al instanceof ActionListener) { ActionEvent ae = new ActionEvent(this,0,act...
### Question: Redirect implements ActionListener, UIAware { public void actionPerformed (ActionEvent ev) { StringTokenizer st = new StringTokenizer (ev.getActionCommand ()); ui.reconfigure ( st.nextToken(), st.hasMoreTokens () ? st.nextToken () : null ); } Redirect(); void setUI(UI ui, Element e); void actionPerformed(...
### Question: Dispose implements ActionListener, UIAware { public void actionPerformed (ActionEvent ev) { ui.dispose (); } Dispose(); void setUI(UI ui, Element e); void actionPerformed(ActionEvent ev); public UI ui; }### Answer: @Test public void testActionPerformedThrowsNullPointerException() throws Throwable { Dispos...
### Question: Debug implements ActionListener { public void actionPerformed (ActionEvent ev) { System.out.println ("Action command: "+ev.getActionCommand ()); System.out.println (ev.toString ()); System.out.println (""); } Debug(); void actionPerformed(ActionEvent ev); }### Answer: @Test public void testActionPerforme...
### Question: SpaceLet extends QBeanSupport implements Space { public void initService() throws ConfigurationException { Element config = getPersist (); grabSpace (config.getChild ("space")); initSpace (config.getChild ("init")); String name = getName(); if ("spacelet".equals (name)) name = "default"; uri = "spacelet:"...
### Question: VolatileSequencer implements Sequencer, VolatileSequencerMBean { synchronized public int get (String counterName, int add) { int i = 0; Integer I = (Integer) map.get (counterName); if (I != null) i = I; i += add; map.put (counterName, i); return i; } VolatileSequencer(); synchronized int get(String counte...
### Question: VolatileSequencer implements Sequencer, VolatileSequencerMBean { public String[] getCounterNames () { Object[] o = map.keySet().toArray(); String[] s = new String [o.length]; System.arraycopy (o, 0, s, 0, o.length); return s; } VolatileSequencer(); synchronized int get(String counterName, int add); int ge...
### Question: VolatileSequencer implements Sequencer, VolatileSequencerMBean { synchronized public int set (String counterName, int newValue) { int oldValue = 0; Integer I = (Integer) map.get (counterName); if (I != null) oldValue = I; map.put (counterName, newValue); return oldValue; } VolatileSequencer(); synchronize...
### Question: Card { private Card() { } private Card(); Card(Builder builder); String getPan(); BigInteger getPanAsNumber(); String getExp(); String getCvv2(); String getServiceCode(); boolean hasTrack1(); boolean hasTrack2(); boolean hasBothTracks(); String getBin(); @Override String toString(); @Override boolean eq...
### Question: SpaceLet extends QBeanSupport implements Space { public Object inp (Object key) { try { Interpreter bsh = initInterpreter (key); bsh.set ("probe", true); synchronized (sp) { if (eval (bsh, inScript, inSource)) { return bsh.get ("value"); } else { return sp.inp (key); } } } catch (Throwable t) { throw new ...
### Question: Card { public static Builder builder() { return new Builder(); } private Card(); Card(Builder builder); String getPan(); BigInteger getPanAsNumber(); String getExp(); String getCvv2(); String getServiceCode(); boolean hasTrack1(); boolean hasTrack2(); boolean hasBothTracks(); String getBin(); @Override ...
### Question: SimpleConfiguration implements Configuration, Serializable { public String get (String name, String def) { Object obj = props.get (name); if (obj instanceof String[]) { String[] arr= (String[]) obj; obj = arr.length > 0 ? arr[0] : null; } else if (obj instanceof List) { List l = (List) obj; obj = l.size()...
### Question: SimpleConfiguration implements Configuration, Serializable { public String[] getAll (String name) { String[] ret; Object obj = props.get (name); if (obj instanceof String[]) { ret = (String[]) obj; } else if (obj instanceof String) { ret = new String[1]; ret[0] = (String) obj; } else ret = new String[0]; ...
### Question: SimpleConfiguration implements Configuration, Serializable { public boolean getBoolean (String name) { String v = get (name, "false").trim(); return v.equalsIgnoreCase("true") || v.equalsIgnoreCase("yes"); } SimpleConfiguration(); SimpleConfiguration(Properties props); SimpleConfiguration(String filenam...
### Question: SimpleConfiguration implements Configuration, Serializable { public double getDouble(String name) { return Double.valueOf(get(name, "0.00").trim()); } SimpleConfiguration(); SimpleConfiguration(Properties props); SimpleConfiguration(String filename); String get(String name, String def); String[] getAll(...
### Question: SimpleConfiguration implements Configuration, Serializable { public int getInt (String name) { return Integer.parseInt(get(name, "0").trim()); } SimpleConfiguration(); SimpleConfiguration(Properties props); SimpleConfiguration(String filename); String get(String name, String def); String[] getAll(String...
### Question: SpaceLet extends QBeanSupport implements Space { public Object in (Object key) { try { Interpreter bsh = initInterpreter (key); synchronized (sp) { if (eval (bsh, inScript, inSource)) { return bsh.get ("value"); } else { return sp.in (key); } } } catch (Throwable t) { throw new SpaceError (t); } } void i...
### Question: SimpleConfiguration implements Configuration, Serializable { public long getLong (String name) { return Long.parseLong(get(name, "0").trim()); } SimpleConfiguration(); SimpleConfiguration(Properties props); SimpleConfiguration(String filename); String get(String name, String def); String[] getAll(String...
### Question: SimpleConfiguration implements Configuration, Serializable { public void load(String filename) throws IOException { FileInputStream fis = new FileInputStream(filename); props.load(new BufferedInputStream(fis)); fis.close(); } SimpleConfiguration(); SimpleConfiguration(Properties props); SimpleConfigurat...
### Question: SimpleConfiguration implements Configuration, Serializable { public synchronized void put (String name, Object value) { props.put (name, value); } SimpleConfiguration(); SimpleConfiguration(Properties props); SimpleConfiguration(String filename); String get(String name, String def); String[] getAll(Stri...
### Question: SubConfiguration implements Configuration { public String get(String propertyName){ return cfg.get(prefix + propertyName); } SubConfiguration(); SubConfiguration(Configuration cfg, String prefix); void setConfiguration(Configuration newCfg); void setPrefix(String newPrefix); String get(String propertyNam...
### Question: SubConfiguration implements Configuration { public String[] getAll(String propertyName){ return cfg.getAll(prefix + propertyName); } SubConfiguration(); SubConfiguration(Configuration cfg, String prefix); void setConfiguration(Configuration newCfg); void setPrefix(String newPrefix); String get(String pro...
### Question: SubConfiguration implements Configuration { public boolean getBoolean(String propertyName){ return cfg.getBoolean(prefix + propertyName); } SubConfiguration(); SubConfiguration(Configuration cfg, String prefix); void setConfiguration(Configuration newCfg); void setPrefix(String newPrefix); String get(Str...
### Question: SpaceLet extends QBeanSupport implements Space { public void out (Object key, Object value) { try { Interpreter bsh = initInterpreter (key, value); synchronized (sp) { if (!eval (bsh, outScript, outSource)) sp.out (key, value); } } catch (Throwable t) { throw new SpaceError (t); } } void initService(); v...
### Question: SubConfiguration implements Configuration { public double getDouble(String propertyName){ return cfg.getDouble(prefix + propertyName); } SubConfiguration(); SubConfiguration(Configuration cfg, String prefix); void setConfiguration(Configuration newCfg); void setPrefix(String newPrefix); String get(String...
### Question: SubConfiguration implements Configuration { public int getInt(String propertyName){ return cfg.getInt(prefix + propertyName); } SubConfiguration(); SubConfiguration(Configuration cfg, String prefix); void setConfiguration(Configuration newCfg); void setPrefix(String newPrefix); String get(String property...
### Question: SubConfiguration implements Configuration { public long getLong(String propertyName){ return cfg.getLong(prefix + propertyName); } SubConfiguration(); SubConfiguration(Configuration cfg, String prefix); void setConfiguration(Configuration newCfg); void setPrefix(String newPrefix); String get(String prope...
### Question: SubConfiguration implements Configuration { public Object getObject (String propertyName) throws ConfigurationException{ try{ Object ret = Class.forName (get (propertyName)).newInstance(); if(ret instanceof Configurable) ((Configurable)ret).setConfiguration(this); return ret; } catch (Exception e){ throw ...
### Question: SubConfiguration implements Configuration { public void put (String name, Object value) { cfg.put(prefix + name, value); } SubConfiguration(); SubConfiguration(Configuration cfg, String prefix); void setConfiguration(Configuration newCfg); void setPrefix(String newPrefix); String get(String propertyName)...
### Question: SpaceLet extends QBeanSupport implements Space { public Object rdp (Object key) { try { Interpreter bsh = initInterpreter (key); bsh.set ("probe", true); synchronized (sp) { if (eval (bsh, rdScript, rdSource)) { return bsh.get ("value"); } else { return sp.rdp (key); } } } catch (Throwable t) { throw new ...
### Question: SubConfiguration implements Configuration { public void setConfiguration(Configuration newCfg){ cfg=newCfg; } SubConfiguration(); SubConfiguration(Configuration cfg, String prefix); void setConfiguration(Configuration newCfg); void setPrefix(String newPrefix); String get(String propertyName); String[] ge...
### Question: SubConfiguration implements Configuration { public void setPrefix(String newPrefix){ prefix = newPrefix; } SubConfiguration(); SubConfiguration(Configuration cfg, String prefix); void setConfiguration(Configuration newCfg); void setPrefix(String newPrefix); String get(String propertyName); String[] getAl...
### Question: CardHolder implements Cloneable, Serializable, Loggeable { public boolean hasTrack2() { return pan != null && exp != null && trailer != null; } CardHolder(); CardHolder(String track2); CardHolder(String pan, String exp); CardHolder(ISOMsg m); void parseTrack2(String s); void setTrack1(String track1); S...
### Question: CardHolder implements Cloneable, Serializable, Loggeable { public void dump (PrintStream p, String indent) { p.print (indent + "<CardHolder"); if (hasTrack1()) p.print (" trk1=\"true\""); if (hasTrack2()) p.print (" trk2=\"true\""); if (hasSecurityCode()) p.print (" sec=\"true\""); if (isExpired()) p.prin...
### Question: CardHolder implements Cloneable, Serializable, Loggeable { public String getBIN () { return pan.substring(0, BINLEN); } CardHolder(); CardHolder(String track2); CardHolder(String pan, String exp); CardHolder(ISOMsg m); void parseTrack2(String s); void setTrack1(String track1); String getTrack1(); boole...
### Question: CardHolder implements Cloneable, Serializable, Loggeable { public String getEXP () { return exp; } CardHolder(); CardHolder(String track2); CardHolder(String pan, String exp); CardHolder(ISOMsg m); void parseTrack2(String s); void setTrack1(String track1); String getTrack1(); boolean hasTrack1(); Strin...
### Question: SpaceLet extends QBeanSupport implements Space { public Object rd (Object key) { try { Interpreter bsh = initInterpreter (key); synchronized (sp) { if (eval (bsh, rdScript, rdSource)) { return bsh.get ("value"); } else { return sp.rd (key); } } } catch (Throwable t) { throw new SpaceError (t); } } void i...
### Question: CardHolder implements Cloneable, Serializable, Loggeable { public String getNameOnCard() { String name = null; if (track1!=null) { StringTokenizer st = new StringTokenizer(track1, TRACK1_SEPARATOR); if (st.countTokens()<2) return null; st.nextToken(); name = st.nextToken(); } return name; } CardHolder(); ...
### Question: CardHolder implements Cloneable, Serializable, Loggeable { public String getPAN () { return pan; } CardHolder(); CardHolder(String track2); CardHolder(String pan, String exp); CardHolder(ISOMsg m); void parseTrack2(String s); void setTrack1(String track1); String getTrack1(); boolean hasTrack1(); Strin...
### Question: CardHolder implements Cloneable, Serializable, Loggeable { public String getSecurityCode() { return securityCode; } CardHolder(); CardHolder(String track2); CardHolder(String pan, String exp); CardHolder(ISOMsg m); void parseTrack2(String s); void setTrack1(String track1); String getTrack1(); boolean h...