X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fws%2Fserver%2FSimpleWSPublisher.java;h=3e3a34bd673d5d1035a8217bae39299d14fb9e6a;hb=ba2d4e920e433bd080f448248e7dacade69a27a0;hp=a2f336756e9b36ff21db27487ebeb087b8fe7ae3;hpb=535359a3d592ee41bda72e7356f0181f6cee9d07;p=jabaws.git diff --git a/webservices/compbio/ws/server/SimpleWSPublisher.java b/webservices/compbio/ws/server/SimpleWSPublisher.java index a2f3367..3e3a34b 100644 --- a/webservices/compbio/ws/server/SimpleWSPublisher.java +++ b/webservices/compbio/ws/server/SimpleWSPublisher.java @@ -1,6 +1,6 @@ -/* Copyright (c) 2009 Peter Troshin +/* Copyright (c) 2011 Peter Troshin * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 + * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 * * This library is free software; you can redistribute it and/or modify it under the terms of the * Apache License version 2 as published by the Apache Software Foundation @@ -28,46 +28,47 @@ import javax.xml.ws.Endpoint; * @author pvtroshin * @date October 2009 */ +@Deprecated public class SimpleWSPublisher { - public SimpleWSPublisher(Object exec, String context) { + public SimpleWSPublisher(Object exec, String context) { - } + } - public static void main(String[] args) { - if (args.length != 2) { - System.out.println("Usage: "); - System.out.println("SimpleWSPublisher context class"); - System.out - .println("where context is a context name, the name after the address by " - + "which web service can be called e.g. Clustal " - + " and class is a web service implementation class"); + public static void main(String[] args) { + if (args.length != 2) { + System.out.println("Usage: "); + System.out.println("SimpleWSPublisher context class"); + System.out + .println("where context is a context name, the name after the address by " + + "which web service can be called e.g. Clustal " + + " and class is a web service implementation class"); + } + String context = args[0]; + String clazzName = args[1]; + try { + Class clazz = Class.forName(clazzName); + if (!clazz.isAnnotationPresent(WebService.class)) { + System.out.println("Can only start web services. " + + "Please check whether the class provided is " + + "annotated with Webservice annotation"); + System.exit(1); + } + Endpoint.publish("http://127.0.0.1:7979/" + context, + clazz.newInstance()); + } catch (InstantiationException e) { + e.printStackTrace(); + System.exit(1); + } catch (IllegalAccessException e) { + e.printStackTrace(); + System.exit(1); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + System.exit(1); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + System.exit(1); + } } - String context = args[0]; - String clazzName = args[1]; - try { - Class clazz = Class.forName(clazzName); - if (!clazz.isAnnotationPresent(WebService.class)) { - System.out.println("Can only start web services. " - + "Please check whether the class provided is " - + "annotated with Webservice annotation"); - System.exit(1); - } - Endpoint.publish("http://127.0.0.1:7979/" + context, clazz - .newInstance()); - } catch (InstantiationException e) { - e.printStackTrace(); - System.exit(1); - } catch (IllegalAccessException e) { - e.printStackTrace(); - System.exit(1); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - System.exit(1); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - System.exit(1); - } - } }