KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > annotation > ejb > MessagePropertiesImpl


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.annotation.ejb;
23
24 import java.lang.annotation.Annotation JavaDoc;
25 import java.io.Serializable JavaDoc;
26 import org.jboss.annotation.ejb.DeliveryMode;
27 import org.jboss.annotation.ejb.MessageProperties;
28
29 /**
30  * comment
31  *
32  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
33  */

34 public class MessagePropertiesImpl implements MessageProperties, Serializable JavaDoc
35 {
36    private DeliveryMode deliveryMode = DeliveryMode.PERSISTENT;
37    private int ttl = 0;
38    private int priority = 4;
39    private Class JavaDoc interfac;
40
41    public MessagePropertiesImpl(DeliveryMode deliveryMode, int ttl, int priority)
42    {
43       this.deliveryMode = deliveryMode;
44       this.ttl = ttl;
45       this.priority = priority;
46    }
47
48    public MessagePropertiesImpl(MessageProperties props)
49    {
50       deliveryMode = props.delivery();
51       ttl = props.timeToLive();
52       priority = props.priority();
53    }
54    
55    public void setDelivery(DeliveryMode mode)
56    {
57       this.deliveryMode = mode;
58    }
59    
60    public void setPriority(int priority)
61    {
62       this.priority = priority;
63    }
64
65    public MessagePropertiesImpl()
66    {
67
68    }
69
70    public DeliveryMode delivery()
71    {
72       return deliveryMode;
73    }
74
75    public int timeToLive()
76    {
77       return ttl;
78    }
79
80    public int priority()
81    {
82       return priority;
83    }
84    
85    public Class JavaDoc getInterface()
86    {
87       return interfac;
88    }
89    
90    public void setInterface(Class JavaDoc interfac)
91    {
92       this.interfac = interfac;
93    }
94
95    public Class JavaDoc<? extends Annotation JavaDoc> annotationType()
96    {
97       return MessageProperties.class;
98    }
99 }
100
Popular Tags