當前位置: 首頁>>代碼示例>>Java>>正文


Java Container.getProfileVersion方法代碼示例

本文整理匯總了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();
    }
}
 
開發者ID:tdiesler,項目名稱:fabric8poc,代碼行數:25,代碼來源:ProfileServiceImpl.java

示例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);
        }
    };
}
 
開發者ID:tdiesler,項目名稱:fabric8poc,代碼行數:24,代碼來源:ContainerServiceImpl.java

示例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);
        }
    };
}
 
開發者ID:tdiesler,項目名稱:fabric8poc,代碼行數:24,代碼來源:ContainerServiceImpl.java

示例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;
}
 
開發者ID:tdiesler,項目名稱:fabric8poc,代碼行數:20,代碼來源:ContainerServiceImpl.java

示例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);
}
 
開發者ID:tdiesler,項目名稱:fabric8poc,代碼行數:14,代碼來源:ContainerServiceImpl.java

示例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);
}
 
開發者ID:tdiesler,項目名稱:fabric8poc,代碼行數:14,代碼來源:ContainerServiceImpl.java

示例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();
    }
}
 
開發者ID:tdiesler,項目名稱:fabric8poc,代碼行數:14,代碼來源:ContainerServiceImpl.java

示例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);
}
 
開發者ID:tdiesler,項目名稱:fabric8poc,代碼行數:12,代碼來源:ContainerServiceImpl.java


注:本文中的io.fabric8.api.Container.getProfileVersion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。