org.eclipse.jetty.util.component.LifeCycle.start()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.eclipse.jetty.util.component.LifeCycle.start()方法的一些代码示例,展示了LifeCycle.start()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LifeCycle.start()方法的具体详情如下:
包路径:org.eclipse.jetty.util.component.LifeCycle
类名称:LifeCycle
方法名:start

LifeCycle.start介绍

[英]Starts the component.
[中]启动组件。

代码示例

代码示例来源:origin: spring-projects/spring-framework

@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();
}

代码示例来源:origin: org.springframework/spring-web

@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();
}

代码示例来源:origin: org.eclipse.jetty/jetty-util

/**
 * 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();
}

代码示例来源:origin: org.eclipse.jetty/jetty-util

/**
 * 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);
    }
  }
}

代码示例来源:origin: HubSpot/Singularity

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();
 }
}

代码示例来源:origin: i2p/i2p.i2p

if (!lc.isRunning()) {
  try {
    lc.start();
    if (_context != null) {
      PortMapper pm = _context.portMapper();

代码示例来源:origin: Nextdoor/bender

/**
 * Starts the given lifecycle.
 *
 * @param l
 * @throws Exception
 */
protected void start(LifeCycle l) throws Exception
{
  l.start();
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Starts the given lifecycle.
 *
 * @param l
 * @throws Exception
 */
protected void start(LifeCycle l) throws Exception
{
  l.start();
}

代码示例来源:origin: jenkinsci/winstone

/**
 * 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();
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Starts the given lifecycle.
 *
 * @param l
 * @throws Exception
 */
protected void start(LifeCycle l) throws Exception
{
  l.start();
}

代码示例来源:origin: jenkinsci/winstone

@Override
public void onOpened(Connection connection)
{
  Session session = ((HTTP2Connection)connection).getSession();
  sessions.add(session);
  LifeCycle.start(session);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

/**
 * 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();
}

代码示例来源:origin: org.eclipse.jetty.http2/http2-common

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);
}

代码示例来源:origin: jenkinsci/winstone

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);
}

代码示例来源:origin: com.hubspot/SingularityService

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();
 }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

@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();
}

代码示例来源:origin: org.eclipse.jetty/server

@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();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

@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();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

@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();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

@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();
}

相关文章