本文整理匯總了Java中io.fabric8.api.Container.getProfileVersion方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.getProfileVersion方法的具體用法?Java Container.getProfileVersion怎麽用?Java Container.getProfileVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.fabric8.api.Container
的用法示例。
在下文中一共展示了Container.getProfileVersion方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: removeProfileVersion
import io.fabric8.api.Container; //導入方法依賴的package包/類
@Override
public ProfileVersion removeProfileVersion(VersionIdentity version) {
assertValid();
// Lock for composite operation
LockHandle writeLock = aquireWriteLock(version);
try {
ContainerRegistry cntRegistry = containerRegistry.get();
ContainerLockManager lockManager = containerLocks.get();
for (ContainerIdentity cntid : cntRegistry.getContainerIdentities()) {
LockHandle readLock = lockManager.aquireReadLock(cntid);
try {
Container container = cntRegistry.getContainer(cntid);
VersionIdentity cntVersion = container.getProfileVersion();
IllegalStateAssertion.assertFalse(version.equals(cntVersion), "Cannot remove profile version used by: " + container);
} finally {
readLock.unlock();
}
}
ProfileRegistry registry = profileRegistry.get();
return registry.removeProfileVersion(version);
} finally {
writeLock.unlock();
}
}
示例2: aquireWriteLock
import io.fabric8.api.Container; //導入方法依賴的package包/類
private LockHandle aquireWriteLock(ContainerIdentity identity) {
final AtomicReference<LockHandle> verLock = new AtomicReference<>();
final LockHandle cntLock = containerLocks.get().aquireWriteLock(identity);
try {
Container cnt = containerRegistry.get().getContainer(identity);
VersionIdentity version = cnt != null ? cnt.getProfileVersion() : null;
if (version != null) {
verLock.set(profileService.get().aquireWriteLock(version));
}
} catch (RuntimeException rte) {
safeUnlock(cntLock, verLock);
throw rte;
} catch (Error err) {
safeUnlock(cntLock, verLock);
throw err;
}
return new LockHandle() {
@Override
public void unlock() {
safeUnlock(cntLock, verLock);
}
};
}
示例3: aquireReadLock
import io.fabric8.api.Container; //導入方法依賴的package包/類
private LockHandle aquireReadLock(ContainerIdentity identity) {
final AtomicReference<LockHandle> verLock = new AtomicReference<>();
final LockHandle cntLock = containerLocks.get().aquireReadLock(identity);
try {
Container cnt = containerRegistry.get().getContainer(identity);
VersionIdentity version = cnt != null ? cnt.getProfileVersion() : null;
if (version != null) {
verLock.set(profileService.get().aquireReadLock(version));
}
} catch (RuntimeException rte) {
safeUnlock(cntLock, verLock);
throw rte;
} catch (Error err) {
safeUnlock(cntLock, verLock);
throw err;
}
return new LockHandle() {
@Override
public void unlock() {
safeUnlock(cntLock, verLock);
}
};
}
示例4: startContainerInternal
import io.fabric8.api.Container; //導入方法依賴的package包/類
private Container startContainerInternal(Container container, ProvisionEventListener listener) throws ProvisionException {
LOGGER.info("Start container: {}", container);
if (container.getProfileVersion() == null) {
Profile defaultProfile = profileService.get().getDefaultProfile();
setVersionInternal(container, defaultProfile.getVersion(), listener);
addProfilesInternal(container, Collections.singletonList(defaultProfile.getIdentity()), listener);
}
// Start the container
ContainerRegistry registry = containerRegistry.get();
container = registry.startContainer(container.getIdentity());
// Provision the container profiles
VersionIdentity version = container.getProfileVersion();
List<ProfileIdentity> identities = container.getProfileIdentities();
provisionProfilesInternal(container, version, identities, listener);
return container;
}
示例5: addProfilesInternal
import io.fabric8.api.Container; //導入方法依賴的package包/類
private Container addProfilesInternal(Container container, List<ProfileIdentity> profiles, ProvisionEventListener listener) throws ProvisionException {
LOGGER.info("Add container profiles: {} <= {}", container, profiles);
// Provision the profiles
VersionIdentity version = container.getProfileVersion();
List<ProfileIdentity> effective = new ArrayList<>(container.getProfileIdentities());
effective.addAll(profiles);
provisionProfilesInternal(container, version, effective, listener);
// Update the references
ContainerRegistry registry = containerRegistry.get();
return registry.addProfiles(container.getIdentity(), profiles);
}
示例6: removeProfilesInternal
import io.fabric8.api.Container; //導入方法依賴的package包/類
private Container removeProfilesInternal(Container container, List<ProfileIdentity> profiles, ProvisionEventListener listener) throws ProvisionException {
LOGGER.info("Remove container profiles: {} => {}", container, profiles);
// Unprovision the profiles
VersionIdentity version = container.getProfileVersion();
List<ProfileIdentity> effective = new ArrayList<>(container.getProfileIdentities());
effective.removeAll(profiles);
provisionProfilesInternal(container, version, effective, listener);
// Update the references
ContainerRegistry registry = containerRegistry.get();
return registry.removeProfiles(container.getIdentity(), profiles);
}
示例7: getEffectiveProfile
import io.fabric8.api.Container; //導入方法依賴的package包/類
@Override
public Profile getEffectiveProfile(ContainerIdentity identity) {
assertValid();
LockHandle readLock = aquireReadLock(identity);
try {
Container container = getRequiredContainer(identity);
VersionIdentity version = container.getProfileVersion();
List<ProfileIdentity> identities = container.getProfileIdentities();
return getEffectiveProfileInternal(container, version, identities);
} finally {
readLock.unlock();
}
}
示例8: updateProfile
import io.fabric8.api.Container; //導入方法依賴的package包/類
@Override
public void updateProfile(ProfileIdentity profile, ProvisionEventListener listener) throws ProvisionException {
Container container = getCurrentContainer();
LOGGER.info("Update container profile: {} <= {}", container, profile);
// Provision the profile
VersionIdentity version = container.getProfileVersion();
List<ProfileIdentity> identities = container.getProfileIdentities();
provisionProfilesInternal(container, version, identities, listener);
}