Methods Summary |
---|
private java.util.List | addConfigChangeForResource(com.sun.enterprise.config.ConfigBean res)Returns config change for the given config bean.
List list = new ArrayList();
if (res == null) {
return list;
}
String xpath = res.getXPath();
ConfigAdd configAdd = ConfigChangeFactory.createConfigAdd(_ctx, xpath);
list.add(configAdd);
return list;
|
com.sun.enterprise.config.ConfigBean | findResource(java.lang.String resName, java.lang.String type)Locates a resource based on name and type.
ConfigBean res = null;
Resources root = ((Domain)_ctx.getRootConfigBean()).getResources();
if (ResourceDeployEvent.RES_TYPE_JDBC.equals(type)) {
res = root.getJdbcResourceByJndiName(resName);
} else if (ResourceDeployEvent.RES_TYPE_MAIL.equals(type)) {
res = root.getMailResourceByJndiName(resName);
} else if (ResourceDeployEvent.RES_TYPE_CUSTOM.equals(type)) {
res = root.getCustomResourceByJndiName(resName);
} else if (ResourceDeployEvent.RES_TYPE_EXTERNAL_JNDI.equals(type)) {
res = root.getExternalJndiResourceByJndiName(resName);
} else if (ResourceDeployEvent.RES_TYPE_PMF.equals(type)) {
res = root.getPersistenceManagerFactoryResourceByJndiName(resName);
} else if (ResourceDeployEvent.RES_TYPE_AOR.equals(type)) {
res = root.getAdminObjectResourceByJndiName(resName);
} else if (ResourceDeployEvent.RES_TYPE_CR.equals(type)) {
res = root.getConnectorResourceByJndiName(resName);
} else if (ResourceDeployEvent.RES_TYPE_JCP.equals(type)) {
res = root.getJdbcConnectionPoolByName(resName);
} else if (ResourceDeployEvent.RES_TYPE_CCP.equals(type)) {
res = root.getConnectorConnectionPoolByName(resName);
} else if (ResourceDeployEvent.RES_TYPE_RAC.equals(type)) {
res = root.getResourceAdapterConfigByResourceAdapterName(resName);
}
return res;
|
com.sun.enterprise.config.serverbeans.ResourceAdapterConfig | findResourceAdapterConfigByName(java.lang.String name)Returns the resource adapter config if it matches the given
application name. RA in an EAR is defined as AppName#RAName.
This method matches with the AppName.
// all resources
Resources root = ((Domain)_ctx.getRootConfigBean()).getResources();
// all resource adapter configs in the system
ResourceAdapterConfig[] configs = root.getResourceAdapterConfig();
if (configs != null) {
for (int i=0; i<configs.length; i++) {
String fullRAName = configs[i].getResourceAdapterName();
String raName = getApplicationNameFromRAName(fullRAName);
if (raName.equals(name)) {
return configs[i];
}
}
}
// did not find any RA config that matches the name
return null;
|
java.lang.String | getApplicationNameFromRAName(java.lang.String fullRAName)Returns the application name from a RA name. RA name is defined
as AppName#RAName. This method returns the AppName.
String appName = null;
// strip off the portion after #
int idx = fullRAName.indexOf("#");
if (idx > 0) {
appName = fullRAName.substring(0, idx);
} else {
appName = fullRAName;
}
return appName;
|
java.util.List | getConfigDeleteForApplication(java.lang.String applicationName)Returns the config delete change objects for an application.
List list = new ArrayList();
if (applicationName != null) {
ConfigBean app =
ApplicationHelper.findApplication(_ctx,applicationName);
String xpath = app.getXPath();
ConfigDelete configDelete =
ConfigChangeFactory.createConfigDelete(xpath);
list.add(configDelete);
}
return list;
|
java.util.List | getConfigDeleteForResource(java.lang.String resName, java.lang.String resTypeInEvent)Returns the config delete objects for the given resource.
// type is used in finding resource since resource
// name space is not flat
ConfigBean res = findResource(resName, resTypeInEvent);
return getConfigDeleteForResource(res);
|
java.util.List | getConfigDeleteForResource(com.sun.enterprise.config.ConfigBean res)Creates ConfigDelete change object for referenced resource.
List list = new ArrayList();
if (res == null) {
return list;
}
String xpath = res.getXPath();
ConfigDelete configDelete=ConfigChangeFactory.createConfigDelete(xpath);
list.add(configDelete);
return list;
|
java.util.List | resolveApplications(java.lang.String applicationName, java.lang.String action)Resolves application dependencies.
List list = new ArrayList();
if (applicationName == null
|| BaseDeployEvent.REMOVE_REFERENCE.equals(action)
|| BaseDeployEvent.REDEPLOY.equals(action)
|| BaseDeployEvent.UNDEPLOY.equals(action)) {
return list;
}
ConfigBean app=ApplicationHelper.findApplication(_ctx,applicationName);
if (app == null) {
return list;
}
// xpath for this application
String xpath = app.getXPath();
// config change object for the application entry
ConfigAdd configAdd = ConfigChangeFactory.createConfigAdd(_ctx, xpath);
list.add(configAdd);
// add resource adapter config
ResourceAdapterConfig raConfig =
findResourceAdapterConfigByName(applicationName);
// if resource adapter config is found
if (raConfig != null) {
ConfigAdd raConfigChange =
ConfigChangeFactory.createConfigAdd(_ctx, raConfig.getXPath());
// add the resource adapter config to the dependent config changes
list.add(raConfigChange);
}
return list;
|
private java.util.List | resolveConnectorConnectionPool(java.lang.String poolName)Returns dependency list for a connector connection pool.
List list = new ArrayList();
if (poolName == null) {
return list;
}
Resources root = ((Domain)_ctx.getRootConfigBean()).getResources();
ConnectorConnectionPool pool =
root.getConnectorConnectionPoolByName(poolName);
if (pool == null) {
return list;
}
list.addAll( addConfigChangeForResource(pool) );
return list;
|
private java.util.List | resolveJdbcConnectionPool(java.lang.String poolName)Returns dependency list for jdbc connection pool.
List list = new ArrayList();
if (poolName == null) {
return list;
}
Resources root = ((Domain)_ctx.getRootConfigBean()).getResources();
JdbcConnectionPool pool = root.getJdbcConnectionPoolByName(poolName);
// no pool found
if (pool == null) {
return list;
}
list.addAll( addConfigChangeForResource(pool) );
return list;
|
java.util.List | resolveResources(java.lang.String resName, java.lang.String action, java.lang.String typeInEvent)Resolves resource dependencies for resource creation.
Dependencies:
JDBC Resource - Depends on JDBC connection pool.
Persistence Manager Factory - Depends on JDBC resource.
Connector Resource - Depends on Connector connection pool.
List list = new ArrayList();
if (resName == null
//|| BaseDeployEvent.REDEPLOY.equals(action)
|| BaseDeployEvent.REMOVE_REFERENCE.equals(action)
|| BaseDeployEvent.UNDEPLOY.equals(action)) {
return list;
}
ConfigBean res = findResource(resName, typeInEvent);
if (res == null) {
return list;
}
/*
else if (BaseDeployEvent.REMOVE_REFERENCE.equals(action))
{
// add ConfigDelete change element for referenced resource
// it will not harm config because applying of changes
// will be done over runtime config
list.addAll( getConfigDeleteForResource(res) );
return list;
}
*/
// JDBC resource
if (ResourceDeployEvent.RES_TYPE_JDBC.equals(typeInEvent)) {
String poolName = ((JdbcResource) res).getPoolName();
list.addAll(resolveJdbcConnectionPool(poolName));
// Connector resource
} else if (ResourceDeployEvent.RES_TYPE_CR.equals(typeInEvent)) {
String poolName = ((ConnectorResource) res).getPoolName();
list.addAll(resolveConnectorConnectionPool(poolName));
// PMF resource
} else if (ResourceDeployEvent.RES_TYPE_PMF.equals(typeInEvent)) {
String jdbcResName = ((PersistenceManagerFactoryResource) res).
getJdbcResourceJndiName();
list.addAll( resolveResources(jdbcResName, action,
ResourceDeployEvent.RES_TYPE_JDBC) );
}
list.addAll( addConfigChangeForResource(res) );
return list;
|