View Javadoc
1   /*
2    * Copyright (C) 2003-2012 eXo Platform SAS.
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Affero General Public License
6    * as published by the Free Software Foundation; either version 3
7    * of the License, or (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, see<http://www.gnu.org/licenses/>.
16   */
17  package org.exoplatform.services.cms.watch.impl;
18  
19  import org.exoplatform.container.component.ComponentPlugin;
20  import org.exoplatform.container.xml.InitParams;
21  import org.exoplatform.container.xml.ObjectParameter;
22  
23  
24  /**
25   * Created by The eXo Platform SAS
26   * Author : eXoPlatform
27   *          hadv@exoplatform.com
28   * Jan 4, 2012  
29   */
30  public class MessageConfigPlugin implements ComponentPlugin {
31    private String name;
32  
33    private String desciption;
34    
35    private MessageConfig messageConfig;
36    
37    final static private String MESSAGE_CONFIG_PARAM = "messageConfig";
38    
39    /**
40     * Constructor of <code>MessageConfigPlugin</code> class. Get the <code>MessageConfig</code> in
41     * messageConfig init param of <code>WatchDocumentService</code> from XML configuration
42     * file
43     * 
44     * @param initParams The initialize parameters
45     */
46    public MessageConfigPlugin(InitParams initParams) {
47      ObjectParameter objectParam = initParams.getObjectParam(MESSAGE_CONFIG_PARAM);
48      if(objectParam != null) {
49        messageConfig = (MessageConfig)objectParam.getObject();
50      }    
51    }  
52    
53    @Override
54    public String getName() {
55      return this.name;
56    }
57  
58    @Override
59    public void setName(String name) {
60      this.name = name;
61    }
62  
63    @Override
64    public String getDescription() {
65      return this.desciption;
66    }
67  
68    @Override
69    public void setDescription(String description) {
70      this.desciption = description;
71    }
72  
73    /**
74     * @return the messageConfig
75     */
76    public MessageConfig getMessageConfig() {
77      return messageConfig;
78    }
79  
80  }