1 23 24 37 package com.sun.enterprise.server; 38 39 40 import com.sun.enterprise.resource.AdminObjectResourceDeployer; 41 import com.sun.enterprise.resource.ConnectorConnectionPoolDeployer; 42 import com.sun.enterprise.resource.ConnectorResourceDeployer; 43 import com.sun.enterprise.resource.ResourceAdapterConfigDeployer; 44 import com.sun.enterprise.resource.JdbcResourceDeployer; 45 import com.sun.enterprise.resource.PersistenceManagerFactoryResourceDeployer; 46 import com.sun.enterprise.resource.CustomResourceDeployer; 47 import com.sun.enterprise.resource.ExternalJndiResourceDeployer; 48 import com.sun.enterprise.resource.MailResourceDeployer; 49 import com.sun.enterprise.resource.JdbcConnectionPoolDeployer; 50 import com.sun.enterprise.config.serverbeans.Resources; 51 import com.sun.enterprise.admin.event.ResourceDeployEvent; 52 import com.sun.enterprise.util.i18n.StringManager; 53 54 import java.util.logging.Logger ; 55 import java.util.logging.Level ; 56 import com.sun.logging.LogDomains; 57 58 61 class ResourceDeployerFactory { 62 63 64 private ResourceDeployer resourceAdapterConfigDeployer_ = null; 65 66 67 private ResourceDeployer adminObjectResourceDeployer_ = null; 68 69 70 private ResourceDeployer connectorResourceDeployer_ = null; 71 72 73 private ResourceDeployer connectorConnectionPoolDeployer_ = null; 74 75 76 private ResourceDeployer jdbcResourceDeployer_ = null; 77 78 79 private ResourceDeployer pmfResourceDeployer_ = null; 80 81 82 private ResourceDeployer customResourceDeployer_ = null; 83 84 85 private ResourceDeployer externalJndiResourceDeployer_ = null; 86 87 88 private ResourceDeployer mailResourceDeployer_ = null; 89 90 93 private ResourceDeployer JdbcConnectionPoolDeployer_ = null; 94 96 97 static Logger _logger = LogDomains.getLogger(LogDomains.CORE_LOGGER); 98 99 private static StringManager localStrings = 100 StringManager.getManager("com.sun.enterprise.server"); 101 102 105 ResourceDeployerFactory() { 106 this.resourceAdapterConfigDeployer_ = 107 new ResourceAdapterConfigDeployer(); 108 this.adminObjectResourceDeployer_ = new AdminObjectResourceDeployer(); 109 this.connectorResourceDeployer_ = new ConnectorResourceDeployer(); 110 this.connectorConnectionPoolDeployer_ = new ConnectorConnectionPoolDeployer(); 111 this.jdbcResourceDeployer_ = new JdbcResourceDeployer(); 112 this.pmfResourceDeployer_ = 113 new PersistenceManagerFactoryResourceDeployer(); 114 this.customResourceDeployer_ = new CustomResourceDeployer(); 115 this.externalJndiResourceDeployer_ = new ExternalJndiResourceDeployer(); 116 this.mailResourceDeployer_ = new MailResourceDeployer(); 117 121 this.JdbcConnectionPoolDeployer_ = new JdbcConnectionPoolDeployer(); 122 } 124 125 132 ResourceDeployer getResourceDeployer(String type) throws Exception { 133 134 ResourceDeployer deployer = null; 135 136 if (type.equals(ResourceDeployEvent.RES_TYPE_JDBC)) { 137 138 deployer = this.jdbcResourceDeployer_; 139 140 } else if (type.equals(ResourceDeployEvent.RES_TYPE_PMF)) { 141 142 deployer = this.pmfResourceDeployer_; 143 144 } else if (type.equals(ResourceDeployEvent.RES_TYPE_CUSTOM)) { 145 146 deployer = this.customResourceDeployer_; 147 148 } else if (type.equals(ResourceDeployEvent.RES_TYPE_EXTERNAL_JNDI)) { 149 150 deployer = this.externalJndiResourceDeployer_; 151 152 } else if (type.equals(ResourceDeployEvent.RES_TYPE_MAIL)) { 153 154 deployer = this.mailResourceDeployer_; 155 156 } else if (type.equals(ResourceDeployEvent.RES_TYPE_AOR)) { 157 158 deployer = this.adminObjectResourceDeployer_; 159 160 } else if (type.equals(ResourceDeployEvent.RES_TYPE_CR)) { 161 162 deployer = this.connectorResourceDeployer_; 163 164 } else if (type.equals(ResourceDeployEvent.RES_TYPE_CCP)) { 165 166 deployer = this.connectorConnectionPoolDeployer_; 167 168 } else if (type.equals(ResourceDeployEvent.RES_TYPE_RAC)) { 169 170 deployer = this.resourceAdapterConfigDeployer_; 171 172 } else if (type.equals(ResourceDeployEvent.RES_TYPE_JCP)) { 173 deployer = this.JdbcConnectionPoolDeployer_; 177 179 } else { 180 String msg = localStrings.getString( 181 "resource.deployment.resource_type_not_implemented" ,type); 182 throw new Exception (msg); 183 } 184 185 return deployer; 186 } 187 188 197 Object getResource(String type, String name, Resources rbeans) 198 throws Exception { 199 200 return getResourceDeployer(type).getResource(name, rbeans); 201 } 202 } 203 | Popular Tags |