private static boolean hasTargets(ReferencePatterns referencePatterns) { if (referencePatterns == null) { return false; } if (referencePatterns.isResolved()) { return true; } return !referencePatterns.getPatterns().isEmpty(); }
public final synchronized void setReferencePatterns(ReferencePatterns referencePatterns) { if (isOnline) { throw new IllegalStateException("Pattern set can not be modified while online"); } if (referencePatterns.isResolved()) { this.patterns = Collections.unmodifiableSet(Collections.singleton(new AbstractNameQuery(referencePatterns.getAbstractName()))); } else { this.patterns = Collections.unmodifiableSet(referencePatterns.getPatterns()); } }
public AbstractName findGBean(ReferencePatterns referencePatterns) throws GBeanNotFoundException { if (referencePatterns == null) throw new NullPointerException("referencePatterns is null"); if (referencePatterns.isResolved()) { return referencePatterns.getAbstractName(); } // check the local config Set<AbstractNameQuery> patterns = referencePatterns.getPatterns(); return findGBean(patterns); }
private String isVerifyReference(ReferencePatterns referencePatterns, Configuration configuration) { // we can't verify a resolved reference since it will have a specific artifact already set... // hopefully the deployer won't generate bad resolved references if (referencePatterns.isResolved()) return null; // Do not verify the reference if it has an explicit depenency on another artifact, because it it likely // that the other artifact is not in the "environment" (if it were you wouldn't use the long form) Set<AbstractNameQuery> patterns = referencePatterns.getPatterns(); for (AbstractNameQuery query : patterns) { if (query.getArtifact() != null) return null; } // attempt to find the bean try { configuration.findGBean(patterns); return null; } catch (GBeanNotFoundException e) { //TODO bug!! GERONIMO-3140 Multiple matches may be caused by using an already-loaded configuration rather than reloading one // using the client_artifact_aliases.properties which e.g. remap the server tm to the client tm. if (e.hasMatches()) { return null; } return e.getMessage(); } } }