@Test public void testAddWatchDataReplicator() throws Exception { WatchDataSourceImpl impl = new WatchDataSourceImpl(); impl.setID("watch"); impl.setConfiguration(new DynamicConfiguration()); WatchDataReplicator wdr1 = new LoggingWatchDataReplicator(); impl.addWatchDataReplicator(wdr1); Assert.assertSame(wdr1, impl.getWatchDataReplicators()[0]); WatchDataReplicator wdr2 = new LoggingWatchDataReplicator(); impl.addWatchDataReplicator(wdr2); Assert.assertSame(wdr2, impl.getWatchDataReplicators()[1]); impl.addWatchDataReplicator(null); Assert.assertNotNull(impl.getWatchDataReplicators()); Assert.assertTrue(impl.getWatchDataReplicators().length==2); impl.close(); }
public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; } }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; } WatchDataSourceImpl();  WatchDataSourceImpl(String id, Configuration config); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; } WatchDataSourceImpl();  WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration config); void unexport(boolean force); String getID(); void setID(String id); void setMaxSize(int size); void clear(); int getMaxSize(); int getCurrentSize(); @SuppressWarnings("unchecked") void addCalculable(Calculable calculable); Calculable[] getCalculable(); Calculable[] getCalculable(String id); Calculable[] getCalculable(long from, long to); Calculable getLastCalculable(); ThresholdValues getThresholdValues(); void setThresholdValues(ThresholdValues tValues); void close(); void setView(String viewClass); String getView(); TrustVerifier getProxyVerifier(); boolean addWatchDataReplicator(WatchDataReplicator replicator); boolean removeWatchDataReplicator(WatchDataReplicator replicator); WatchDataReplicator[] getWatchDataReplicators(); }
WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } return added; } WatchDataSourceImpl();  WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration config); void unexport(boolean force); String getID(); void setID(String id); void setMaxSize(int size); void clear(); int getMaxSize(); int getCurrentSize(); @SuppressWarnings("unchecked") void addCalculable(Calculable calculable); Calculable[] getCalculable(); Calculable[] getCalculable(String id); Calculable[] getCalculable(long from, long to); Calculable getLastCalculable(); ThresholdValues getThresholdValues(); void setThresholdValues(ThresholdValues tValues); void close(); void setView(String viewClass); String getView(); TrustVerifier getProxyVerifier(); boolean addWatchDataReplicator(WatchDataReplicator replicator); boolean removeWatchDataReplicator(WatchDataReplicator replicator); WatchDataReplicator[] getWatchDataReplicators(); final static int DEFAULT_COLLECTION_SIZE; final static int MAX_COLLECTION_SIZE; }