@Override protected ConcurrentEnvironment initialize(Thread key, UncaughtExceptionHandler params) { if (key.getState() == State.TERMINATED) { //send an exception... params.uncaughtException(key, new ThreadDeath()); } if (key.isInterrupted()) { params.uncaughtException(key, new InterruptedException()); } X_Log.debug("Initializing Concurrent Environment", key); return initializeEnvironment(key, params); } @Override
public synchronized void forwardTo(LineReader callback) { X_Log.debug(getClass(),getClass().getName(),"forwardingTo", callback.getClass().getName(),":", callback); if (b != null) {// not null only after we have started streaming callback.onStart(); for (String line : X_String.splitNewLine(b.toString())) { callback.onLine(line); } } delegates.give(callback); if (finished) { callback.onEnd(); } }
@Override public final void onEnd() { X_Log.trace(getClass(),"ending", this); try { for (LineReader delegate : delegates.forEach()) { X_Log.debug(getClass(),"ending delegate", delegate.getClass(), delegate); delegate.onEnd(); } } finally { finished = true; onEnd0(); } synchronized (delegates) { delegates.notifyAll(); } }
File metaInf = new File(target, iface); String impl = injectables.get(iface).getName(); X_Log.debug("Injecting ",iface," -> ",impl); try{ if (metaInf.exists()){
@Override public LocalArtifactResult loadLocalArtifact(String groupId, String artifactId, String classifier, String extension, String version) { Moment before = X_Time.now(); RepositorySystemSession session = this.session.get(); DefaultArtifact artifact = new DefaultArtifact( groupId,artifactId,classifier, X_String.isEmpty(extension) ? "jar" : extension, version); try { LocalArtifactRequest request = new LocalArtifactRequest(artifact, null, null); return session.getLocalRepositoryManager().find(session, request); } finally { if (X_Log.loggable(LogLevel.DEBUG)) { X_Log.debug("Resolved: " + artifact.toString() + " in " + X_Time.difference(before)); } } }
@Override public ArtifactResult loadArtifact(String groupId, String artifactId, String classifier, String extension, String version) { Moment before = X_Time.now(); RepositorySystem repoSystem = this.repoSystem.get(); RepositorySystemSession session = this.session.get(); DefaultArtifact artifact = new DefaultArtifact( groupId,artifactId,classifier, X_String.isEmpty(extension) ? "jar" : extension, version); try { ArtifactRequest request = new ArtifactRequest(artifact, remoteRepos(), null); return repoSystem.resolveArtifact(session, request); } catch (ArtifactResolutionException e) { X_Log.log(getClass(), getLogLevel(), "Resolved? ", e.getResult().isResolved(), e.getResult().getExceptions()); X_Log.log(getClass(), getLogLevel(), "Could not download " + artifact, e); throw X_Debug.rethrow(e); } finally { if (X_Log.loggable(LogLevel.DEBUG)) { X_Log.debug("Resolved: " + artifact.toString() + " in " + X_Time.difference(before)); } } }