AdminObjectResourceDeployerpublic class AdminObjectResourceDeployer extends GlobalResourceDeployer implements com.sun.enterprise.server.ResourceDeployer
Fields Summary |
---|
static Logger | _logger |
Methods Summary |
---|
public synchronized void | deployResource(java.lang.Object resource)Deploy the resource into the server's runtime naming context
final AdminObjectResource aor =
(com.sun.enterprise.config.serverbeans.AdminObjectResource)resource;
final ConnectorRuntime crt = ConnectorRuntime.getRuntime();
if (aor.isEnabled()) {
//registers the jsr77 object for the mail resource deployed
final ManagementObjectManager mgr =
getAppServerSwitchObject().getManagementObjectManager();
mgr.registerAdminObjectResource(aor.getJndiName(),
aor.getResAdapter(), aor.getResType(),
getPropNamesAsStrArr(aor.getElementProperty()),
getPropValuesAsStrArr(aor.getElementProperty()));
} else {
_logger.log(Level.INFO, "core.resource_disabled",
new Object[] {aor.getJndiName(),
IASJ2EEResourceFactoryImpl.JMS_RES_TYPE});
}
_logger.log(Level.FINE,
"Calling backend to add adminObject",aor.getJndiName());
crt.addAdminObject(null,aor.getResAdapter(),aor.getJndiName(),
aor.getResType(),transformProps(aor.getElementProperty()));
_logger.log(Level.FINE,
"Added adminObject in backend",aor.getJndiName());
| public synchronized void | disableResource(java.lang.Object resource)
| public synchronized void | enableResource(java.lang.Object resource)
| public java.lang.Object | getResource(java.lang.String name, com.sun.enterprise.config.serverbeans.Resources rbeans)
Object res = rbeans.getAdminObjectResourceByJndiName(name);
if (res == null) {
Exception ex = new Exception("No such resource");
_logger.log(Level.SEVERE,"no_resource",name);
_logger.log(Level.SEVERE,"",ex);
throw ex;
}
return res;
| public synchronized void | redeployResource(java.lang.Object resource)
| java.util.Properties | transformProps(com.sun.enterprise.config.serverbeans.ElementProperty[] domainProps)
Properties props = new Properties();
for (ElementProperty domainProp : domainProps) {
props.setProperty(domainProp.getName(), domainProp.getValue());
}
return props;
| public synchronized void | undeployResource(java.lang.Object resource)d
final AdminObjectResource aor =
(com.sun.enterprise.config.serverbeans.AdminObjectResource)resource;
final ConnectorRuntime crt = ConnectorRuntime.getRuntime();
_logger.log(Level.FINE,
"Calling backend to delete adminObject",aor.getJndiName());
crt.deleteAdminObject(aor.getJndiName());
_logger.log(Level.FINE,
"Deleted adminObject in backend",aor.getJndiName());
//unregister the managed object
final ManagementObjectManager mgr =
getAppServerSwitchObject().getManagementObjectManager();
mgr.unregisterAdminObjectResource(aor.getJndiName(), aor.getResType());
|
|