Package org.apache.geronimo.timer

Examples of org.apache.geronimo.timer.WorkInfo


                        if (!taskRS.wasNull()) {
                            period = null;
                        }
                        boolean atFixedRate = taskRS.getBoolean(6);
                        //TODO make sure the reference to this is ok, meaning we can't use a handle to this WorkerPersistence.
                        WorkInfo workInfo = new WorkInfo(key, userId, userInfo, time, period, atFixedRate);
                        workInfo.setId(id);
                        playback.schedule(workInfo);
                    }
                } finally {
                    taskRS.close();
                }
View Full Code Here


    public void playback(String key, Playback playback) throws PersistenceException {
        synchronized (tasks) {
            for (Iterator iterator = tasks.entrySet().iterator(); iterator.hasNext();) {
                Map.Entry entry = (Map.Entry) iterator.next();
                WorkInfo workInfo = (WorkInfo) entry.getValue();
                playback.schedule(workInfo);
            }
        }
    }
View Full Code Here

    public Collection getIdsByKey(String key, Object userId) throws PersistenceException {
        Collection ids = new ArrayList();
        synchronized(tasks) {
            for (Iterator iterator = tasks.values().iterator(); iterator.hasNext();) {
                WorkInfo workInfo = (WorkInfo) iterator.next();
                if (key.equals(workInfo.getKey()) && (userId == null || userId.equals(workInfo.getUserId()))) {
                    ids.add(new Long(workInfo.getId()));
                }
            }
        }
        return ids;
    }
View Full Code Here

    protected void setUp() throws Exception {
        jdbcWorkerPersistence = new JDBCWorkerPersistence(serverUniqueId, datasource, useSequence);
        time = new Date(System.currentTimeMillis());
        period = new Long(1000);
        workInfo = new WorkInfo(key, userId, userInfo, time, period, true);
    }
View Full Code Here

    }

    public void testGetByKey() throws Exception {
        time = new Date(System.currentTimeMillis());
        period = new Long(1000);
        WorkInfo workInfo1 = new WorkInfo(key, new Long(1), userInfo, time, period, true);
        WorkInfo workInfo2 = new WorkInfo(key, new Long(2), userInfo, time, period, true);
        jdbcWorkerPersistence.save(workInfo1);
        jdbcWorkerPersistence.save(workInfo2);
        Collection idsAll = jdbcWorkerPersistence.getIdsByKey(key, null);
        assertEquals(2, idsAll.size());
        Collection ids1 = jdbcWorkerPersistence.getIdsByKey(key, new Long(1));
View Full Code Here

                            if (!taskRS.wasNull()) {
                                period = null;
                            }
                            boolean atFixedRate = taskRS.getBoolean(6);
                            //TODO make sure the reference to this is ok, meaning we can't use a handle to this WorkerPersistence.
                            WorkInfo workInfo = new WorkInfo(key, userId, userInfo, time, period, atFixedRate);
                            workInfo.setId(id);
                            playback.schedule(workInfo);
                        }
                    } finally {
                        taskRS.close();
                    }
View Full Code Here

    public void playback(String key, Playback playback) throws PersistenceException {
        synchronized (tasks) {
            for (Iterator iterator = tasks.entrySet().iterator(); iterator.hasNext();) {
                Map.Entry entry = (Map.Entry) iterator.next();
                WorkInfo workInfo = (WorkInfo) entry.getValue();
                playback.schedule(workInfo);
            }
        }
    }
View Full Code Here

    public Collection getIdsByKey(String key, Object userId) throws PersistenceException {
        Collection ids = new ArrayList();
        synchronized(tasks) {
            for (Iterator iterator = tasks.values().iterator(); iterator.hasNext();) {
                WorkInfo workInfo = (WorkInfo) iterator.next();
                if (key.equals(workInfo.getKey()) && (userId == null || userId.equals(workInfo.getUserId()))) {
                    ids.add(new Long(workInfo.getId()));
                }
            }
        }
        return ids;
    }
View Full Code Here

    protected void setUp() throws Exception {
        jdbcWorkerPersistence = new JDBCWorkerPersistence(serverUniqueId, datasource, useSequence);
        time = new Date(System.currentTimeMillis());
        period = new Long(1000);
        workInfo = new WorkInfo(key, userId, userInfo, time, period, true);
    }
View Full Code Here

    }

    public void testGetByKey() throws Exception {
        time = new Date(System.currentTimeMillis());
        period = new Long(1000);
        WorkInfo workInfo1 = new WorkInfo(key, new Long(1), userInfo, time, period, true);
        WorkInfo workInfo2 = new WorkInfo(key, new Long(2), userInfo, time, period, true);
        jdbcWorkerPersistence.save(workInfo1);
        jdbcWorkerPersistence.save(workInfo2);
        Collection idsAll = jdbcWorkerPersistence.getIdsByKey(key, null);
        assertEquals(2, idsAll.size());
        Collection ids1 = jdbcWorkerPersistence.getIdsByKey(key, new Long(1));
View Full Code Here

TOP

Related Classes of org.apache.geronimo.timer.WorkInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.