1 23 24 package com.sun.enterprise.connectors; 25 26 import java.util.*; 27 import java.util.logging.*; 28 29 import com.sun.enterprise.deployment.*; 30 import com.sun.enterprise.server.*; 31 import com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter; 32 import com.sun.enterprise.connectors.util.*; 33 34 39 40 41 public class ConnectorConfigurationParserServiceImpl extends 42 ConnectorServiceImpl { 43 44 45 48 49 public ConnectorConfigurationParserServiceImpl() { 50 super(); 51 } 52 53 61 62 public String getSecurityPermissionSpec(String moduleName) 63 throws ConnectorRuntimeException 64 { 65 66 if(moduleName == null) { 67 return null; 68 } 69 ConnectorDescriptor connectorDescriptor = getConnectorDescriptor( 70 moduleName); 71 Set securityPermissions = connectorDescriptor.getSecurityPermissions(); 72 Iterator it = securityPermissions.iterator(); 73 String policyString = null; 74 SecurityPermission secPerm = null; 75 String permissionString=null; 76 while(it.hasNext()){ 77 secPerm = (SecurityPermission) it.next(); 78 permissionString = secPerm.getPermission(); 79 if(permissionString != null) { 80 policyString = policyString+"\n \n"+permissionString; 81 } 82 } 83 if(policyString != null) { 84 policyString= CAUTION_MESSAGE+policyString; 85 } 86 return policyString; 87 } 88 89 93 94 public String [] getConnectionDefinitionNames(String rarName) 95 throws ConnectorRuntimeException 96 { 97 98 ConnectorDescriptor desc = getConnectorDescriptor(rarName); 99 if(desc != null) { 100 MCFConfigParser mcfConfigParser = (MCFConfigParser) 101 ConnectorConfigParserFactory.getParser(ConnectorConfigParser.MCF); 102 return mcfConfigParser.getConnectionDefinitionNames(desc); 103 } else { 104 return null; 105 } 106 } 107 108 120 121 public Properties getResourceAdapterConfigProps(String rarName) 122 throws ConnectorRuntimeException 123 { 124 return getConnectorConfigJavaBeans( 125 rarName,null,ConnectorConfigParser.RA); 126 } 127 128 141 142 public Properties getMCFConfigProps( 143 String rarName,String connectionDefName) throws ConnectorRuntimeException 144 { 145 Properties props = getConnectorConfigJavaBeans( 146 rarName,connectionDefName,ConnectorConfigParser.MCF); 147 if (rarName.equals(ConnectorConstants.DEFAULT_JMS_ADAPTER)) { 148 props.remove(ActiveJmsResourceAdapter.ADDRESSLIST); 149 } 150 return props; 151 } 152 153 166 167 public Properties getAdminObjectConfigProps( 168 String rarName,String adminObjectIntf) throws ConnectorRuntimeException 169 { 170 return getConnectorConfigJavaBeans( 171 rarName,adminObjectIntf,ConnectorConfigParser.AOR); 172 } 173 174 188 189 public Properties getConnectorConfigJavaBeans(String rarName, 190 String connectionDefName,String type) throws ConnectorRuntimeException 191 { 192 193 ConnectorDescriptor desc = getConnectorDescriptor(rarName); 194 if(desc != null) { 195 ConnectorConfigParser ccParser = 196 ConnectorConfigParserFactory.getParser(type); 197 return ccParser.getJavaBeanProps(desc,connectionDefName, rarName); 198 } else { 199 return null; 200 } 201 } 202 203 210 211 public String getActivationSpecClass( String rarName, 212 String messageListenerType) throws ConnectorRuntimeException 213 { 214 ConnectorDescriptor desc = getConnectorDescriptor(rarName); 215 if(desc != null) { 216 MessageListenerConfigParser messagelistenerConfigParser = 217 (MessageListenerConfigParser) 218 ConnectorConfigParserFactory.getParser( 219 ConnectorConfigParser.MSL); 220 return messagelistenerConfigParser.getActivationSpecClass( 221 desc,messageListenerType); 222 } else { 223 return null; 224 } 225 } 226 227 235 236 public String [] getMessageListenerTypes(String rarName) 237 throws ConnectorRuntimeException 238 { 239 ConnectorDescriptor desc = getConnectorDescriptor(rarName); 240 if(desc != null) { 241 MessageListenerConfigParser messagelistenerConfigParser = 242 (MessageListenerConfigParser) 243 ConnectorConfigParserFactory.getParser( 244 ConnectorConfigParser.MSL); 245 return messagelistenerConfigParser.getMessageListenerTypes(desc); 246 } else { 247 return null; 248 } 249 } 250 251 279 280 public Properties getMessageListenerConfigProps(String rarName, 281 String messageListenerType)throws ConnectorRuntimeException 282 { 283 return getConnectorConfigJavaBeans( 284 rarName,messageListenerType,ConnectorConfigParser.MSL); 285 } 286 287 299 300 public Properties getMessageListenerConfigPropTypes(String rarName, 301 String messageListenerType) throws ConnectorRuntimeException 302 { 303 ConnectorDescriptor desc = getConnectorDescriptor(rarName); 304 if(desc != null) { 305 MessageListenerConfigParser messagelistenerConfigParser = 306 (MessageListenerConfigParser) 307 ConnectorConfigParserFactory.getParser( 308 ConnectorConfigParser.MSL); 309 return messagelistenerConfigParser.getJavaBeanReturnTypes( 310 desc, messageListenerType); 311 } else { 312 return null; 313 } 314 } 315 316 320 321 public String [] getAdminObjectInterfaceNames(String rarName) 322 throws ConnectorRuntimeException 323 { 324 325 ConnectorDescriptor desc = getConnectorDescriptor(rarName); 326 if(desc != null) { 327 AdminObjectConfigParser adminObjectConfigParser = 328 (AdminObjectConfigParser) 329 ConnectorConfigParserFactory.getParser( 330 ConnectorConfigParser.AOR); 331 return adminObjectConfigParser.getAdminObjectInterfaceNames(desc); 332 } else { 333 return null; 334 } 335 } 336 337 346 public Map getRABeanProperties(String pathToDeployableUnit) throws ConnectorRuntimeException{ 347 return RARUtils.getRABeanProperties(pathToDeployableUnit); 348 } 349 } 350 | Popular Tags |