/** * Create a new threadbased plan executor. */ public JavaStandardPlanExecutor(IThreadPool threadpool) { this.threadpool = threadpool; this.tasks = Collections.synchronizedMap(SCollection.createHashMap()); }
/** * Add an external document. * @param id The document id as used in anchor tags. * @param doc The html text. */ public void addDocument(String id, String doc) { if(externals==null) this.externals = SCollection.createHashMap(); externals.put(id, doc); }
/** * Create a new asynchronous executor service. */ public AsyncExecutionService(IInternalAccess component, Map<String, Object> properties)//, int max) { super(component.getComponentIdentifier(), IExecutionService.class, properties); this.component = component; this.executors = SCollection.createHashMap(); this.runningexes = SCollection.createHashMap(); this.state = State.CREATED; }
/** * Create a new asynchronous executor service. */ public AsyncExecutionService(IServiceProvider provider, Map<String, Object> properties)//, int max) { super(provider.getId(), IExecutionService.class, properties); this.provider = provider; this.running = false; this.executors = SCollection.createHashMap(); this.runningexes = SCollection.createHashMap(); }
/** * Called for each method entry. */ protected synchronized void entry() { if(threads==null) this.threads = SCollection.createHashMap(); Integer cnt = (Integer)this.threads.get(Thread.currentThread()); cnt = Integer.valueOf(cnt!=null ? cnt.intValue()+1 : 1); threads.put(Thread.currentThread(), cnt); if(threads.size()>1) { throw new RuntimeException("Concurrent access to list "+list.getClass().getName()+"@"+list.hashCode()); } }
/** * Create a new asynchronous executor service. */ public AsyncExecutionService(IServiceProvider provider, Map<String, Object> properties)//, int max) { super(provider.getId(), IExecutionService.class, properties); this.provider = provider; // this.threadpool = threadpool; // this.max = max; this.running = false; this.executors = SCollection.createHashMap(); // this.executors = SCollection.createWeakHashMap(); // this.executorcache = SCollection.createArrayList(); }
/** * Clone an index map. */ public Object clone() throws CloneNotSupportedException { IndexMap<K, V> ret = (IndexMap<K, V>) super.clone(); ArrayList<K> listcopy = SCollection.createArrayList(); listcopy.addAll(list); Map<K, V> mapcopy = SCollection.createHashMap(); mapcopy.putAll(map); ret.list = listcopy; ret.map = mapcopy; return ret; // return new IndexMap<K, V>(listcopy, mapcopy); }
/** * Create a new component execution service. * @param exta The service provider. */ public DecoupledComponentManagementService(IComponentAdapter root, IBootstrapFactory componentfactory, boolean copy, boolean realtime, boolean uniqueids) { this.root = root; this.componentfactory = componentfactory; this.copy = copy; this.realtime = realtime; this.uniqueids = uniqueids; // Todo: why some collections synchronized? single thread access!? this.adapters = SCollection.createHashMap(); this.ccs = SCollection.createLinkedHashMap(); this.cfs = SCollection.createLinkedHashMap(); // this.logger = Logger.getLogger(AbstractComponentAdapter.getLoggerName(exta.getComponentIdentifier())+".cms"); this.listeners = SCollection.createMultiCollection(); this.resultlisteners = SCollection.createHashMap(); this.initinfos = SCollection.createHashMap(); this.childcounts = SCollection.createHashMap(); this.localtypes = new LRU<Tuple, String>(100); this.lockentries = SCollection.createHashMap(); this.cidcounts = new HashMap<String, Integer>(); }
/** * Create a new component execution service. * @param exta The service provider. */ public DecoupledComponentManagementService(IComponentAdapter root, IBootstrapFactory componentfactory, boolean copy, boolean realtime, boolean uniqueids) { this.root = root; this.componentfactory = componentfactory; this.copy = copy; this.realtime = realtime; this.uniqueids = uniqueids; // Todo: why some collections synchronized? single thread access!? this.adapters = SCollection.createHashMap(); this.ccs = SCollection.createLinkedHashMap(); this.cfs = SCollection.createLinkedHashMap(); // this.logger = Logger.getLogger(AbstractComponentAdapter.getLoggerName(exta.getComponentIdentifier())+".cms"); this.listeners = SCollection.createMultiCollection(); this.resultlisteners = SCollection.createHashMap(); this.initinfos = SCollection.createHashMap(); this.childcounts = SCollection.createHashMap(); this.localtypes = new LRU<Tuple, String>(100); this.lockentries = SCollection.createHashMap(); this.cidcounts = new HashMap<String, Integer>(); }
/** * Called for each method exit. */ protected synchronized void exit() { if(threads==null) this.threads = SCollection.createHashMap(); // Check again to throw exception on second thread also. if(threads.size()>1) { throw new RuntimeException("Concurrent access to list "+list.getClass().getName()+"@"+list.hashCode()); } Integer cnt = (Integer)this.threads.get(Thread.currentThread()); assert cnt!=null && cnt.intValue()>0; if(cnt.intValue()>1) { cnt = Integer.valueOf(cnt.intValue()-1); threads.put(Thread.currentThread(), cnt); } else { threads.remove(Thread.currentThread()); } } }
if(cls==null) cls = SCollection.createHashMap(); clones.set(cls); creator = true;
/** * Create a new component execution service. * @param exta The service provider. */ public ComponentManagementService(IPlatformComponentAccess access, IBootstrapFactory componentfactory, boolean uniqueids) { this.access = access; this.componentfactory = componentfactory; this.uniqueids = uniqueids; this.components = SCollection.createHashMap(); this.ccs = SCollection.createLinkedHashMap(); this.cfs = SCollection.createLinkedHashMap(); // this.logger = Logger.getLogger(AbstractComponentAdapter.getLoggerName(exta.getComponentIdentifier())+".cms"); this.listeners = SCollection.createMultiCollection(); this.initinfos = SCollection.createHashMap(); this.childcounts = SCollection.createHashMap(); this.localtypes = new LRU<Tuple, String>(100); this.lockentries = SCollection.createHashMap(); this.cidcounts = new HashMap<String, Integer>(); putInitInfo(access.getInternalAccess().getComponentIdentifier(), new InitInfo(access, null, null)); }
this.adapters = SCollection.createHashMap(); this.adapters = Collections.synchronizedMap(adapters); this.ccs = SCollection.createLinkedHashMap(); this.resultlisteners = SCollection.createHashMap(); this.resultlisteners = Collections.synchronizedMap(resultlisteners); this.initinfos = SCollection.createHashMap(); this.initinfos = Collections.synchronizedMap(initinfos); this.childcounts = SCollection.createHashMap(); this.localtypes = Collections.synchronizedMap(new LRU<Tuple, String>(100)); this.lockentries = SCollection.createHashMap();
public static void main(String[] args) throws InterruptedException { for(int i=1; i<5000; i++) { createArrayList(); createHashMap(); createHashSet(); createHashtable(); createIndexMap(); createVector(); Thread.sleep(10); } System.out.println("finished"); Thread.sleep(10000); System.exit(0); } }
codecclasses = SCollection.createHashMap(); codeccache = SCollection.createHashMap(); if(codecs==null)
this.transports.add(transports[i]); this.messagetypes = SCollection.createHashMap(); for(int i=0; i<messagetypes.length; i++) this.messagetypes.put(messagetypes[i].getName(), messagetypes[i]);
codecclasses = SCollection.createHashMap(); codeccache = SCollection.createHashMap(); if(codecs==null)
codecclasses = SCollection.createHashMap(); codeccache = SCollection.createHashMap(); if(codecs==null)
Map<String, Object> args = SCollection.createHashMap(); args.put("testagent", getComponentIdentifier()); cms.createComponent("/jadex/bdi/testcases/misc/ConfigElementRefWorker.agent.xml",
Map<String, Object> args = SCollection.createHashMap(); args.put("creator", getComponentIdentifier()); cms.createComponent("/jadex/bdi/testcases/misc/ArgumentsWorker.agent.xml",