@SuppressWarnings("deprecation") public KeepAliveServer() { this(new EjbServer()); }
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletInputStream in = request.getInputStream(); ServletOutputStream out = response.getOutputStream(); try { ejbServer.service(in, out); } catch (ServiceException e) { throw new ServletException("ServerService error: " + ejbServer.getClass().getName() + " -- " + e.getMessage(), e); } } }
public void destroy() { if (manager != null) { try { manager.stop(); } catch (ServiceException e) { } manager = null; } if (ejbServer != null) { try { ejbServer.stop(); } catch (ServiceException e) { } ejbServer = null; } OpenEJB.destroy(); }
public void init(Properties props) throws Exception { name = props.getProperty("name"); EjbServer ejbServer = new EjbServer(); ServerServiceAdapter adapter = new ServerServiceAdapter(ejbServer); SystemInstance systemInstance = SystemInstance.get(); HttpListenerRegistry registry = systemInstance.getComponent(HttpListenerRegistry.class); if (registry == null){ registry = new HttpListenerRegistry(); systemInstance.setComponent(HttpListenerRegistry.class, registry); } registry.addHttpListener(adapter, "/ejb/?.*"); // register the http server systemInstance.setComponent(HttpServer.class, httpServer); httpServer.init(props); ejbServer.init(props); }
@Override public void init(final Properties props) throws Exception { server = new EjbDaemon(); if (props.getProperty("name") == null) { // to let server be component aware props.setProperty("name", getName()); } server.init(props); keepAlive = new KeepAliveServer(this, server.isGzip()); }
@Override public void init(final Properties props) throws Exception { name = props.getProperty("name"); final EjbServer ejbServer = new EjbServer(); final ServerServiceAdapter adapter = new ServerServiceAdapter(ejbServer); final SystemInstance systemInstance = SystemInstance.get(); HttpListenerRegistry registry = systemInstance.getComponent(HttpListenerRegistry.class); if (registry == null) { registry = new HttpListenerRegistry(); systemInstance.setComponent(HttpListenerRegistry.class, registry); } registry.addHttpListener(adapter, "/ejb/?.*"); // register the http server systemInstance.setComponent(HttpServer.class, httpServer); httpServer.init(props); ejbServer.init(props); }
@Override public void init(final Properties props) throws Exception { name = props.getProperty("name"); final EjbServer ejbServer = new EjbServer(); final ServerServiceAdapter adapter = new ServerServiceAdapter(ejbServer); final SystemInstance systemInstance = SystemInstance.get(); HttpListenerRegistry registry = systemInstance.getComponent(HttpListenerRegistry.class); if (registry == null) { registry = new HttpListenerRegistry(); systemInstance.setComponent(HttpListenerRegistry.class, registry); } registry.addHttpListener(adapter, "/ejb/?.*"); // register the http server systemInstance.setComponent(HttpServer.class, httpServer); httpServer.init(props); ejbServer.init(props); }
protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { if (!activated) { response.getWriter().write(""); return; } final ServletInputStream in = request.getInputStream(); final ServletOutputStream out = response.getOutputStream(); try { RequestInfos.initRequestInfo(request); ejbServer.service(in, out); } catch (final ServiceException e) { throw new ServletException("ServerService error: " + ejbServer.getClass().getName() + " -- " + e.getMessage(), e); } finally { RequestInfos.clearRequestInfo(); } } }
ejbServer.stop(); } catch (ServiceException e) {
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (!activated) { response.getWriter().write(""); return; } ServletInputStream in = request.getInputStream(); ServletOutputStream out = response.getOutputStream(); try { RequestInfos.initRequestInfo(request); ejbServer.service(in, out); } catch (ServiceException e) { throw new ServletException("ServerService error: " + ejbServer.getClass().getName() + " -- " + e.getMessage(), e); } finally { RequestInfos.clearRequestInfo(); } } }
ejbServer.stop(); } catch (final ServiceException e) {