Examples of EngineConfig


Examples of org.eclipse.birt.report.engine.api.EngineConfig

    public static synchronized IReportEngine getBirtEngine(ServletContext sc) {
        if (reportEngine == null) {
            LOG.info("开始初始化报表引擎");
            long start=System.currentTimeMillis();
            float total=(float)Runtime.getRuntime().totalMemory()/1000000;
            EngineConfig config = new EngineConfig();

            config.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, BirtReportEngine.class.getClassLoader());
            config.setEngineHome("");

            IPlatformContext context = new PlatformServletContext(sc);
            config.setPlatformContext(context);

            try {
                Platform.startup(config);
            } catch (BirtException e) {
                LOG.error("BIRT启动失败",e);
View Full Code Here

Examples of org.jwebsocket.config.xml.EngineConfig

   */
  @SuppressWarnings("unchecked")
  @Override
  public WebSocketEngine initializeEngine() {
    WebSocketEngine newEngine = null;
    EngineConfig engineConfig = mConfig.getEngines().get(0);
    String jarFilePath = "-";
    try {
      Class lEngineClass = null;

      // try to load engine from classpath first,
      // could be located in server bundle
      try {
        lEngineClass = Class.forName(engineConfig.getName());
        if (mLog.isDebugEnabled()) {
          mLog.debug("Engine '" + engineConfig.getName() + "' loaded from classpath.");
        }
      } catch (ClassNotFoundException ex) {
        // in case of a class not found exception we DO NOT want to
        // show the exception but subsequently load the class from
        if (mLog.isDebugEnabled()) {
          mLog.debug("Engine '" + engineConfig.getName() + "' not yet in classpath, hence trying to load from file...");
        }
      }

      // if not in classpath...
      // try to load engine from given .jar file
      if (lEngineClass == null) {
        jarFilePath = JWebSocketConfig.getLibraryFolderPath(engineConfig.getJar());
        // jarFilePath may be null if .jar is included in server bundle
        if (jarFilePath != null) {
          if (mLog.isDebugEnabled()) {
            mLog.debug("Loading engine '" + engineConfig.getName() + "' from '" + jarFilePath + "'...");
          }
          mClassLoader.addFile(jarFilePath);
          lEngineClass = (Class<WebSocketEngine>) mClassLoader.loadClass(engineConfig.getName());
        }
      }

      // if class found
      // try to create an instance
      if (lEngineClass != null) {
        Constructor<WebSocketEngine> ctor = lEngineClass.getDeclaredConstructor(EngineConfiguration.class);
        ctor.setAccessible(true);
        newEngine = ctor.newInstance(new Object[]{engineConfig});
        if (mLog.isDebugEnabled()) {
          mLog.debug("Engine '" + engineConfig.getId() + "' successfully instantiated.");
        }
      } else {
        mLog.error("jWebSocket engine class " + engineConfig.getName() + " could not be loaded.");
      }
    } catch (MalformedURLException e) {
      mLog.error("Couldn't load the jar file for engine, make sure jar file exists or name is correct", e);
    } catch (ClassNotFoundException e) {
      mLog.error("Engine class '" + engineConfig.getName() + "'@'" + jarFilePath + "' not found", e);
    } catch (InstantiationException e) {
      mLog.error("Engine class could not be instantiated", e);
    } catch (IllegalAccessException e) {
      mLog.error("Illegal Access Exception while intializing engine", e);
    } catch (NoSuchMethodException e) {
View Full Code Here

Examples of org.jwebsocket.config.xml.EngineConfig

    mLog = Logging.getLogger(JWebSocketEmbedded.class);

    // initialize the engine
    List lDomains = new FastList();
    lDomains.add("http://jwebsocket.org");
    EngineConfiguration lEngineConfig = new EngineConfig(
        "tcp0", // id
        "org.jwebsocket.tcp.engines.TCPEngine", // name
        "-", // jar, needs to be in classpath, i.e. embedded in .jar'/manifest
        8787, // port
        120000, // default session timeout
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.