Package com.sun.enterprise.admin.util

Examples of com.sun.enterprise.admin.util.TokenValueSet


   
    /** Creates a new instance of TokenReplacementTester */
    private final LineTokenReplacer replacer;
   
    public TokenReplacementTester(String tokensFileName, String fromFile, String toFile) {
        final TokenValueSet tokens = getTokensFromFile(tokensFileName);
        replacer = new LineTokenReplacer(tokens);
        replacer.replace(fromFile, toFile);
    }
View Full Code Here


        replacer = new LineTokenReplacer(tokens);
        replacer.replace(fromFile, toFile);
    }
   
    private TokenValueSet getTokensFromFile(String fileName) {
        final TokenValueSet tokens  = new TokenValueSet();
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new FileReader(fileName));
            String line = null;
            while ((line = reader.readLine()) != null) {
                final TokenValue tv = getTokenValue(line);
                tokens.add(tv);
            }
            reader.close();
            reader = null;
        }
        catch(Exception e) {
View Full Code Here

            final String tmpFilePath    = tmpFile.getAbsolutePath();
            FileUtils.copy(serverXmlPath, tmpFilePath);

            final TokenValue tv = new TokenValue(DOCTYPE_TOKEN, dtdPath);
            System.out.println("TV = " + tv);
            final TokenValueSet ts = new TokenValueSet();
            ts.add(tv);
            final LineTokenReplacer replacer = new LineTokenReplacer(ts);
            replacer.replace(tmpFilePath, serverXmlPath);
            tmpFile.delete();
        }
        catch (Exception e) {
View Full Code Here


    private void createStopAgent() throws AgentException
    {
        try {
            final TokenValueSet tokens = EEScriptsTokens.getTokenValueSet(getAgentConfig());
            final File stopAgentTemplate = getEEFileLayout().getStopAgentTemplate();
            final File stopAgent = getEEFileLayout().getStopAgent();
            generateFromTemplate(tokens, stopAgentTemplate, stopAgent);
            //final File killServ = getEEFileLayout().getKillServTemplate();
            //generateFromTemplate(new TokenValueSet(),
View Full Code Here

    }     
      
    private void createStartAgent() throws AgentException
    {
        try {
            final TokenValueSet tokens = EEScriptsTokens.getTokenValueSet(getAgentConfig());
            final File startAgentTemplate = getEEFileLayout().getStartAgentTemplate();
            final File startAgent = getEEFileLayout().getStartAgent();
            generateFromTemplate(tokens, startAgentTemplate, startAgent);
        } catch (Exception e) {
            throw new AgentException(
View Full Code Here

    //For now there is no EE specific tokenization of domain.xml that needs
    //to be done at create-domain time. There used to be and as such this
    //class was left intact as a future placeholder
    public static TokenValueSet getTokenValueSet(DomainConfig domainConfig)
    {
        TokenValueSet tokens = PEDomainXmlTokens.getTokenValueSet(domainConfig);
        return tokens;
    }
View Full Code Here

    }       
       
    private void createStartInstance() throws InstanceException
    {
        try {
            final TokenValueSet tokens = EEScriptsTokens.getTokenValueSet(getInstanceConfig());
           
            // add/overwrite tokens for domain and cluster tokens to appropriate value for instance
            Properties props=getOverridingProperties();
            if (props != null) {
                Iterator iter=props.keySet().iterator();
                String key="";
                TokenValue tv=null;
                while(iter.hasNext()) {
                    key=(String)iter.next();
                    tv = new TokenValue(key, props.getProperty(key));
                    tokens.add(tv);           
                }
            }
           
            generateFromTemplate(tokens, getEEFileLayout().getStartInstanceTemplate(),
                getEEFileLayout().getStartInstance());
View Full Code Here

   
   
    private void createStopInstance() throws InstanceException
    {
        try {
            final TokenValueSet tokens =
                EEScriptsTokens.getTokenValueSet(getInstanceConfig());           
            generateFromTemplate(tokens,
                getEEFileLayout().getStopInstanceTemplate(),
                getEEFileLayout().getStopInstance());
            //final File killServ = getEEFileLayout().getKillServTemplate();
View Full Code Here

    public static final String CLUSTER_NAME = "CLUSTER_NAME";

    //Used to tokenize node agent start/stop scripts
    public static TokenValueSet getBaseTokenValueSet(RepositoryConfig config)
    {
        final TokenValueSet tokens = new TokenValueSet();       
        TokenValue tv = new TokenValue(CONFIG_HOME, config.getConfigRoot());
        tokens.add(tv);    
        File instanceRoot = new EEFileLayout(config).getRepositoryDir();
        // removed because on windows couldn't cd to the config directory, this is like the domain now
        //tv = new TokenValue(INSTANCE_ROOT, FileUtils.makeForwardSlashes(instanceRoot.getAbsolutePath()));       
        tv = new TokenValue(INSTANCE_ROOT, instanceRoot.getAbsolutePath());       
        tokens.add(tv);
        return tokens;
    }
View Full Code Here

    }
   
    //Used to tokenize node agent start/stop scripts
    public static TokenValueSet getTokenValueSet(AgentConfig agentConfig)
    {
        TokenValueSet tokens = getBaseTokenValueSet(agentConfig);
        TokenValue tv = new TokenValue(SERVER_NAME, agentConfig.getAgentName());
        tokens.add(tv);
        return tokens;
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.util.TokenValueSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.