DASResourcesUtilpublic class DASResourcesUtil extends ResourcesUtil This class overrides the isReferenced method in the ResourcesUtil class.
An instance of this class is always returned when ResourcesUtil.getInstance()
happens in the DAS |
Fields Summary |
---|
boolean | noReferenceCheckNeededFlags if a getConnection call is coming from the connector runtime.
Only for such a call, we should not be checking isReferenced
The reason for this is that the getConnection call might be happening
in the DAS for a jdbc resource which does not have a resource-ref in
the DAS. However, we still need to give a connection from that
resource, so we should not check for referencing info. |
Constructors Summary |
---|
protected DASResourcesUtil()
super();
| protected DASResourcesUtil(ConfigContext configContext)
super(configContext);
|
Methods Summary |
---|
public java.lang.String | getApplicationDeployLocation(java.lang.String appName)Gets the deployment location for a J2EE application.
//Use admin config context, as in DAS, the server config context would
//not have the latest config context changes until the end of the deploy
//event
ConfigContext adminConfigCtx = com.sun.enterprise.admin.server.core.
AdminService.getAdminService().getAdminContext().getAdminConfigContext();
Domain domain = null;
try {
domain = ServerBeansFactory.getDomainBean(adminConfigCtx);
} catch (ConfigException e) {
String message = localStrings.getString("error.getting.domain");
_logger.log(Level.WARNING, message + e.getMessage());
_logger.log(Level.FINE,message + e.getMessage(), e);
return null;
}
J2eeApplication app = domain.
getApplications().getJ2eeApplicationByName(appName);
return RelativePathResolver.resolvePath(app.getLocation());
| public java.lang.String | getLocation(java.lang.String moduleName)
if(moduleName == null) {
return null;
}
//Use admin config context, as in DAS, the server config context would
//not have the latest config context changes until the end of the deploy
//event
ConfigContext adminConfigCtx = com.sun.enterprise.admin.server.core.
AdminService.getAdminService().getAdminContext().getAdminConfigContext();
Domain domain = null;
try {
domain = ServerBeansFactory.getDomainBean(adminConfigCtx);
} catch (ConfigException e) {
String message = localStrings.getString("error.getting.domain");
_logger.log(Level.WARNING, message + e.getMessage());
_logger.log(Level.FINE,message + e.getMessage(), e);
return null;
}
ConnectorModule connectorModule = domain.
getApplications().getConnectorModuleByName(moduleName);
if (connectorModule == null) {
return null;
}
String connectorModuleLocation = connectorModule.getLocation();
String connectorModuleLocationResolved = RelativePathResolver.
resolvePath(connectorModuleLocation);
return connectorModuleLocationResolved;
| protected boolean | isReferenced(java.lang.String resourceName)Returns true if the given resource is referenced by this server.
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("isReferenced in DASResourcesUtil:: " + resourceName);
}
if (noReferenceCheckNeeded) {
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("getConnectionFromConnectorRuntime :: true");
}
return true;
}
return super.isReferenced( resourceName );
| public static void | resetAdminConfigContext()
localResourcesUtil.set(null);
| public static void | setAdminConfigContext()
if(!isDAS()){
String message = localStrings.getString("cannot.set.admin.context");
throw new ConfigException(message);
}
DASResourcesUtil resUtil = new DASResourcesUtil(com.sun.enterprise.admin.server.core.
AdminService.getAdminService().getAdminContext().getAdminConfigContext());
resUtil.noReferenceCheckNeeded = true;
localResourcesUtil.set(resUtil);
|
|