public static synchronized void start(String repository, String axis2xml) throws Exception { if (receiver != null) { throw new IllegalStateException("Server already started"); } ConfigurationContext er = getNewConfigurationContext(repository, axis2xml); receiver = new SimpleHTTPServer(er, TESTING_PORT); receiver.start(); System.out.print("Server started on port " + TESTING_PORT + "....."); }
public void stop() { // TODO: add an exeption server.stop(); }
@Override public EndpointReference getEndpointReference(String serviceName) throws AxisFault { return server.getEPRForService(serviceName, "localhost"); }
printUsage(); repository = args[0]; } else { printUsage(); ConfigurationContext configctx = ConfigurationContextFactory .createConfigurationContextFromFileSystem(repository, null); SimpleHTTPServer receiver = new SimpleHTTPServer(configctx, port); Runtime.getRuntime().addShutdownHook(new ShutdownThread(receiver)); receiver.start(); ListenerManager listenerManager = configctx .getListenerManager(); TransportInDescription trsIn = new TransportInDescription(Constants.TRANSPORT_HTTP);
public void start()throws AxisFault { try { //Register the callback service AxisService messageCollectorService = new AxisService("MessageCollector"); MessageReceiver messageReceiver = new MessageReceiver() { public void receive(MessageContext messageCtx) throws AxisFault { if(callback != null){ callback.mesageReceived(messageCtx.getEnvelope()); }else{ System.out.println("Received " + messageCtx.getEnvelope()); } } }; InOutAxisOperation operation1 = new InOutAxisOperation(new QName("receive")); operation1.setMessageReceiver(messageReceiver); messageCollectorService.addOperation(operation1); configContext.getAxisConfiguration().addService(messageCollectorService); axis2Server = new SimpleHTTPServer(configContext, 7777); axis2Server.start(); eventSinkUrl = axis2Server.getEPRForService(messageCollectorService.getName(), InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { throw AxisFault.makeFault(e); } }
public TransportInDescription createTransportInDescription() throws Exception { TransportInDescription desc = new TransportInDescription("http"); desc.setReceiver(new LifecycleFixTransportListenerProxy(new SimpleHTTPServer(), port)); desc.addParameter(new Parameter(SimpleHTTPServer.PARAM_PORT, String.valueOf(port))); return desc; }
public static synchronized void stop() throws AxisFault { if (receiver == null) { throw new IllegalStateException("Server not started"); } receiver.stop(); while (receiver.isRunning()) { try { Thread.sleep(1000); } catch (InterruptedException e1) { } } // tp.doStop(); System.out.print("Server stopped ....."); ListenerManager listenerManager = receiver.getConfigurationContext().getListenerManager(); if (listenerManager != null) { listenerManager.stop(); } receiver = null; }
public static ConfigurationContext getConfigurationContext() { return receiver.getConfigurationContext(); }
printUsage(); repository = args[0]; } else { printUsage(); ConfigurationContext configctx = ConfigurationContextFactory .createConfigurationContextFromFileSystem(repository, null); SimpleHTTPServer receiver = new SimpleHTTPServer(configctx, port); Runtime.getRuntime().addShutdownHook(new ShutdownThread(receiver)); receiver.start(); ListenerManager listenerManager = configctx .getListenerManager(); TransportInDescription trsIn = new TransportInDescription(Constants.TRANSPORT_HTTP);
public static synchronized void unDeployService(QName service) throws AxisFault { receiver.getConfigurationContext().getAxisConfiguration() .removeService(service.getLocalPart()); }
@Override protected void startServer(ConfigurationContext configurationContext) throws Throwable { port = PortAllocator.allocatePort(); server = new SimpleHTTPServer(configurationContext, port); server.start(); }
@Override protected void after() { port = -1; configurationContext = null; server.stop(); server = null; } }
public static synchronized void deployService(AxisService service) throws AxisFault { receiver.getConfigurationContext().getAxisConfiguration().addService( service); }
@Override protected void before() throws Throwable { port = PortAllocator.allocatePort(); configurationContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repositoryPath); server = new SimpleHTTPServer(configurationContext, port); server.start(); }
public void stop() { // TODO: add an exeption server.stop(); }
public static void main(String[] args) throws AxisFault { String axisServerRepo = null; if (args!=null && args.length>0) axisServerRepo = args[0]; if (axisServerRepo!=null && !"".equals(axisServerRepo)) { AXIS2_SERVER_PATH = axisServerRepo; } if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){ System.out.println("ERROR: Please change <SANDESHA2_HOME> to your Sandesha2 installation directory."); return; } System.out.println("Starting sandesha2 server..."); String axis2_xml = AXIS2_SERVER_PATH + "server_axis2.xml"; ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_SERVER_PATH,axis2_xml); SimpleHTTPServer server = new SimpleHTTPServer (configContext,8080); server.start(); } }
@Override protected void stopServer() { port = -1; server.stop(); server = null; } }
/** * @param args * @throws AxisFault * @throws Exception */ public void start() throws AxisFault { ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); context.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); context.getAxisConfiguration().addParameter(SUPPORT_SINGLE_OP, Boolean.valueOf(true)); context.getAxisConfiguration().addParameter(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); Map<String, MessageReceiver> msgRecieverMap = new HashMap<String, MessageReceiver>(); ConsumerMsgReceiver conMsgRcv = new ConsumerMsgReceiver(handler); msgRecieverMap.put("http://www.w3.org/ns/wsdl/in-only", conMsgRcv); AxisService service = AxisService.createService(ConsumerService.class.getName(), context.getAxisConfiguration(), msgRecieverMap, null, null, ConsumerServer.class.getClassLoader()); context.getAxisConfiguration().addService(service); server = new SimpleHTTPServer(context, this.listeningPort); server.start(); consumerService = service; }
public void run() { System.out.println("[SimpleHTTPServer] Shutting down"); server.stop(); System.out.println("[SimpleHTTPServer] Shutdown complete"); } }
/** * @param args * @throws AxisFault * @throws Exception */ public void start() throws AxisFault { ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); context.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); context.getAxisConfiguration().addParameter(SUPPORT_SINGLE_OP, Boolean.valueOf(true)); context.getAxisConfiguration().addParameter(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); Map<String, MessageReceiver> msgRecieverMap = new HashMap<String, MessageReceiver>(); ConsumerMsgReceiver conMsgRcv = new ConsumerMsgReceiver(handler); msgRecieverMap.put("http://www.w3.org/ns/wsdl/in-only", conMsgRcv); AxisService service = AxisService.createService(ConsumerService.class.getName(), context.getAxisConfiguration(), msgRecieverMap, null, null, ConsumerServer.class.getClassLoader()); context.getAxisConfiguration().addService(service); server = new SimpleHTTPServer(context, this.listeningPort); server.start(); consumerService = service; }