FileDocCategorySizeDatePackage
PERemoteTargetResolver.javaAPI DocGlassfish v2 API5331Fri May 04 22:34:40 BST 2007com.sun.enterprise.diagnostics

PERemoteTargetResolver

public class PERemoteTargetResolver extends TargetResolver
author
mu125243

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 voiddetermineInstances()

        addInstance(TargetType.DAS.getType());
    
protected voiddetermineRepositoryDetails()

          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 voiddetermineTargetType()

        if(type == null)
            setTargetType(TargetType.DAS);
    
protected com.sun.enterprise.server.ServerContextgetServerContext()

        return ApplicationServer.getServerContext();
    
protected voidsetExecutionContext()

        context = ExecutionContext.REMOTE_EC;
    
public booleanvalidateTarget()

        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");