当前位置: 首页>>代码示例>>Java>>正文


Java SharedThreadPool.getInstance方法代码示例

本文整理汇总了Java中org.jetbrains.jps.service.SharedThreadPool.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java SharedThreadPool.getInstance方法的具体用法?Java SharedThreadPool.getInstance怎么用?Java SharedThreadPool.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jetbrains.jps.service.SharedThreadPool的用法示例。


在下文中一共展示了SharedThreadPool.getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ExternalJavacProcess

import org.jetbrains.jps.service.SharedThreadPool; //导入方法依赖的package包/类
public ExternalJavacProcess() {
  final JavacRemoteProto.Message msgDefaultInstance = JavacRemoteProto.Message.getDefaultInstance();
  
  myEventLoopGroup = new NioEventLoopGroup(1, SharedThreadPool.getInstance());
  myChannelInitializer = new ChannelInitializer() {
    @Override
    protected void initChannel(Channel channel) throws Exception {
      channel.pipeline().addLast(new ProtobufVarint32FrameDecoder(),
                                 new ProtobufDecoder(msgDefaultInstance),
                                 new ProtobufVarint32LengthFieldPrepender(),
                                 new ProtobufEncoder(),
                                 new CompilationRequestsHandler()
                                 );
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ExternalJavacProcess.java

示例2: JavacServer

import org.jetbrains.jps.service.SharedThreadPool; //导入方法依赖的package包/类
public JavacServer() {
  myChannelFactory = new NioServerSocketChannelFactory(SharedThreadPool.getInstance(), SharedThreadPool.getInstance(), 1);
  final ChannelRegistrar channelRegistrar = new ChannelRegistrar();
  final ChannelHandler compilationRequestsHandler = new CompilationRequestsHandler();
  myPipelineFactory = new ChannelPipelineFactory() {
    public ChannelPipeline getPipeline() throws Exception {
      return Channels.pipeline(
        channelRegistrar,
        new ProtobufVarint32FrameDecoder(),
        new ProtobufDecoder(JavacRemoteProto.Message.getDefaultInstance()),
        new ProtobufVarint32LengthFieldPrepender(),
        new ProtobufEncoder(),
        compilationRequestsHandler
      );
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:JavacServer.java

示例3: JavacServerClient

import org.jetbrains.jps.service.SharedThreadPool; //导入方法依赖的package包/类
public JavacServerClient() {
  super(JavacRemoteProto.Message.getDefaultInstance(), SharedThreadPool.getInstance(), new UUIDGetter() {
    @NotNull
    public UUID getSessionUUID(@NotNull MessageEvent e) {
      final JavacRemoteProto.Message message = (JavacRemoteProto.Message)e.getMessage();
      final JavacRemoteProto.Message.UUID uuid = message.getSessionId();
      return new UUID(uuid.getMostSigBits(), uuid.getLeastSigBits());
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:JavacServerClient.java

示例4: EventsProcessor

import org.jetbrains.jps.service.SharedThreadPool; //导入方法依赖的package包/类
EventsProcessor() {
  super(SharedThreadPool.getInstance());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:BuildSession.java

示例5: main

import org.jetbrains.jps.service.SharedThreadPool; //导入方法依赖的package包/类
public static void main(String[] args){
  System.out.println("Build process started. Classpath: " + System.getProperty("java.class.path"));
  final String host = args[0];
  final int port = Integer.parseInt(args[1]);
  final UUID sessionId = UUID.fromString(args[2]);
  final File systemDir = new File(FileUtil.toCanonicalPath(args[3]));
  Utils.setSystemRoot(systemDir);

  ourChannelFactory = new NioClientSocketChannelFactory(SharedThreadPool.getInstance(), SharedThreadPool.getInstance(), 1);
  final ClientBootstrap bootstrap = new ClientBootstrap(ourChannelFactory);
  bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
    public ChannelPipeline getPipeline() throws Exception {
      return Channels.pipeline(
        new ProtobufVarint32FrameDecoder(),
        new ProtobufDecoder(CmdlineRemoteProto.Message.getDefaultInstance()),
        new ProtobufVarint32LengthFieldPrepender(),
        new ProtobufEncoder(),
        new MyMessageHandler(sessionId)
      );
    }
  });
  bootstrap.setOption("tcpNoDelay", true);
  bootstrap.setOption("keepAlive", true);

  final ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port));
  future.awaitUninterruptibly();

  final boolean success = future.isSuccess();

  if (success) {
    Channels.write(future.getChannel(), CmdlineProtoUtil.toMessage(sessionId, CmdlineProtoUtil.createParamRequest()));
  }
  else {
    final Throwable reason = future.getCause();
    System.err.println("Error connecting to " + host + ":" + port + "; reason: " + (reason != null? reason.getMessage() : "unknown"));
    if (reason != null) {
      reason.printStackTrace(System.err);
    }
    System.err.println("Exiting.");
    System.exit(-1);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:43,代码来源:BuildMain.java


注:本文中的org.jetbrains.jps.service.SharedThreadPool.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。