Methods Summary |
---|
public synchronized void | deployResource(java.lang.Object resource)Deploy the resource into the server's runtime naming context
com.sun.enterprise.config.serverbeans.CustomResource customRes =
(com.sun.enterprise.config.serverbeans.CustomResource) resource;
if (customRes.isEnabled()) {
// converts the config data to j2ee resource
J2EEResource j2eeResource =
IASJ2EEResourceFactoryImpl.toCustomJ2EEResource(customRes);
// resource installer
ResourceInstaller installer =
Switch.getSwitch().getResourceInstaller();
// installs the resource
installer.installCustomResource((CustomResource) j2eeResource);
// adds the resource to the resource collection
installer.addResource(j2eeResource);
} else {
_logger.log(Level.INFO, "core.resource_disabled",
new Object[] {customRes.getJndiName(),
IASJ2EEResourceFactoryImpl.CUSTOM_RES_TYPE});
}
|
public synchronized void | disableResource(java.lang.Object resource)Disable the resource in the server's runtime naming context
undeployResource(resource);
|
public synchronized void | enableResource(java.lang.Object resource)Enable the resource in the server's runtime naming context
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 Resources beans and converte
it to a resource object to be used by the implemented ResourceDeployer
Object res = rbeans.getCustomResourceByJndiName(name);
if (res == null) {
String msg = localStrings.getString(
"resource.no_resource",name);
throw new Exception(msg);
}
return res;
|
public synchronized void | redeployResource(java.lang.Object resource)Redeploy the resource into the server's runtime naming context
undeployResource(resource);
deployResource(resource);
|
public synchronized void | undeployResource(java.lang.Object resource)Undeploy the resource from the server's runtime naming context
// naming manager - provides jndi support
NamingManager namingMgr = Switch.getSwitch().getNamingManager();
com.sun.enterprise.config.serverbeans.CustomResource customRes =
(com.sun.enterprise.config.serverbeans.CustomResource) resource;
// converts the config data to j2ee resource
J2EEResource j2eeResource =
IASJ2EEResourceFactoryImpl.toCustomJ2EEResource(customRes);
// removes the resource from jndi naming
namingMgr.unpublishObject( j2eeResource.getName() );
// resource installer
ResourceInstaller installer = Switch.getSwitch().getResourceInstaller();
// removes the resource from the collection
installer.removeResource(j2eeResource);
|