1 64 65 package com.jcorporate.expresso.core.db.config; 66 67 import com.jcorporate.expresso.kernel.ComponentLifecycle; 68 import com.jcorporate.expresso.kernel.Configuration; 69 import com.jcorporate.expresso.kernel.exception.ConfigurationException; 70 71 86 public class JNDIConfig extends com.jcorporate.expresso.kernel.EmbeddedComponent 87 implements java.io.Serializable , ComponentLifecycle { 88 89 92 public JNDIConfig() { 93 } 94 95 98 protected String initialContextFactory = ""; 99 100 103 protected String providerURL = ""; 104 105 108 protected String securityPrincipal = ""; 109 110 113 protected String securityCredentials = ""; 114 115 118 protected String dnsURL = ""; 119 120 123 protected String securityProtocol = ""; 124 125 128 protected String securityAuthentication = ""; 129 130 133 protected String objectFactories = ""; 134 135 138 protected String stateFactories = ""; 139 140 143 protected String urlPKGPrefixes = ""; 144 145 148 protected String batchSize = ""; 149 150 153 protected String authoritative = ""; 154 155 158 protected String language = ""; 159 160 161 169 public JNDIConfig(String factory, String user, String pass, String provider) { 170 initialContextFactory = factory; 171 securityPrincipal = user; 172 securityCredentials = pass; 173 providerURL = provider; 174 } 175 176 177 182 public synchronized String getInitialContextFactory() { 183 return initialContextFactory; 184 } 185 186 191 public synchronized void setInitialContextFactory(String initialContextFactory) { 192 this.initialContextFactory = initialContextFactory; 193 } 194 195 196 201 public synchronized String getProviderURL() { 202 return providerURL; 203 } 204 205 210 public synchronized void setProviderURL(String providerURL) { 211 this.providerURL = providerURL; 212 } 213 214 215 220 public synchronized String getDnsURL() { 221 return dnsURL; 222 } 223 224 229 public synchronized void setDnsURL(String dnsURL) { 230 this.dnsURL = dnsURL; 231 } 232 233 234 239 public String getSecurityProtocol() { 240 return securityProtocol; 241 } 242 243 248 public void setSecurityProtocol(String securityProtocol) { 249 this.securityProtocol = securityProtocol; 250 } 251 252 253 258 public String getUrlPKGPrefixes() { 259 return urlPKGPrefixes; 260 } 261 262 267 public void setUrlPKGPrefixes(String urlPKGPrefixes) { 268 this.urlPKGPrefixes = urlPKGPrefixes; 269 } 270 271 272 277 public synchronized String getBatchSize() { 278 return batchSize; 279 } 280 281 286 public synchronized void setBatchSize(String batchSize) { 287 this.batchSize = batchSize; 288 } 289 290 291 296 public synchronized String getAuthoritative() { 297 return authoritative; 298 } 299 300 305 public synchronized void setAuthoritative(String authoritative) { 306 this.authoritative = authoritative; 307 } 308 309 310 315 public synchronized String getLanguage() { 316 return language; 317 } 318 319 324 public synchronized void setLanguage(String language) { 325 this.language = language; 326 } 327 328 329 334 public synchronized String getSecurityPrincipal() { 335 return securityPrincipal; 336 } 337 338 343 public synchronized void setSecurityPrincipal(String securityPrincipal) { 344 this.securityPrincipal = securityPrincipal; 345 } 346 347 348 353 public synchronized String getSecurityCredentials() { 354 return securityCredentials; 355 } 356 357 362 public synchronized void setSecurityCredentials(String securityCredentials) { 363 this.securityCredentials = securityCredentials; 364 } 365 366 367 372 public synchronized String getSecurityAuthentication() { 373 return securityAuthentication; 374 } 375 376 381 public synchronized void setSecurityAuthentication(String securityAuthentication) { 382 this.securityAuthentication = securityAuthentication; 383 } 384 385 386 391 public synchronized String getObjectFactories() { 392 return objectFactories; 393 } 394 395 400 public synchronized void setObjectFactories(String objectFactories) { 401 this.objectFactories = objectFactories; 402 } 403 404 405 410 public synchronized String getStateFactories() { 411 return stateFactories; 412 } 413 414 419 public synchronized void setStateFactories(String stateFactories) { 420 this.stateFactories = stateFactories; 421 } 422 423 426 public void initialize() { 427 } 428 429 435 public synchronized void configure(Configuration newConfig) throws ConfigurationException { 436 authoritative = (String ) newConfig.get("Authoritative"); 437 batchSize = (String ) newConfig.get("BatchSize"); 438 dnsURL = (String ) newConfig.get("DnsURL"); 439 initialContextFactory = (String ) newConfig.get("InitialContextFactory"); 440 language = (String ) newConfig.get("Language"); 441 objectFactories = (String ) newConfig.get("ObjectFactories"); 442 providerURL = (String ) newConfig.get("ProviderURL"); 443 securityAuthentication = (String ) newConfig.get("SecurityAuthentication"); 444 securityCredentials = (String ) newConfig.get("SecurityCredentials"); 445 securityPrincipal = (String ) newConfig.get("SecurityPrincipal"); 446 securityProtocol = (String ) newConfig.get("SecurityProtocol"); 447 stateFactories = (String ) newConfig.get("StateFactories"); 448 urlPKGPrefixes = (String ) newConfig.get("urlPKGPrefixes"); 449 } 450 451 458 public synchronized void reconfigure(Configuration newConfig) throws ConfigurationException { 459 authoritative = null; 460 batchSize = null; 461 dnsURL = null; 462 initialContextFactory = null; 463 language = null; 464 objectFactories = null; 465 providerURL = null; 466 securityAuthentication = null; 467 securityCredentials = null; 468 securityPrincipal = null; 469 securityProtocol = null; 470 stateFactories = null; 471 urlPKGPrefixes = null; 472 configure(newConfig); 473 } 474 475 476 479 public synchronized void destroy() { 480 authoritative = null; 481 batchSize = null; 482 dnsURL = null; 483 initialContextFactory = null; 484 language = null; 485 objectFactories = null; 486 providerURL = null; 487 securityAuthentication = null; 488 securityCredentials = null; 489 securityPrincipal = null; 490 securityProtocol = null; 491 stateFactories = null; 492 urlPKGPrefixes = null; 493 } 494 495 496 504 public String getMetadataName() { 505 return "JNDIConfig"; 506 } 507 508 } | Popular Tags |