KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > prevayler > implementation > TransactionTimestamp


1 //Prevayler(TM) - The Free-Software Prevalence Layer.
2
//Copyright (C) 2001-2003 Klaus Wuestefeld
3
//This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
4

5 package org.prevayler.implementation;
6
7 import java.io.Serializable JavaDoc;
8 import java.util.Date JavaDoc;
9
10 import org.prevayler.Transaction;
11
12 public class TransactionTimestamp implements Serializable JavaDoc {
13
14     static final long serialVersionUID = 0L;
15
16     private final Transaction transaction;
17     private final long timestamp;
18
19     public TransactionTimestamp(Transaction transaction, Date JavaDoc timestamp) {
20         this.transaction = transaction;
21         this.timestamp = timestamp.getTime();
22     }
23
24     public Transaction transaction() {
25         return this.transaction;
26     }
27
28     public Date JavaDoc timestamp() {
29         return new Date JavaDoc(this.timestamp);
30     }
31
32 }
33
Popular Tags