/*
 *  Copyright 2017 TWO SIGMA OPEN SOURCE, LLC
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.twosigma.beakerx.kotlin.kernel;

import static com.twosigma.beakerx.kernel.Utils.uuid;

import com.twosigma.beakerx.evaluator.Evaluator;
import com.twosigma.beakerx.handler.KernelHandler;
import com.twosigma.beakerx.kernel.Kernel;
import com.twosigma.beakerx.kernel.KernelConfigurationFile;
import com.twosigma.beakerx.kernel.KernelRunner;
import com.twosigma.beakerx.kernel.KernelSocketsFactory;
import com.twosigma.beakerx.kernel.KernelSocketsFactoryImpl;
import com.twosigma.beakerx.kernel.handler.CommOpenHandler;
import com.twosigma.beakerx.kotlin.comm.KotlinCommOpenHandler;
import com.twosigma.beakerx.kotlin.evaluator.KotlinEvaluator;
import com.twosigma.beakerx.kotlin.handler.KotlinKernelInfoHandler;
import com.twosigma.beakerx.message.Message;
import java.io.IOException;


public class Kotlin extends Kernel {

  public Kotlin(final String id, final Evaluator evaluator,
      KernelSocketsFactory kernelSocketsFactory) {
    super(id, evaluator, kernelSocketsFactory);
    setShellOptions(getKernelParameters(new KotlinDefaultVariables()));
  }

  @Override
  public CommOpenHandler getCommOpenHandler(Kernel kernel) {
    return new KotlinCommOpenHandler(kernel);
  }

  @Override
  public KernelHandler<Message> getKernelInfoHandler(Kernel kernel) {
    return new KotlinKernelInfoHandler(kernel);
  }

  public static void main(final String[] args) throws InterruptedException, IOException {
    KernelRunner.run(() -> {
      String id = uuid();
      KotlinEvaluator e = new KotlinEvaluator(id, id);
      KernelSocketsFactoryImpl kernelSocketsFactory = new KernelSocketsFactoryImpl(
          new KernelConfigurationFile(args));
      return new Kotlin(id, e, kernelSocketsFactory);
    });
  }

}

@@ -661,16 +661,80 @@
 ernel;%0A%0A
+import static com.twosigma.beakerx.DefaultJVMVariables.IMPORTS;%0A
 import s
@@ -779,16 +779,16 @@
 s.uuid;%0A
-
 %0Aimport 
@@ -983,16 +983,69 @@
 onFile;%0A
+import com.twosigma.beakerx.kernel.KernelParameters;%0A
 import c
@@ -1529,16 +1529,42 @@
 eption;%0A
+import java.util.HashMap;%0A
 %0A%0Apublic
@@ -1758,80 +1758,8 @@
 y);%0A
-    setShellOptions(getKernelParameters(new KotlinDefaultVariables()));%0A
   %7D%0A
@@ -1957,32 +1957,32 @@
 ernel kernel) %7B%0A
-
     return new K
@@ -2018,16 +2018,276 @@
 );%0A  %7D%0A%0A
+  @Override%0A  public KernelParameters getKernelParameters() %7B%0A    HashMap%3CString, Object%3E kernelParameters = new HashMap%3C%3E();%0A    kernelParameters.put(IMPORTS, new KotlinDefaultVariables().getImports());%0A    return new KernelParameters(kernelParameters);%0A  %7D%0A%0A
   public

fix the build