public static ServerService manage(final String serviceName, final Properties serviceProperties, ServerService service) { service = new NamedService(service, serviceName); service = new ServiceStats(service); service = new ServiceLogger(service); service = new ServicePool(service, serviceProperties); service = new ServiceAccessController(service); service = new ServiceDaemon(service); return service; }
@Override public void init(final Properties props) throws Exception { parseAdminIPs(props); super.init(props); }
public void init(Properties props) throws Exception { parseAdminIPs(props); next.init(props); }
public void service(Socket socket) throws ServiceException, IOException { // Check authorization checkHostsAuthorization(socket.getInetAddress(), socket.getLocalAddress()); next.service(socket); }
/** * Gets the port number that the * daemon is listening on. */ public int getPort() { return next.getPort(); }
@Override public void run() { if (add) { dl.serviceAdded(uri); } else { dl.serviceRemoved(uri); } } });
/** * Gets the ip number that the * daemon is listening on. */ public String getIP() { return next.getIP(); }
/** * Gets the name of the service. * Used for display purposes only */ public String getName() { return next.getName(); }
public void start() throws ServiceException { // Do our stuff // Then call the next guy next.start(); }
public void stop() throws ServiceException { // Do our stuff // Then call the next guy next.stop(); }
/** * Pulls out the access log information * * @param props * @throws ServiceException */ public void init(Properties props) throws Exception { // Do our stuff // Then call the next guy next.init(props); }
public void run() { if (discoveryListener != null) { discoveryListener.serviceAdded(service); } } }
@Override public void service(final Socket socket) throws ServiceException, IOException { // Check authorization checkHostsAuthorization(socket.getInetAddress(), socket.getLocalAddress()); super.service(socket); }
public ServiceDaemon(ServerService next, int port, String ip) { this.port = port; this.ip = ip; this.address = getAddress(ip); this.next = next; }
public static Server getServer() { if (server == null) { server = new Server(); } return server; }
public static synchronized ServiceManager getManager() { if (manager == null) { manager = new SimpleServiceManager(); } return manager; }
public void setSoTimeout(int timeout) throws SocketException { this.timeout = timeout; if (socketListener != null) { socketListener.setSoTimeout(timeout); } }
@Override public void run() { if (discoveryListener != null) { discoveryListener.serviceAdded(service); } } }
public ServiceDaemon(final ServerService next, final int port, final String ip) { this.port = port; this.ip = ip; this.inetAddress = getAddress(ip); this.next = next; }