Methods Summary |
---|
public synchronized void | deployResource(java.lang.Object resource)
//---- begin implements ResourceDeployer ----
PersistenceManagerFactoryResource configPMFRes =
(PersistenceManagerFactoryResource)resource;
if (configPMFRes.isEnabled()) {
// load associated jdbc resource with PMF
loadJdbcResource(configPMFRes);
PMFResource j2eeResource = (PMFResource)
IASJ2EEResourceFactoryImpl.toPMFJ2EEResource(configPMFRes);
ResourceInstaller installer =
Switch.getSwitch().getResourceInstaller();
installer.installPersistenceManagerResource(j2eeResource);
installer.addResource(j2eeResource);
} else {
_logger.log(Level.INFO, "core.resource_disabled",
new Object[] {configPMFRes.getJndiName(),
IASJ2EEResourceFactoryImpl.PMF_RES_TYPE});
}
|
public synchronized void | disableResource(java.lang.Object resource)
undeployResource(resource);
|
public synchronized void | enableResource(java.lang.Object resource)
deployResource(resource);
|
public java.lang.Object | getResource(java.lang.String name, com.sun.enterprise.config.serverbeans.Resources rbeans)Utility method to find a resource from a Resource bean and convert
it to a resource object to be used by ResourceDeployer implementation
Object res = rbeans.getPersistenceManagerFactoryResourceByJndiName(name);
if (res == null) {
String msg = localStrings.getString("resource.no_resource",name);
throw new Exception(msg);
}
return res;
|
private void | loadJdbcResource(com.sun.enterprise.config.serverbeans.PersistenceManagerFactoryResource cr)
String resName = cr.getJdbcResourceJndiName();
Resources resources = (Resources) cr.parent();
ConfigBean cb = resources.getJdbcResourceByJndiName(resName);
if (cb != null) {
try {
InitialContext ic = new InitialContext();
ic.lookup(resName);
} catch (Exception e) {
// resource is not loaded
JdbcResourceDeployer deployer =
new JdbcResourceDeployer();
deployer.deployResource(cb);
}
}
|
public synchronized void | redeployResource(java.lang.Object resource)
undeployResource(resource);
deployResource(resource);
|
public synchronized void | undeployResource(java.lang.Object resource)
NamingManager namingMgr = Switch.getSwitch().getNamingManager();
PersistenceManagerFactoryResource configPMFRes =
(PersistenceManagerFactoryResource)resource;
namingMgr.unpublishObject(configPMFRes.getJndiName());
ResourceInstaller installer = Switch.getSwitch().getResourceInstaller();
installer.removeResource(
IASJ2EEResourceFactoryImpl.toPMFJ2EEResource(configPMFRes));
|