Package com.cloud.utils.component

Examples of com.cloud.utils.component.ComponentLocator$ComponentInfo


        taskMgr.popCheckPoint(taskId);
        assertNull(maidDao.findById(taskId));
    }
   
    public void testSimulatedReboot() throws Exception {
        ComponentLocator locator = ComponentLocator.getCurrentLocator();
       
        CheckPointManagerImpl taskMgr = ComponentLocator.inject(CheckPointManagerImpl.class);
        assertTrue(taskMgr.configure("TaskManager", new HashMap<String, Object>()));
        assertTrue(taskMgr.start());
       
        MockMaid maid = new MockMaid();
        maid.setValue("first");
        long taskId = taskMgr.pushCheckPoint(maid);
       
        StackMaidDao maidDao = locator.getDao(StackMaidDao.class);
        CheckPointVO task = maidDao.findById(taskId);
       
        assertEquals(task.getDelegate(), MockMaid.class.getName());
        MockMaid retrieved = (MockMaid)SerializerHelper.fromSerializedString(task.getContext());
        assertEquals(retrieved.getValue(), maid.getValue());
View Full Code Here


       
        assertNull(MockMaid.map.get(maid.getSeq()));
    }
   
    public void testTakeover() throws Exception {
        ComponentLocator locator = ComponentLocator.getCurrentLocator();
       
        CheckPointManagerImpl taskMgr = ComponentLocator.inject(CheckPointManagerImpl.class);
        assertTrue(taskMgr.configure("TaskManager", new HashMap<String, Object>()));
        assertTrue(taskMgr.start());
       
        MockMaid delegate = new MockMaid();
        delegate.setValue("first");
        long taskId = taskMgr.pushCheckPoint(delegate);
       
        StackMaidDao maidDao = locator.getDao(StackMaidDao.class);
        CheckPointVO task = maidDao.findById(taskId);
       
        assertEquals(task.getDelegate(), MockMaid.class.getName());
        MockMaid retrieved = (MockMaid)SerializerHelper.fromSerializedString(task.getContext());
        assertEquals(retrieved.getValue(), delegate.getValue());

        Connection conn = Transaction.getStandaloneConnection();
        try {
            conn.setAutoCommit(true);
            PreparedStatement stmt = conn.prepareStatement("update stack_maid set msid=? where msid=?");
            stmt.setLong(1, 1234);
            stmt.setLong(2, ManagementServerNode.getManagementServerId());
            stmt.executeUpdate();
            stmt.close();
        } finally {
            conn.close();
        }
       
        MockClusterManager clusterMgr = (MockClusterManager)locator.getManager(ClusterManager.class);
        clusterMgr.triggerTakeover(1234);
       
        int i = 0;
        while (MockMaid.map.get(delegate.getSeq()) != null && i++ < 500) {
            Thread.sleep(1000);
View Full Code Here

            s_logger.info("Start configuring console proxy manager : " + name);
        }

        _name = name;

        ComponentLocator locator = ComponentLocator.getCurrentLocator();
        ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
        if (configDao == null) {
            throw new ConfigurationException("Unable to get the configuration dao.");
        }

        Map<String, String> configs = configDao.getConfiguration("management-server", params);

        String value = configs.get(Config.ConsoleProxyCmdPort.key());
        value = configs.get("consoleproxy.sslEnabled");
        if (value != null && value.equalsIgnoreCase("true")) {
            _sslEnabled = true;
        }

        value = configs.get(Config.ConsoleProxyCapacityScanInterval.key());
        _capacityScanInterval = NumbersUtil.parseLong(value, DEFAULT_CAPACITY_SCAN_INTERVAL);

        _capacityPerProxy = NumbersUtil.parseInt(configs.get("consoleproxy.session.max"), DEFAULT_PROXY_CAPACITY);
        _standbyCapacity = NumbersUtil.parseInt(configs.get("consoleproxy.capacity.standby"), DEFAULT_STANDBY_CAPACITY);
        _proxySessionTimeoutValue = NumbersUtil.parseInt(configs.get("consoleproxy.session.timeout"), DEFAULT_PROXY_SESSION_TIMEOUT);

        value = configs.get("consoleproxy.port");
        if (value != null) {
            _consoleProxyPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT);
        }

        value = configs.get(Config.ConsoleProxyDisableRpFilter.key());
        if (value != null && value.equalsIgnoreCase("true")) {
            _disable_rp_filter = true;
        }

        value = configs.get(Config.SystemVMUseLocalStorage.key());
        if (value != null && value.equalsIgnoreCase("true")) {
            _use_lvm = true;
        }

        value = configs.get("secondary.storage.vm");
        if (value != null && value.equalsIgnoreCase("true")) {
            _use_storage_vm = true;
        }

        if (s_logger.isInfoEnabled()) {
            s_logger.info("Console proxy max session soft limit : " + _capacityPerProxy);
            s_logger.info("Console proxy standby capacity : " + _standbyCapacity);
        }

        _instance = configs.get("instance.name");
        if (_instance == null) {
            _instance = "DEFAULT";
        }

        prepareDefaultCertificate();

        Map<String, String> agentMgrConfigs = configDao.getConfiguration("AgentManager", params);
        _mgmt_host = agentMgrConfigs.get("host");
        if (_mgmt_host == null) {
            s_logger.warn("Critical warning! Please configure your management server host address right after you have started your management server and then restart it, otherwise you won't be able to do console access");
        }

        value = agentMgrConfigs.get("port");
        _mgmt_port = NumbersUtil.parseInt(value, 8250);

        _consoleProxyAllocators = locator.getAdapters(ConsoleProxyAllocator.class);
        if (_consoleProxyAllocators == null || !_consoleProxyAllocators.isSet()) {
            throw new ConfigurationException("Unable to get proxy allocators");
        }

        _listener = new ConsoleProxyListener(this);
