本文整理汇总了Java中org.mortbay.component.LifeCycle类的典型用法代码示例。如果您正苦于以下问题:Java LifeCycle类的具体用法?Java LifeCycle怎么用?Java LifeCycle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LifeCycle类属于org.mortbay.component包,在下文中一共展示了LifeCycle类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: publishServerAsAService
import org.mortbay.component.LifeCycle; //导入依赖的package包/类
private ServiceRegistration publishServerAsAService(Server server) {
Properties props = new Properties();
// put some extra properties to easily identify the service
props.put(Constants.SERVICE_VENDOR, "Spring Dynamic Modules");
props.put(Constants.SERVICE_DESCRIPTION, "Jetty " + Server.getVersion());
props.put(Constants.BUNDLE_VERSION, Server.getVersion());
props.put(Constants.BUNDLE_NAME, bundleContext.getBundle().getSymbolicName());
// spring-dm specific property
props.put("org.springframework.osgi.bean.name", "jetty-server");
// publish just the interfaces and the major classes (server/handlerWrapper)
String[] classes = new String[] { Server.class.getName(), HandlerWrapper.class.getName(),
Attributes.class.getName(), HandlerContainer.class.getName(), Handler.class.getName(),
LifeCycle.class.getName() };
return bundleContext.registerService(classes, server, props);
}
示例2: setThreadPool
import org.mortbay.component.LifeCycle; //导入依赖的package包/类
/**
* Set the threadpool.
* If the {@link ThreadPool} is a {@link LifeCycle}, then it is started by this method.
*
* @param pool
*/
public void setThreadPool(ThreadPool pool)
{
try
{
if (pool instanceof LifeCycle)
if (!((LifeCycle)pool).isStarted())
((LifeCycle)pool).start();
}
catch(Exception e)
{
throw new IllegalStateException(e);
}
_threadPool = pool;
}
示例3: lifeCycleStopping
import org.mortbay.component.LifeCycle; //导入依赖的package包/类
@Override
public void lifeCycleStopping(LifeCycle arg0) {
logger.debug("Server stopping");
}
示例4: lifeCycleStopped
import org.mortbay.component.LifeCycle; //导入依赖的package包/类
@Override
public void lifeCycleStopped(LifeCycle arg0) {
notifyListeners(STOPPED_NOTIFICATION);
logger.debug("Server stopped");
}
示例5: lifeCycleStarting
import org.mortbay.component.LifeCycle; //导入依赖的package包/类
@Override
public void lifeCycleStarting(LifeCycle arg0) {
logger.debug("Server starting");
}
示例6: lifeCycleStarted
import org.mortbay.component.LifeCycle; //导入依赖的package包/类
@Override
public void lifeCycleStarted(LifeCycle arg0) {
notifyListeners(STARTED_NOTIFICATION);
logger.debug("Server started");
}
示例7: lifeCycleFailure
import org.mortbay.component.LifeCycle; //导入依赖的package包/类
@Override
public void lifeCycleFailure(LifeCycle arg0, Throwable arg1) {
logger.warn("Server failed", arg1);
}