KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb > txtimer > NoopPersistencePolicy


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2005, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.ejb.txtimer;
23
24 // $Id: NoopPersistencePolicy.java 38205 2005-11-17 22:16:37Z dimitris $
25

26 import java.io.Serializable JavaDoc;
27 import java.util.ArrayList JavaDoc;
28 import java.util.Date JavaDoc;
29 import java.util.List JavaDoc;
30
31 import javax.management.ObjectName JavaDoc;
32
33 import org.jboss.logging.Logger;
34
35 /**
36  * This service implements a PersistencePolicy that does not persist the timer.
37  *
38  * @author Thomas.Diesler@jboss.org
39  * @author Dimitris.Andreadis@jboss.org
40  * @version $Revision: 38205 $
41  * @since 09-Sep-2004
42  */

43 public class NoopPersistencePolicy implements NoopPersistencePolicyMBean
44 {
45    // logging support
46
private static Logger log = Logger.getLogger(NoopPersistencePolicy.class);
47
48    /**
49     * Creates the timer in persistent storage.
50     *
51     * @param timerId The timer id
52     * @param timedObjectId The timed object id
53     * @param firstEvent The point in time at which the first txtimer expiration must occur.
54     * @param firstEvent The point in time at which the first txtimer expiration must occur.
55     * @param periode The number of milliseconds that must elapse between txtimer expiration notifications.
56     */

57    public void insertTimer(String JavaDoc timerId, TimedObjectId timedObjectId, Date JavaDoc firstEvent, long periode, Serializable JavaDoc info)
58    {
59       log.debug("Noop on insertTimer");
60    }
61
62    /**
63     * Removes the timer from persistent storage.
64     *
65     * @param timerId The timer id
66     * @param timedObjectId The id of the timed object
67     */

68    public void deleteTimer(String JavaDoc timerId, TimedObjectId timedObjectId)
69    {
70       log.debug("Noop on deleteTimer");
71    }
72
73    /**
74     * Delete all persisted timers
75     */

76    public void clearTimers()
77    {
78       log.debug("Noop on clearTimers");
79    }
80    
81    /**
82     * Restore the persistet timers
83     */

84    public void restoreTimers()
85    {
86       log.debug("Noop on restoreTimers");
87    }
88
89    /**
90     * List the persisted timer handles
91     *
92     * @param loader The ClassLoader to use for loading the handles
93     * @return a list of TimerHandleImpl objects
94     */

95    public List JavaDoc listTimerHandles(ObjectName JavaDoc containerId, ClassLoader JavaDoc loader)
96    {
97       log.debug("Noop on listTimerHandles");
98       return new ArrayList JavaDoc();
99    }
100    
101    /**
102     * Return a List of TimerHandle objects.
103     */

104    public List JavaDoc listTimerHandles()
105    {
106       log.debug("Noop on listTimerHandles");
107       return new ArrayList JavaDoc();
108    }
109    
110    /**
111     * List the persisted timers for a particular TimerObjectId,
112     * or all persisted timers if timedObjectId is null.
113     *
114     * @param timedObjectId The id of the timed object, or null
115     * @return a list of TimerHandleImpl objects
116     */

117    public List JavaDoc listTimerHandles(TimedObjectId timedObjectId)
118    {
119       log.debug("Noop on listTimerHandles");
120       return new ArrayList JavaDoc();
121    }
122    
123 }
124
Popular Tags