private synchronized void activateProfile(boolean validate) throws Exception { if (this.profileService == null) { throw new IllegalStateException("Must configure the ProfileService"); } ProfileKey profKey = getProfileKey(); if (this.profileService.getActiveProfileKeys().contains(profKey) == false) { this.profileService.activateProfile(profKey); if (validate) { // Validate if the activation was successful this.profileService.validateProfile(profKey); } this.activated = true; } else { log.warn("Profile " + profKey + " is already activated"); this.activated = true; } }
/** * {@inheritDoc} */ public synchronized void activateProfile() throws Exception { if (this.profileService == null) { throw new IllegalStateException("Must configure the ProfileService"); } if (!this.activated) { try { this.profileService.activateProfile(getProfileKey()); // Validate if the activation was successful this.profileService.validateProfile(getProfileKey()); this.activated = true; } catch (NoSuchProfileException e) { handleNoSuchProfileException(e); } } }
this.profileService.activateProfile(profKey);
/** * start() * * @throws Exception */ public void start() throws Exception { Profile profile = new TransientDeploymentsProfile(); TRANSIENT_PROFILE_KEY = this.ps.registerProfile(new EmptyProfileMetaData(TRANSIENT_PROFILE_KEY.getName()), profile); this.ps.activateProfile(TRANSIENT_PROFILE_KEY); this.ps.validateProfile(TRANSIENT_PROFILE_KEY); }