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


Java Facet類代碼示例

本文整理匯總了Java中org.sonatype.nexus.repository.Facet的典型用法代碼示例。如果您正苦於以下問題:Java Facet類的具體用法?Java Facet怎麽用?Java Facet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Facet類屬於org.sonatype.nexus.repository包,在下文中一共展示了Facet類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
@Override
@Transitions(from = NEW, to = INITIALISED)
public void init(final Configuration configuration) throws Exception {
  this.configuration = checkNotNull(configuration);
  this.name = configuration.getRepositoryName();

  MultipleFailures failures = new MultipleFailures();
  for (Facet facet : facets) {
    try {
      log.debug("Initializing facet: {}", facet);
      facet.init();
    }
    catch (Throwable t) {
      log.error("Failed to initialize facet: {}", facet, t);
      failures.add(t);
    }
  }
  failures.maybePropagate("Failed to initialize facets");
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:20,代碼來源:RepositoryImpl.java

示例2: update

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
@Override
@Guarded(by = STOPPED)
public void update(final Configuration configuration) throws Exception {
  checkNotNull(configuration);

  // Ensure configuration sanity
  validate(configuration);
  this.configuration = configuration;

  MultipleFailures failures = new MultipleFailures();
  for (Facet facet : facets) {
    try {
      log.debug("Updating facet: {}", facet);
      facet.update();
    }
    catch (Throwable t) {
      log.error("Failed to update facet: {}", facet, t);
      failures.add(t);
    }
  }
  failures.maybePropagate("Failed to update facets");
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:23,代碼來源:RepositoryImpl.java

示例3: start

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
@Override
@Transitions(from = {INITIALISED, STOPPED}, to = STARTED)
public void start() throws Exception {
  MultipleFailures failures = new MultipleFailures();
  for (Facet facet : facets) {
    try {
      log.debug("Starting facet: {}", facet);
      facet.start();
    }
    catch (Throwable t) {
      log.error("Failed to start facet: {}", facet, t);
      failures.add(t);
    }
  }
  failures.maybePropagate("Failed to start facets");

  eventManager.post(new RepositoryStartedEvent(this));
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:19,代碼來源:RepositoryImpl.java

示例4: stop

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
@Override
@Transitions(from = STARTED, to = STOPPED)
public void stop() throws Exception {
  MultipleFailures failures = new MultipleFailures();

  for (Facet facet : facets.reverse()) {
    try {
      log.debug("Stopping facet: {}", facet);
      facet.stop();
    }
    catch (Throwable t) {
      log.error("Failed to stop facet: {}", facet, t);
      failures.add(t);
    }
  }
  failures.maybePropagate("Failed to stop facets");

  eventManager.post(new RepositoryStoppedEvent(this));
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:20,代碼來源:RepositoryImpl.java

示例5: delete

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
@Override
@Transitions(from = STOPPED, to = DELETED)
public void delete() throws Exception {
  MultipleFailures failures = new MultipleFailures();

  for (Facet facet : facets.reverse()) {
    try {
      log.debug("Deleting facet: {}", facet);
      facet.delete();
    }
    catch (Throwable t) {
      log.error("Failed to delete facet: {}", facet, t);
      failures.add(t);
    }
  }
  failures.maybePropagate("Failed to delete facets");
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:18,代碼來源:RepositoryImpl.java

示例6: destroy

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
@Override
@Transitions(to = DESTROYED)
public void destroy() throws Exception {
  if (states.is(STARTED)) {
    stop();
  }

  MultipleFailures failures = new MultipleFailures();
  for (Facet facet : facets.reverse()) {
    try {
      log.debug("Destroying facet: {}", facet);
      facet.destroy();
    }
    catch (Throwable t) {
      log.error("Failed to destroy facet: {}", facet, t);
      failures.add(t);
    }
  }
  failures.maybePropagate("Failed to destroy facets");

  facets.clear();
  configuration = null;

  eventManager.post(new RepositoryDestroyedEvent(this));
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:26,代碼來源:RepositoryImpl.java

示例7: exposedTypes

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
/**
 * Returns list of all types of given root type which implement {@link Facet}
 * and are marked with {@link Facet.Exposed}.
 */
@SuppressWarnings("unchecked")
private List<Class<? extends Facet>> exposedTypes(final Class<? extends Facet> root) {
  List<Class<? extends Facet>> exposed = Lists.newArrayList();

  for (Class<?> type : TypeToken.of(root).getTypes().rawTypes()) {
    if (Facet.class.isAssignableFrom(type)) {
      for (Annotation annotation : type.getDeclaredAnnotations()) {
        if (annotation.annotationType() == Facet.Exposed.class) {
          exposed.add((Class<? extends Facet>) type);
        }
      }
    }
  }

  return exposed;
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:21,代碼來源:FacetLookup.java

示例8: validate

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
@Override
public void validate(final Configuration configuration) throws Exception {
  checkNotNull(configuration);

  Set<ConstraintViolation<?>> violations = new HashSet<>();
  MultipleFailures failures = new MultipleFailures();

  for (Facet facet : facets) {
    log.debug("Validating facet: {}", facet);
    try {
      facet.validate(configuration);
    }
    catch (ConstraintViolationException e) {
      log.debug("Facet validation produced violations: {}", facet, e);
      violations.addAll(e.getConstraintViolations());
    }
    catch (Throwable t) {
      log.error("Failed to validate facet: {}", facet, t);
      failures.add(t);
    }
  }
  failures.maybePropagate("Failed to validate facets");

  if (!violations.isEmpty()) {
    throw new ConstraintViolationException(violations);
  }
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:28,代碼來源:RepositoryImpl.java

示例9: attach

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
@Override
@Guarded(by = NEW)
public void attach(final Facet facet) throws Exception {
  checkNotNull(facet);
  log.debug("Attaching facet: {}", facet);
  facet.attach(this);
  facets.add(facet);
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:9,代碼來源:RepositoryImpl.java

示例10: get

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
/**
 * Get a facet instance by exposed type.
 */
@SuppressWarnings("unchecked")
@Nullable
public <T extends Facet> T get(final Class<T> type) {
  checkNotNull(type);
  return (T) exposed.get(type);
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:10,代碼來源:FacetLookup.java

示例11: optionalFacet

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
@Override
@Nonnull
public <T extends Facet> Optional<T> optionalFacet(final Class<T> type) {
  return Optional.ofNullable(facets.get(type));
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:6,代碼來源:RepositoryImpl.java

示例12: iterator

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
/**
 * List all facet instances.
 */
@Override
public Iterator<Facet> iterator() {
  return Iterators.unmodifiableIterator(facets.iterator());
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:8,代碼來源:FacetLookup.java

示例13: reverse

import org.sonatype.nexus.repository.Facet; //導入依賴的package包/類
/**
 * Returns reversed list of all facet instances.
 */
public Iterable<Facet> reverse() {
  return ImmutableList.copyOf(facets).reverse();
}
 
開發者ID:sonatype,項目名稱:nexus-public,代碼行數:7,代碼來源:FacetLookup.java


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