1 17 package org.apache.geronimo.j2ee.deployment; 18 19 import java.io.File ; 20 import java.util.Collection ; 21 import java.util.HashMap ; 22 import java.util.Map ; 23 24 import org.apache.geronimo.common.DeploymentException; 25 import org.apache.geronimo.deployment.DeploymentContext; 26 import org.apache.geronimo.gbean.AbstractName; 27 import org.apache.geronimo.gbean.AbstractNameQuery; 28 import org.apache.geronimo.kernel.Naming; 29 import org.apache.geronimo.kernel.config.ConfigurationManager; 30 import org.apache.geronimo.kernel.config.ConfigurationModuleType; 31 import org.apache.geronimo.kernel.repository.Environment; 32 33 36 public class EARContext extends DeploymentContext { 37 38 private final AbstractNameQuery serverName; 39 private final AbstractNameQuery transactionManagerObjectName; 40 private final AbstractNameQuery connectionTrackerObjectName; 41 private final AbstractNameQuery transactedTimerName; 42 private final AbstractNameQuery nonTransactedTimerName; 43 private final AbstractNameQuery corbaGBeanObjectName; 44 45 private final Map contextIDToPermissionsMap = new HashMap (); 46 private AbstractName jaccManagerName; 47 private Object securityConfiguration; 48 49 private final Map messageDestinations = new HashMap (); 50 51 public EARContext(File baseDir, 52 File inPlaceConfigurationDir, 53 Environment environment, 54 ConfigurationModuleType moduleType, 55 Naming naming, 56 ConfigurationManager configurationManager, Collection repositories, 57 AbstractNameQuery serverName, 58 AbstractName baseName, 59 AbstractNameQuery transactionManagerObjectName, 60 AbstractNameQuery connectionTrackerObjectName, 61 AbstractNameQuery transactedTimerName, 62 AbstractNameQuery nonTransactedTimerName, 63 AbstractNameQuery corbaGBeanObjectName 64 ) throws DeploymentException { 65 super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, naming, configurationManager, repositories); 66 67 this.serverName = serverName; 68 this.transactionManagerObjectName = transactionManagerObjectName; 69 this.connectionTrackerObjectName = connectionTrackerObjectName; 70 this.transactedTimerName = transactedTimerName; 71 this.nonTransactedTimerName = nonTransactedTimerName; 72 this.corbaGBeanObjectName = corbaGBeanObjectName; 73 } 74 75 public EARContext(File baseDir, 76 File inPlaceConfigurationDir, 77 Environment environment, 78 ConfigurationModuleType moduleType, 79 Naming naming, 80 ConfigurationManager configurationManager, 81 AbstractNameQuery serverName, 82 AbstractName baseName, 83 AbstractNameQuery transactionManagerObjectName, 84 AbstractNameQuery connectionTrackerObjectName, 85 AbstractNameQuery transactedTimerName, 86 AbstractNameQuery nonTransactedTimerName, 87 AbstractNameQuery corbaGBeanObjectName 88 ) throws DeploymentException { 89 super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, naming, configurationManager); 90 91 this.serverName = serverName; 92 93 this.transactionManagerObjectName = transactionManagerObjectName; 94 this.connectionTrackerObjectName = connectionTrackerObjectName; 95 this.transactedTimerName = transactedTimerName; 96 this.nonTransactedTimerName = nonTransactedTimerName; 97 this.corbaGBeanObjectName = corbaGBeanObjectName; 98 } 99 100 public EARContext(File baseDir, File inPlaceConfigurationDir, Environment environment, ConfigurationModuleType moduleType, AbstractName baseName, EARContext parent) throws DeploymentException { 101 super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, parent.getNaming(), parent.getConfigurationManager()); 102 this.serverName = parent.getServerName(); 103 104 this.transactionManagerObjectName = parent.getTransactionManagerName(); 105 this.connectionTrackerObjectName = parent.getConnectionTrackerName(); 106 this.transactedTimerName = parent.getTransactedTimerName(); 107 this.nonTransactedTimerName = parent.getNonTransactedTimerName(); 108 this.corbaGBeanObjectName = parent.getCORBAGBeanName(); 109 } 110 111 public AbstractNameQuery getServerName() { 112 return serverName; 113 } 114 115 public AbstractNameQuery getTransactionManagerName() { 116 return transactionManagerObjectName; 117 } 118 119 public AbstractNameQuery getConnectionTrackerName() { 120 return connectionTrackerObjectName; 121 } 122 123 public AbstractNameQuery getTransactedTimerName() { 124 return transactedTimerName; 125 } 126 127 public AbstractNameQuery getNonTransactedTimerName() { 128 return nonTransactedTimerName; 129 } 130 131 public AbstractNameQuery getCORBAGBeanName() { 132 return corbaGBeanObjectName; 133 } 134 135 public Map getContextIDToPermissionsMap() { 136 return contextIDToPermissionsMap; 137 } 138 139 public void addSecurityContext(String contextID, Object componentPermissions) throws DeploymentException { 140 Object old = contextIDToPermissionsMap.put(contextID, componentPermissions); 141 if (old != null) { 142 throw new DeploymentException("Duplicate contextID registered! " + contextID); 143 } 144 } 145 146 public void setJaccManagerName(AbstractName jaccManagerName) { 147 this.jaccManagerName = jaccManagerName; 148 } 149 150 public AbstractName getJaccManagerName() { 151 return jaccManagerName; 152 } 153 154 public void setSecurityConfiguration(Object securityConfiguration) throws DeploymentException { 155 if (this.securityConfiguration != null) { 156 throw new DeploymentException("Only one security configuration allowed per application"); 157 } 158 this.securityConfiguration = securityConfiguration; 159 } 160 161 public Object getSecurityConfiguration() { 162 return securityConfiguration; 163 } 164 165 public void registerMessageDestionations(String moduleName, Map nameMap) throws DeploymentException { 166 messageDestinations.put(moduleName, nameMap); 167 } 168 169 public Map getMessageDestinations() { 170 return messageDestinations; 171 } 172 173 } 174 | Popular Tags |