public static void main(String[] args) { if (args.length != 1) System.err.println("Usage: ECServer port"); int port = (new Integer(args[0])).intValue(); try { System.out.println("Attempting to start XML-RPC Server..."); WebServer server = new WebServer(port); XmlRpcServer xmlRpcServer = server.getXmlRpcServer(); PropertyHandlerMapping phm = new PropertyHandlerMapping(); phm.addHandler("EntityComparison", EntityComparison.class); xmlRpcServer.setHandlerMapping(phm); XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl)xmlRpcServer.getConfig(); serverConfig.setEnabledForExtensions(true); serverConfig.setContentLengthOptional(false); server.start(); System.out.println("Started successfully."); System.out.println("Accepting requests. (Halt program to stop.)"); } catch (Exception exception) { System.err.println("ECServer: " + exception); } } }
public void initServer() throws ServletException { server = new ContinuumXmlRpcServletServer(); try { securitySystem = (SecuritySystem) getPlexusContainer().lookup( SecuritySystem.ROLE ); } catch ( ComponentLookupException e ) { throw new ServletException( "Can't init the xml rpc server, unable to obtain security system", e ); } try { XmlRpcServerConfigImpl cfg = (XmlRpcServerConfigImpl) server.getConfig(); cfg.setEnabledForExtensions( true ); PropertiesHandlerMapping mapping = (PropertiesHandlerMapping) lookup( PropertyHandlerMapping.class.getName() ); mapping.setRequestProcessorFactoryFactory( (RequestProcessorFactoryFactory) lookup( RequestProcessorFactoryFactory.class.getName() ) ); mapping.load(); mapping.setAuthenticationHandler( getAuthenticationHandler() ); server.setHandlerMapping( mapping ); } catch ( XmlRpcException e ) { throw new ServletException( "Can't init the xml rpc server", e ); } }
public void initServer() throws ServletException { server = new ContinuumXmlRpcServletServer(); try { securitySystem = (SecuritySystem) getPlexusContainer().lookup( SecuritySystem.ROLE ); } catch ( ComponentLookupException e ) { throw new ServletException( "Can't init the xml rpc server, unable to obtain security system", e ); } try { XmlRpcServerConfigImpl cfg = (XmlRpcServerConfigImpl) server.getConfig(); cfg.setEnabledForExtensions( true ); PropertiesHandlerMapping mapping = (PropertiesHandlerMapping) lookup( PropertyHandlerMapping.class.getName() ); mapping.setRequestProcessorFactoryFactory( (RequestProcessorFactoryFactory) lookup( RequestProcessorFactoryFactory.class.getName() ) ); mapping.load(); mapping.setAuthenticationHandler( getAuthenticationHandler() ); server.setHandlerMapping( mapping ); } catch ( XmlRpcException e ) { throw new ServletException( "Can't init the xml rpc server", e ); } }
public static void server(String indexDirectory, int port) throws IOException, XmlRpcException { log.info( "Starting descartes server at port {}, with index directory {}", Integer.valueOf(port), indexDirectory); DescartesServer.indexDirectory = indexDirectory; WebServer webServer = new WebServer(port); XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer(); PropertyHandlerMapping phm = new PropertyHandlerMapping(); phm.addHandler("DescartesServer", DescartesServer.class); xmlRpcServer.setHandlerMapping(phm); XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl) xmlRpcServer .getConfig(); serverConfig.setEnabledForExtensions(true); serverConfig.setContentLengthOptional(false); webServer.start(); log.info("Descartes is ready!"); }
serverConfig.setEnabledForExtensions(true); serverConfig.setContentLengthOptional(false);
serverConfig.setEnabledForExtensions(false); serverConfig.setContentLengthOptional(false); try { server.start();