PERemoteTargetResolverpublic class PERemoteTargetResolver extends TargetResolver
Fields Summary |
---|
private static final String | REPOSITORY_CONFIG_CLASS_NAME | private static final String | GET_REP_ROOT_METHOD | private static final String | GET_REP_NAME |
Constructors Summary |
---|
public PERemoteTargetResolver(String target, String repositoryDir, boolean local)Creates a new instance of PERemoteTargetResolver
super(target,repositoryDir,local);
|
Methods Summary |
---|
protected void | determineInstances()
addInstance(TargetType.DAS.getType());
| protected void | determineRepositoryDetails()
File instanceRoot = new File(getServerContext().
getInstanceEnvironment().getInstancesRoot());
repositoryDir = instanceRoot.getParentFile().getAbsolutePath();
repositoryName = instanceRoot.getName();
logger.log(Level.FINE, "diagnostic-service.resolver_repositoryDetails",
new Object[] {repositoryDir, repositoryName});
/*try {
Class classObj = Class.forName(REPOSITORY_CONFIG_CLASS_NAME);
Constructor constructorObj =
classObj.getDeclaredConstructor(new Class[]{});
Object obj = constructorObj.newInstance(new Object[]{});
Method method = classObj.getMethod(GET_REP_ROOT_METHOD, null);
repositoryDir = (String)method.invoke(obj, null);
method = classObj.getMethod(GET_REP_NAME, null);
repositoryName = (String)method.invoke(obj, null);
logger.log(Level.FINEST,
"diagnostic-service.target_dir", repositoryDir);
if(type.equals(EETargetType.INSTANCE)) {
targetDir = targetDir + File.separator + naName + File.separator + target;
} else {
targetDir = targetDir + File.separator + target;
}
} catch(Exception e){
// WILL NEVER
}*/
| protected void | determineTargetType()
if(type == null)
setTargetType(TargetType.DAS);
| protected com.sun.enterprise.server.ServerContext | getServerContext()
return ApplicationServer.getServerContext();
| protected void | setExecutionContext()
context = ExecutionContext.REMOTE_EC;
| public boolean | validateTarget()
ConfigContext configContext = getServerContext().getConfigContext();
try {
String domainName = ServerHelper.getAdministrativeDomainName(
configContext,null);
if(domainName != null)
return domainName.equals(target);
} catch(ConfigException ce) {
throw new DiagnosticException("Couldn't determine domain name");
}
throw new DiagnosticException("Couldn't determine domain name");
|
|