KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > wsrp > producer > impl > WSRPConfiguration


1 package org.exoplatform.services.wsrp.producer.impl;
2
3 import java.util.Collection JavaDoc;
4 import java.util.Iterator JavaDoc;
5 import org.exoplatform.services.portletcontainer.impl.PortletContainerConf;
6
7 import org.exoplatform.commons.utils.ExoProperties;
8 import org.exoplatform.container.configuration.ConfigurationManager;
9 import org.exoplatform.container.configuration.PropertiesParam;
10 import org.exoplatform.container.configuration.ServiceConfiguration;
11 import org.exoplatform.container.configuration.ValuesParam;
12 /**
13  * Copyright 2001-2003 The eXo platform SARL All rights reserved.
14  * Please look at license.txt in info directory for more license detail.
15  **/

16
17 /**
18  * Created by the Exo Development team.
19  * Author : Mestrallet Benjamin
20  * benjmestrallet@users.sourceforge.net
21  * Date: 23 janv. 2004
22  * Time: 12:16:47
23  */

24 public class WSRPConfiguration {
25
26   private boolean hasUserSpecificState;
27   private boolean doesUrlTemplateProcessing;
28   private boolean templatesStoredInSession;
29   private boolean userContextStoredInSession;
30   private boolean usesMethodGet;
31   private boolean requiresRegistration;
32   private boolean blockingInteractionOptimized;
33   private boolean saveRegistrationStateOnConsumer;
34   private boolean savePortletStateOnConsumer;
35
36
37   public WSRPConfiguration(ConfigurationManager cService) {
38     try {
39       ServiceConfiguration sconf = cService.getServiceConfiguration(WSRPConfiguration.class) ;
40       PropertiesParam param = sconf.getPropertiesParam("wsrp-conf");
41       init(param.getProperties());
42     } catch (Exception JavaDoc e) {
43       e.printStackTrace();
44     }
45   }
46
47   private void init(ExoProperties props) {
48     hasUserSpecificState =
49         props.getProperty("wsrp.has.user.specific.state").equals("true") ;
50     doesUrlTemplateProcessing =
51         props.getProperty("wsrp.does.url.template.processing").equals("true") ;
52     templatesStoredInSession =
53       props.getProperty("wsrp.templates.stored.in.session").equals("true") ;
54     userContextStoredInSession =
55       props.getProperty("wsrp.user.context.stored.in.session").equals("true") ;
56     usesMethodGet =
57       props.getProperty("wsrp.uses.method.get").equals("true") ;
58     requiresRegistration =
59       props.getProperty("wsrp.requires.registration").equals("true") ;
60     blockingInteractionOptimized =
61       props.getProperty("wsrp.perform.blocking.interaction.optimized").equals("true") ;
62     saveRegistrationStateOnConsumer =
63       props.getProperty("wsrp.save.registration.state.on.consumer").equals("true") ;
64     savePortletStateOnConsumer =
65       props.getProperty("wsrp.save.portlet.state.on.consumer").equals("true") ;
66   }
67
68   public boolean isHasUserSpecificState() {
69     return hasUserSpecificState;
70   }
71
72   public boolean isDoesUrlTemplateProcessing() {
73     return doesUrlTemplateProcessing;
74   }
75
76   public boolean isTemplatesStoredInSession() {
77     return templatesStoredInSession;
78   }
79
80   public boolean isUserContextStoredInSession() {
81     return userContextStoredInSession;
82   }
83
84   public boolean isUsesMethodGet() {
85     return usesMethodGet;
86   }
87
88   public boolean isRegistrationRequired() {
89     return requiresRegistration;
90   }
91
92   public boolean isBlockingInteractionOptimized() {
93     return blockingInteractionOptimized;
94   }
95
96   public boolean isSaveRegistrationStateOnConsumer() {
97     return saveRegistrationStateOnConsumer;
98   }
99
100   public boolean isSavePortletStateOnConsumer() {
101     return savePortletStateOnConsumer;
102   }
103 }
Popular Tags