public void startAnalyticsServer(String [] args) {
		
		// start Executorservice
		analServerExecutionService = Executors.newCachedThreadPool();
		
		AnalyticsServerCmdListener cmdListener = new AnalyticsServerCmdListener(this);
		analServerExecutionService.execute(cmdListener);
		
		// read args
		try {
			bindingName = args[0];
		} catch (NumberFormatException e) {
			logger.error("Error: Failed read args!");
		} catch (IndexOutOfBoundsException e) {
			logger.error("Error: args was to short!");
		}
		
		readProperties();
		mClientHandler = new MClientHandler_Impl();
		
		// create remote object and export it.
		try {
			mClientHandlerStub = (MClientHandler_RO) UnicastRemoteObject.exportObject(mClientHandler, 0);
		} catch (RemoteException e) {
			logger.error("couldn't export MClientHandler_RO");
		}
		try {
			registry = LocateRegistry.getRegistry(registryHost, registryPort);
            try {
                registry.list();
                logger.info("Using registry on " + registryHost + ":" + registryPort);
            // if connection is refused, creating a new registry on the local host instead
            } catch (ConnectException ce) {
                registry = LocateRegistry.createRegistry(registryPort);
                logger.info("Registry not found on " + registryHost + ":" + registryPort
                            + ". Creating registry on the analytics server");
            }
//			// bind the remote object to the registry
//			registry = LocateRegistry.createRegistry(registryPort);
			registry.rebind(bindingName, mClientHandlerStub);
		} catch (RemoteException e) {
			logger.error("couldn't bind the Registry to port" + registryPort);
		}
	}