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

Quick Search    Search Deep

Source code: com/aendvari/cerberus/component/assembly/AssemblyContext.java


1   /*
2    * AssemblyContext.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.cerberus.component.assembly;
11  
12  import com.aendvari.common.properties.Properties;
13  
14  import com.aendvari.hermes.broker.MessageBroker;
15  
16  /**
17   * <p>Provides context data during component assembly.</p>
18   *
19   * <p>The {@link MessageBroker} is provided for message subscription and publishing during
20   * the assembly process.</p>
21   *
22   * <p>The context may have several properties. The properties are stored in a
23   * ({@link Properties}) object, allowing them to be stored in a hierarchy.</p>
24   *
25   * @author  Trevor Milne
26   *
27   */
28  
29  public class AssemblyContext
30  {
31    /** The {@link MessageBroker} to subscribe/publish message with. */
32    protected MessageBroker broker;
33  
34    /** Contains user defined attributes. */
35    protected Properties properties;
36  
37  
38    /* Constructors. */
39  
40  
41    /**
42     * Constructs a <code>AssemblyContext</code> instance.
43     *
44     * @param    setBroker          The {@link MessageBroker}.
45     *
46     */
47  
48    public AssemblyContext(MessageBroker setBroker)
49    {
50      broker = setBroker;
51      properties = new Properties();
52    }
53  
54  
55    /* Accessors. */
56  
57  
58    /* Properties. */
59  
60    /**
61     * Returns the properties associated with this context.
62     *
63     * @return                  The {@link Properties} of this context.
64     *
65     */
66  
67    public Properties getProperties()
68    {
69      return properties;
70    }
71  
72    /* Message Broker. */
73  
74    /**
75     * Returns the {@link MessageBroker} associated with this context.
76     *
77     * @return                  The {@link MessageBroker} of this context.
78     *
79     */
80  
81    public MessageBroker getMessageBroker()
82    {
83      return broker;
84    }
85  }
86