01: package com.bostechcorp.cbesb.common.sa.service;
02:
03: import java.util.Properties;
04:
05: import com.bostechcorp.cbesb.common.util.custcomponent.IServiceUnitContext;
06: import com.bostechcorp.cbesb.common.util.custcomponent.ICustComponent.Role;
07:
08: public class ServiceUnitContextImpl implements IServiceUnitContext {
09:
10: private Properties consumerProperties = new Properties();
11: private Properties providerProperties = new Properties();
12: private String rootDir = "";
13: private String suName = "";
14: private String saProjectName = "";
15:
16: public ServiceUnitContextImpl() {
17: super ();
18: }
19:
20: public Properties getProperties(Role role) {
21: if (role.equals(Role.CONSUMER))
22: return consumerProperties;
23: else if (role.equals(Role.PROVIDER))
24: return providerProperties;
25: else {
26: Properties totalProperties = new Properties();
27: totalProperties.putAll(consumerProperties);
28: totalProperties.putAll(providerProperties);
29:
30: return totalProperties;
31: }
32: }
33:
34: public String getRootDir() {
35: return this .rootDir;
36: }
37:
38: public void setConsumerProperty(String key, String value) {
39: if (value != null)
40: this .consumerProperties.setProperty(key, value);
41: }
42:
43: public void setProviderProperty(String key, String value) {
44: if (value != null)
45: this .providerProperties.setProperty(key, value);
46: }
47:
48: public void setRootDir(String rootDir) {
49: this .rootDir = rootDir;
50: }
51:
52: public void setSuName(String name) {
53: this .suName = name;
54: }
55:
56: public String getSuName() {
57:
58: return this .suName;
59: }
60:
61: public String getSaProjectName() {
62: return saProjectName;
63: }
64:
65: public void setSaProjectName(String saProjectName) {
66: this.saProjectName = saProjectName;
67: }
68:
69: }
|