/** * {@inheritDoc} * * @see org.modeshape.graph.connector.RepositoryConnection#close() */ public void close() { if (stopwatch != null) { LOGGER.trace("Processing federated requests:\n" + stopwatch.getDetailedStatistics()); } // do nothing else, since we don't currently hold any state }
@GuardedBy( "mainLock" ) protected int drainUnusedConnections( int count ) { if (count <= 0) return 0; LOGGER.trace("Draining up to {0} unused repository connections to {1}", count, getSourceName()); // Drain the extra connections from those available ... Collection<ConnectionWrapper> extraConnections = new LinkedList<ConnectionWrapper>(); this.availableConnections.drainTo(extraConnections, count); for (ConnectionWrapper connection : extraConnections) { LOGGER.trace("Closing repository connection to {0}", getSourceName()); connection.getOriginal().close(); } int numClosed = extraConnections.size(); this.poolSize -= numClosed; LOGGER.trace("Drained {0} unused connections ({1} open connections remain)", numClosed, poolSize); return numClosed; }
@GuardedBy( "mainLock" ) protected int addConnectionsIfUnderCorePoolSize() throws RepositorySourceException { // Add connections ... int n = 0; while (this.poolSize < this.corePoolSize) { this.availableConnections.offer(newWrappedConnection()); ++n; } LOGGER.trace("Added {0} connection(s) to {1} in undersized pool", n, getSourceName()); return n; }
@GuardedBy( "mainLock" ) protected boolean addConnectionIfUnderCorePoolSize() throws RepositorySourceException { // Add connection ... if (this.poolSize < this.corePoolSize) { this.availableConnections.offer(newWrappedConnection()); LOGGER.trace("Added connection to {0} in undersized pool", getSourceName()); return true; } return false; }
context.getLogger(Projection.class).trace(error, msg, definition, method);
/** * {@inheritDoc} */ @Override public boolean isTerminated() { switch (this.state) { case PAUSED: case STARTED: case SHUTDOWN: if (doCheckIsTerminated()) { this.state = State.TERMINATED; logger.trace("Service \"{0}\" has terminated", getServiceName()); return true; } return false; case TERMINATED: return true; } return false; }
/** * Temporarily stop monitoring and sequencing events. This method can be called multiple times, including after the service is * {@link #start() started}. However, once the service is {@link #shutdown() shutdown}, it cannot be started or paused. * * @return this object for method chaining purposes * @throws IllegalStateException if called when the service has been {@link #shutdown() shutdown}. * @see #start() * @see #shutdown() * @see #isPaused() */ @Override public synchronized ServiceAdministrator pause() { switch (this.state) { case STARTED: logger.trace("Pausing \"{0}\"", getServiceName()); doPause(this.state); this.state = State.PAUSED; logger.trace("Paused \"{0}\"", getServiceName()); break; case PAUSED: break; case SHUTDOWN: case TERMINATED: throw new IllegalStateException(RepositoryI18n.serviceShutdowAndMayNotBePaused.text(getServiceName())); } return this; }
/** * Start monitoring and sequence the events. This method can be called multiple times, including after the service is * {@link #pause() paused}. However, once the service is {@link #shutdown() shutdown}, it cannot be started or paused. * * @return this object for method chaining purposes * @throws IllegalStateException if called when the service has been {@link #shutdown() shutdown}. * @see #pause() * @see #shutdown() * @see #isStarted() */ @Override public synchronized ServiceAdministrator start() { switch (this.state) { case STARTED: break; case PAUSED: logger.trace("Starting \"{0}\"", getServiceName()); doStart(this.state); this.state = State.STARTED; logger.trace("Started \"{0}\"", getServiceName()); break; case SHUTDOWN: case TERMINATED: throw new IllegalStateException(RepositoryI18n.serviceShutdowAndMayNotBeStarted.text(getServiceName())); } return this; }
/** * Permanently stop monitoring and sequencing events. This method can be called multiple times, but only the first call has an * effect. Once the service has been shutdown, it may not be {@link #start() restarted} or {@link #pause() paused}. * * @return this object for method chaining purposes * @see #start() * @see #pause() * @see #isShutdown() */ @Override public synchronized ServiceAdministrator shutdown() { switch (this.state) { case STARTED: case PAUSED: logger.trace("Initiating shutdown of \"{0}\"", getServiceName()); this.state = State.SHUTDOWN; doShutdown(this.state); logger.trace("Initiated shutdown of \"{0}\"", getServiceName()); isTerminated(); break; case SHUTDOWN: case TERMINATED: isTerminated(); break; } return this; }
try { reflection.invokeSetterMethodOnTarget(propertyName, streamSequencer, entry.getValue()); LOGGER.trace("Set '{0}' property from sequencer configuration on '{1}' stream sequencer implementation to {2}", propertyName, streamSequencerClass.getName(),
LOGGER.trace("Signalling termination of repository connection pool for {0}", getSourceName()); runState = TERMINATED; termination.signalAll();
@After public void afterEach() throws Exception { service.getAdministrator().shutdown(); service.getAdministrator().awaitTermination(4, TimeUnit.SECONDS); Logger.getLogger(getClass()).trace(""); }
assert sw != null; sw.stop(); logger.trace(getClass().getSimpleName() + ".execute(...) took " + sw.getTotalDuration());
assert sw != null; sw.stop(); logger.trace("MapRepositoryConnection.execute(...) took " + sw.getTotalDuration());
this.statistics.recordNodeSkipped(); if (logger.isDebugEnabled()) { logger.trace("Skipping '{0}': no sequencers matched this condition", change);
assert sw != null; sw.stop(); logger.trace("MapRepositoryConnection.execute(...) took " + sw.getTotalDuration());