Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/aendvari/tethys/context/message/MessageMapping.java


1   /*
2    * MessageMapping.java
3    *
4    * Copyright (c) 2001, 2002 Aendvari, Ltd. All Rights Reserved.
5    *
6    * See the file LICENSE for terms of use.
7    *
8    */
9   
10  package com.aendvari.tethys.context.message;
11  
12  import com.aendvari.tethys.context.*;
13  
14  /**
15   * <p>This class is used to hold message mapping information.</p>
16   *
17   * @author  Scott Milne
18   *
19   */
20  
21  public class MessageMapping extends Context
22  {
23    /* Attributes */
24  
25    /** The topic of the message. */
26    private String topic;
27  
28  
29    /* Constructors */
30  
31    /**
32     * Constructs a <code>MessageMapping</code> from the supplied values.
33     *
34     * @param    location    The location of the mapping. This includes the message name.
35     * @param    topic      The topic of the message.
36     *
37     */
38  
39    public MessageMapping(String location, String topic)
40    {
41      super(location);
42  
43      this.topic = topic;
44    }
45  
46    /**
47     * Constructs a <code>MessageMapping</code> from the supplied values.
48     *
49     * @param    location    The name/location of the message relative to the parent context.
50     * @param    topic      The topic of the message.
51     * @param    parent      The parent {@link MessageContext}.
52     *
53     */
54  
55    public MessageMapping(String location, String topic, MessageContext parent)
56    {
57      super(location, parent);
58  
59      this.topic = topic;
60    }
61  
62  
63    /* Attributes */
64  
65    public void setTopic(String topic) { this.topic = topic; }
66    public String getTopic() { return topic; }
67  
68  
69    /* Debug */
70  
71    public String toString()
72    {
73      String toString = "MessageMapping=[";
74  
75      toString += "location=" + getLocation() + ",";
76      toString += "topic=" + getTopic() + ",";
77      toString += "]";
78  
79      return toString;
80    }
81  }
82