@Override public synchronized void start(final boolean block) throws ServiceException { //This implementaion ignores block if (started == null) { throw new ServiceException("ServiceManager not initialized"); } if (stopped) { throw new ServiceException("ServiceManager has already been stopped"); } started = Boolean.TRUE; for (final Map.Entry<Bundle, List<Service>> entry : serverMap.entrySet()) { for (final Service service : entry.getValue()) { service.start(); } } }
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); } } }
@Override public void start() throws ServiceException { try { server.start(); } catch (final Exception e) { throw new ServiceException(e); } }
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(); } } }
@Override public void stop() throws ServiceException { try { server.stop(); } catch (final Exception e) { throw new 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(); } } }
@Override public void start() throws ServiceException { try { server.start(); } catch (Exception e) { throw new ServiceException(e); } }
service.stop(); } catch (ServiceException e) { logger.fatal("Service Shutdown Failed: " + service.getName() + ". Exception: " + e.getMessage(), e);
public void start() throws ServiceException { try { server.start(); } catch (Exception e) { throw new ServiceException(e); } }
daemons[i].stop(); } catch (ServiceException e) { logger.fatal("Service Shutdown Failed: "+daemons[i].getName()+". Exception: "+e.getMessage(), e);
public void stop() throws ServiceException { try { server.stop(); } catch (Exception e) { throw new ServiceException(e); } } }
@Override public void stop() throws ServiceException { try { server.stop(); } catch (Exception e) { throw new ServiceException(e); } } }
/** * start the discovery agent * * @throws ServiceException */ @Override public void start() throws ServiceException { try { if (running.compareAndSet(false, true)) { final InetAddress inetAddress = InetAddress.getByName(host); this.address = new InetSocketAddress(inetAddress, port); multicast = new Multicast(tracker); } } catch (final Exception e) { throw new ServiceException(e); } }
/** * Attempts to return at least one socket per valid network interface. * If no valid interface is found then the array will be empty. * * @param multicastAddress A valid multicast address * @param port A valid multicast port * @return MulticastSocket[], may be empty if no valid interfaces exist * @throws Exception On invalid parameters */ public static MulticastSocket[] getSockets(final String multicastAddress, final int port) throws Exception { final InetAddress ia; try { ia = InetAddress.getByName(multicastAddress); } catch (final UnknownHostException e) { throw new ServiceException(multicastAddress + " is not a valid address", e); } if (null == ia || !ia.isMulticastAddress()) { throw new ServiceException(multicastAddress + " is not a valid multicast address"); } return getSockets(ia, port); }
private void addIPAddressPermissions( LinkedList<IPAddressPermission> permissions, String hostname) throws ServiceException { try { InetAddress[] localIps = InetAddress.getAllByName(hostname); for (int i = 0; i < localIps.length; i++) { if (localIps[i] instanceof Inet4Address) { permissions.add(new ExactIPAddressPermission(localIps[i].getAddress())); } else { permissions.add(new ExactIPv6AddressPermission(localIps[i].getAddress())); } } } catch (UnknownHostException e) { throw new ServiceException("Could not get " + hostname + " inet address", e); } }
private void addIPAddressPermissions( final LinkedList<IPAddressPermission> permissions, final String hostname) throws ServiceException { try { final InetAddress[] localIps = InetAddress.getAllByName(hostname); for (final InetAddress localIp : localIps) { if (localIp instanceof Inet4Address) { permissions.add(new ExactIPAddressPermission(localIp.getAddress())); } else { permissions.add(new ExactIPv6AddressPermission(localIp.getAddress())); } } } catch (UnknownHostException e) { throw new ServiceException("Could not get " + hostname + " inet address", e); } }
serverSocket.setSoTimeout(timeout); } catch (Exception e) { throw new ServiceException("Service failed to open socket", e);
property.startsWith(sc_key_database + ".")) { throw new ServiceException("Databases cannot be declared in the hsql.properties. " + "Instead declare a database connection in the openejb.conf file"); throw new ServiceException("Hsql Server can only host 10 database instances");
throw new ServiceException("Service failed to open socket", e);
this.sockets = getSockets(this.multicast, this.port); } catch (final Exception e) { throw new ServiceException("Failed to get Multicast sockets", e);