@Override public void afterPropertiesSet() throws Exception { String name = this.threadPrefix + "@" + Integer.toHexString(hashCode()); if (this.executor == null) { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setName(name); this.executor = threadPool; } if (this.byteBufferPool == null) { this.byteBufferPool = new MappedByteBufferPool(2048, this.executor instanceof ThreadPool.SizedThreadPool ? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2 : ProcessorUtils.availableProcessors() * 2); } if (this.scheduler == null) { this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false); } if (this.executor instanceof LifeCycle) { ((LifeCycle)this.executor).start(); } this.scheduler.start(); }
@Override public void afterPropertiesSet() throws Exception { String name = this.threadPrefix + "@" + Integer.toHexString(hashCode()); if (this.executor == null) { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setName(name); this.executor = threadPool; } if (this.byteBufferPool == null) { this.byteBufferPool = new MappedByteBufferPool(2048, this.executor instanceof ThreadPool.SizedThreadPool ? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2 : ProcessorUtils.availableProcessors() * 2); } if (this.scheduler == null) { this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false); } if (this.executor instanceof LifeCycle) { ((LifeCycle)this.executor).start(); } this.scheduler.start(); }
/** * Starts the given lifecycle. * * @param l the lifecycle to start * @throws Exception if unable to start lifecycle */ protected void start(LifeCycle l) throws Exception { l.start(); }
/** * Utility to start an object if it is a LifeCycle and to convert * any exception thrown to a {@link RuntimeException} * @param object The instance to start. * @throws RuntimeException if the call to start throws an exception. */ public static void start(Object object) { if (object instanceof LifeCycle) { try { ((LifeCycle)object).start(); } catch(Exception e) { throw new RuntimeException(e); } } }
public void start() throws Exception { // Start all the managed instances in dropwizard. Set<LifeCycle> managedObjects = ImmutableSet.copyOf(environment.lifecycle().getManagedObjects()); for (LifeCycle managed : managedObjects) { managed.start(); } }
if (!lc.isRunning()) { try { lc.start(); if (_context != null) { PortMapper pm = _context.portMapper();
/** * Starts the given lifecycle. * * @param l * @throws Exception */ protected void start(LifeCycle l) throws Exception { l.start(); }
/** * Starts the given lifecycle. * * @param l * @throws Exception */ protected void start(LifeCycle l) throws Exception { l.start(); }
/** * Starts the given lifecycle. * * @param l the lifecycle to start * @throws Exception if unable to start lifecycle */ protected void start(LifeCycle l) throws Exception { l.start(); }
/** * Starts the given lifecycle. * * @param l * @throws Exception */ protected void start(LifeCycle l) throws Exception { l.start(); }
@Override public void onOpened(Connection connection) { Session session = ((HTTP2Connection)connection).getSession(); sessions.add(session); LifeCycle.start(session); }
/** * Start the managed lifecycle beans in the order they were added. * @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStart() */ @Override protected void doStart() throws Exception { for (Bean b:_beans) { if (b._managed && b._bean instanceof LifeCycle) { LifeCycle l=(LifeCycle)b._bean; if (!l.isRunning()) l.start(); } } // indicate that we are started, so that addBean will start other beans added. _started=true; super.doStart(); }
public HTTP2Connection(ByteBufferPool byteBufferPool, Executor executor, EndPoint endPoint, Parser parser, ISession session, int bufferSize) { super(endPoint, executor); this.byteBufferPool = byteBufferPool; this.parser = parser; this.session = session; this.bufferSize = bufferSize; if (PEC_MODE) executor = new TryExecutor.NoTryExecutor(executor); this.strategy = new EatWhatYouKill(producer, executor); LifeCycle.start(strategy); parser.init(ParserListener::new); }
public HTTP2Connection(ByteBufferPool byteBufferPool, Executor executor, EndPoint endPoint, Parser parser, ISession session, int bufferSize) { super(endPoint, executor); this.byteBufferPool = byteBufferPool; this.parser = parser; this.session = session; this.bufferSize = bufferSize; if (PEC_MODE) executor = new TryExecutor.NoTryExecutor(executor); this.strategy = new EatWhatYouKill(producer, executor); LifeCycle.start(strategy); parser.init(ParserListener::new); }
public void start() throws Exception { // Start all the managed instances in dropwizard. Set<LifeCycle> managedObjects = ImmutableSet.copyOf(environment.lifecycle().getManagedObjects()); for (LifeCycle managed : managedObjects) { managed.start(); } }
@Override protected void doStart() throws Exception { super.doStart(); if (_threadPool == null) { _threadPool = getServer().getThreadPool(); _privateThreadPool = false; } if (_threadPool instanceof LifeCycle && !((LifeCycle)_threadPool).isRunning()) ((LifeCycle)_threadPool).start(); _selectorManager.start(); }
@Override protected void doStart() throws Exception { super.doStart(); if (_threadPool == null) { _threadPool = getServer().getThreadPool(); _privateThreadPool = false; } if (_threadPool instanceof LifeCycle && !((LifeCycle)_threadPool).isRunning()) ((LifeCycle)_threadPool).start(); _selectorManager.start(); }
@Override protected void doStart() throws Exception { super.doStart(); if (_threadPool == null) { _threadPool = getServer().getThreadPool(); _privateThreadPool = false; } if (_threadPool instanceof LifeCycle && !((LifeCycle)_threadPool).isRunning()) ((LifeCycle)_threadPool).start(); _selectorManager.start(); }
@Override protected void doStart() throws Exception { super.doStart(); if (_threadPool == null) { _threadPool = getServer().getThreadPool(); _privateThreadPool = false; } if (_threadPool instanceof LifeCycle && !((LifeCycle)_threadPool).isRunning()) ((LifeCycle)_threadPool).start(); _selectorManager.start(); }
@Override protected void doStart() throws Exception { super.doStart(); if (_threadPool == null) { _threadPool = getServer().getThreadPool(); _privateThreadPool = false; } if (_threadPool instanceof LifeCycle && !((LifeCycle)_threadPool).isRunning()) ((LifeCycle)_threadPool).start(); _selectorManager.start(); }