View Full Code Here

  @Override
  public void execute() throws ResourceUnavailableException,
      InsufficientCapacityException, ServerApiException,
      ConcurrentOperationException, ResourceAllocationException {
    ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
      NetappManager netappMgr = locator.getManager(NetappManager.class);
      try {
        List<PoolVO> poolList = netappMgr.listPools();
        ListResponse<ListVolumePoolsCmdResponse> listResponse = new ListResponse<ListVolumePoolsCmdResponse>();
        List<ListVolumePoolsCmdResponse> responses = new ArrayList<ListVolumePoolsCmdResponse>();
        for (PoolVO pool : poolList) {
View Full Code Here

  @Override
  public void execute() throws ResourceUnavailableException,
      InsufficientCapacityException, ServerApiException,
      ConcurrentOperationException, ResourceAllocationException {
    ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
      NetappManager netappMgr = locator.getManager(NetappManager.class);
      try {
        List<LunVO> lunList = netappMgr.listLunsOnFiler(poolName);
        ListResponse<ListLunsCmdResponse> listResponse = new ListResponse<ListLunsCmdResponse>();
        List<ListLunsCmdResponse> responses = new ArrayList<ListLunsCmdResponse>();
        for (LunVO lun : lunList) {
View Full Code Here

    @Override
    public void execute() throws ResourceUnavailableException,
    InsufficientCapacityException, ServerApiException,
    ConcurrentOperationException, ResourceAllocationException {
      ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
      NetappManager netappMgr = locator.getManager(NetappManager.class);
      try {
      netappMgr.destroyLunOnFiler(path);
        DeleteLUNCmdResponse response = new DeleteLUNCmdResponse();
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
View Full Code Here

  @Override
  public void execute() throws ResourceUnavailableException,
      InsufficientCapacityException, ServerApiException,
      ConcurrentOperationException, ResourceAllocationException {
    ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
      NetappManager netappMgr = locator.getManager(NetappManager.class);
     
      try {
        List<NetappVolumeVO> volumes = netappMgr.listVolumesOnFiler(poolName);
        ListResponse<ListVolumesOnFilerCmdResponse> listResponse = new ListResponse<ListVolumesOnFilerCmdResponse>();
        List<ListVolumesOnFilerCmdResponse> responses = new ArrayList<ListVolumesOnFilerCmdResponse>();
View Full Code Here

        _routingHost = (value != null) ? Long.parseLong(value) : null;

        value = (String)params.get(Host.Type.Storage.toString());
        _storageHost = (value != null) ? Long.parseLong(value) : null;
       
        ComponentLocator _locator = ComponentLocator.getCurrentLocator();
        _hostDao = _locator.getDao(HostDao.class);
       
        _name = name;
       
        return true;
    }
View Full Code Here

    return s_name;
  }
 
    @Override
    public void execute(){
      ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
      NetappManager netappMgr = locator.getManager(NetappManager.class);
     
      try {
        AssociateLunCmdResponse response = new AssociateLunCmdResponse();
        String returnVals[] = null;
        returnVals = netappMgr.associateLun(getGuestIQN(), getLunName());
View Full Code Here

  }

  public boolean configure(String name, Map<String, Object> params)
      throws ConfigurationException {
    super.configure(name, params);
    ComponentLocator locator = ComponentLocator.getLocator(ManagementServer.Name);
    _userAccountDao = locator.getDao(UserAccountDao.class);
    return true;
  }
View Full Code Here

TOP

Related Classes of com.cloud.utils.component.ComponentLocator$ComponentInfo

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.