Examples of AgentConfig


Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

    {
      validateOptions();

        try {
            final String agentName = getAgentName();
            AgentConfig agentConfig = new AgentConfig(agentName,
                getAgentPath());
            AgentManager manager = getAgentManager(agentConfig);   
           
            //validate node agent before prompting
            manager.validateNodeAgent(agentConfig, true);

            if (!isNotRunning(manager,agentConfig)) {
                CLILogger.getInstance().printDetailMessage(_strMgr.getString("TargetAlreadyRunning",
                                                                             new Object[] {agentName}));
                return;
            }
                //call getPortAndHost before getPassword()
            getPortAndHost(agentConfig);
            agentConfig.put(AgentConfig.K_DAS_USER, getUser());           
            agentConfig.put(AgentConfig.K_DAS_PASSWORD, getPassword());
            agentConfig.put(AgentConfig.K_MASTER_PASSWORD,
                            getMasterPasswordWithDefaultPrompt(manager, agentConfig));

      //Validation of admin password can only be done after synchronization, see 6304850
            manager.validateMasterPassword(agentConfig, false);
            if (getOption(S1ASCommand.PASSWORDFILE) != null ) {
                 final String adminPwdAlias =
                        RelativePathResolver.getAlias( (String)agentConfig.get(AgentConfig.K_DAS_PASSWORD));
                
                 if (adminPwdAlias!=null) {
                     final String masterPwd= (String)agentConfig.get(AgentConfig.K_MASTER_PASSWORD);
                     final String clearPwd = manager.getClearPasswordForAlias(agentConfig,masterPwd,adminPwdAlias);
                     agentConfig.put(AgentConfig.K_DAS_PASSWORD, clearPwd);
                 }
            }

            String[] extraPasswordOptions = manager.getExtraPasswordOptions(agentConfig);
            if (extraPasswordOptions != null) {
                java.util.HashMap extrapasswords = getExtraPasswords(extraPasswordOptions);
                if (getOption(S1ASCommand.PASSWORDFILE) != null && extrapasswords.size()>0) {
                    final String masterPwd = (String)agentConfig.get( AgentConfig.K_MASTER_PASSWORD);
                    for (java.util.Iterator it = extrapasswords.entrySet().iterator(); it.hasNext(); ) {
                         java.util.Map.Entry entry = (java.util.Map.Entry)it.next();
                         String optionname = (String) entry.getKey();
                         String password = (String) entry.getValue();
                         String aliasname = RelativePathResolver.getAlias(password);
                         if (aliasname != null) {
                             final String clearpwd = manager.getClearPasswordForAlias(agentConfig, masterPwd, aliasname);
                             if (clearpwd != null)
                                 entry.setValue(clearpwd);
                         }
                    }
                }
                agentConfig.put(AgentConfig.K_EXTRA_PASSWORDS, extrapasswords);
            }
           
            //System.out.println("adminUser=" + agentConfig.get(AgentConfig.K_DAS_USER) + " adminPassword=" +
            //    agentConfig.get(AgentConfig.K_DAS_PASSWORD) + " masterPassword=" +
            //    agentConfig.get(AgentConfig.K_MASTER_PASSWORD));                 

            // get override for start managed start instances
            String startInstancesOverride=getOption(START_INSTANCES_OVERRIDE);
            String syncInstancesOverride = getOption(SYNC_INSTANCES_OVERRIDE);
            String monitorInterval = getOption(MONITOR_INTERVAL_OVERRIDE);
            String restartInstancesOverride = getOption(RESTART_INSTANCES_OVERRIDE);
            CLILogger.getInstance().printDebugMessage("startInstanceOverride = "
                + startInstancesOverride);
            CLILogger.getInstance().printDebugMessage("syncInstanceOverride = "
                + syncInstancesOverride);
            CLILogger.getInstance().printDebugMessage("monitorIntervalOverride = "
                + monitorInterval);
      // add map entries for --verbose start-node-agent
      if ( getBooleanOption("verbose") ) {
                // use domain constant, because that is where PEInstancesManager looks, for now
            agentConfig.put("domain.verbose", Boolean.TRUE);
      }           
                      
            manager.startNodeAgent(startInstancesOverride, syncInstancesOverride, monitorInterval, restartInstancesOverride);
           
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

        System.out.println("usage: NodeAgentMain start|stop");
    }
   
    private static synchronized AgentConfig getConfig() {
        if (_config == null) {
            _config = new AgentConfig();
        }
        return _config;
    }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

        // FIXME: this needs to tell the user the proper place which is dictated by its config ???
        System.out.println(_strMgr.getString("nodeAgent.redirecting.output", System.getProperty("com.sun.aas.instanceRoot") + "/logs/server.log"));
        getLogger().log(Level.INFO, "nodeagent.starting.agent");

        // Read in the DAS configuration (it may not be present).
        DASPropertyReader dasReader = new DASPropertyReader(new AgentConfig());
        try {            
            dasReader.read();
            if (dasReader.getPort() != null) {
                getLogger().log(Level.CONFIG, "DAS url = " + dasReader.getJMXURL());            
            }
        } catch (Exception e) {
            getLogger().log(Level.INFO, "nodeAgent.das_properties_not_found",e);
        }

        // Read in the nodeagent configuration (it must be present).
        NodeAgentPropertyReader nodeAgentReader = new NodeAgentPropertyReader(new AgentConfig());
        try {            
            nodeAgentReader.read();
            if (nodeAgentReader.isBound() == false)
                getLogger().log(Level.CONFIG, "NodeAgent url  = " + nodeAgentReader.getJMXURL());
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

    /**
     * initialze DAS property reader
     */
    private void initDAS() {
        try {
            dasReader = new DASPropertyReader(new AgentConfig());
            dasReader.read();
        } catch (Exception e) {
            _logger.log(Level.WARNING, "nodeAgent.das_properties_not_found",e);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

    /**
     * initialze Node Agent property reader
     */
    private void initNodeAgent() {
        try {
            naReader = new NodeAgentPropertyReader(new AgentConfig());
            naReader.read();
        } catch (Exception e) {
            _logger.log(Level.WARNING, "nodeAgent.nodeagent_properties_not_found",e);
        }
    }
View Full Code Here

Examples of edu.csusm.cs671.auction.agent.config.AgentConfig

 
  public static void main(String[] args) throws IOException {

    boolean running = true;
    AgentConfig agentConfig = AgentConfigBuilder.buildAgentConfig(args[0]);
    AuctionAgent auctionAgent = new AuctionAgentImpl(agentConfig);
    auctionAgent.start();
    int id = agentConfig.getId();
    String cmd;
    Scanner scan = new Scanner(System.in);
    while(running)
    {
      System.out.print("Agent " + id +" Started");
View Full Code Here

Examples of edu.csusm.cs671.auction.agent.config.AgentConfig

  }
 
 
  public static void testAgentBid() throws FileNotFoundException, IOException{
   
    AgentConfig agentConfig = AgentConfigBuilder.buildAgentConfig("agentConfig_1.properties");
    AuctionAgent auctionAgent = new AuctionAgentImpl(agentConfig);
    auctionAgent.start();
   
    StartAuctionMessage auctionMessage = new StartAuctionMessage();
   
View Full Code Here

Examples of edu.csusm.cs671.auction.agent.config.AgentConfig

   
  }
 
  public static void testAgentWon() throws FileNotFoundException, IOException{
   
    AgentConfig agentConfig = AgentConfigBuilder.buildAgentConfig("agentConfig_1.properties");
    AuctionAgent auctionAgent = new AuctionAgentImpl(agentConfig);
    auctionAgent.start();
   
    WinnerAuctionMessage auctionMessage = new WinnerAuctionMessage();
   
View Full Code Here

Examples of org.ngrinder.infra.AgentConfig

    console1.shutdown();
  }

  @Test
  public void testStartAgentAndTest() throws InterruptedException, PersistenceException {
    AgentConfig agentConfig1 = Mockito.spy(agentConfig);
    AgentDaemon agent = new AgentDaemon(agentConfig1);
    URL scriptUrl = this.getClass().getResource("/grinder.properties");
    File scriptFile = new File(scriptUrl.getFile());
    GrinderProperties properties = new GrinderProperties(scriptFile);
    agent.run(properties);
View Full Code Here

Examples of org.ngrinder.infra.AgentConfig

      LOG.error("Error while expanding native lib", e);
    }
  }

  protected AgentConfig createAgentConfig() {
    AgentConfig agentConfig = new AgentConfig();
    agentConfig.init();
    return agentConfig;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.